Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Implement text search with OpenFoodFacts API v2 #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

meghana-0211
Copy link

@meghana-0211 meghana-0211 commented Feb 28, 2025

Description

This PR fixes issue #21 by implementing the text search functionality with OpenFoodFacts API v2.

Changes

  • Uncommented and updated the text search route in search.py
  • Changed API method from text_search() to search() to match v2 API
  • Added consistent processing of search results similar to the barcode route
  • Updated error handling and database operations

Testing

Tested the API endpoint with various product names to ensure proper functioning.

Related Issue

Fixes #21

Type of Change

  • 🐛 Bug fix

Checklist

  • Pre-commit hooks have been run successfully
  • Tests pass locally

@areebahmeddd
Copy link
Member

Hi @meghana-0211,

Thanks for the contribution! You're amazing!

Currently, during the GSoC session, I'm participating with Open Food Facts, so it will take me some time to test your changes. However, do check out the API I'm using in this codebase. Seeing your interest, I also suggest you explore it!

Link: https://github.com/openfoodfacts

@meghana-0211
Copy link
Author

meghana-0211 commented Mar 3, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade OpenFoodFacts API
2 participants