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: fixed search products by text #191

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

Fedeton
Copy link
Contributor

@Fedeton Fedeton commented Nov 30, 2023

Description

The /api/v2/search endpoint always returns the same results no matter what text is used.

Solution

Looking at the main site (https://world.openfoodfacts.org) and the openfoodfacts-dart repository I noticed that both use this endpoint /cgi/search.pl which should work fine with the same parameters.

Related issue(s)

@Fedeton Fedeton requested a review from a team as a code owner November 30, 2023 22:28
@alexgarel alexgarel changed the title fixed search products fix: fixed search products by text Dec 1, 2023
@alexgarel
Copy link
Member

@Fedeton thanks !

note:

@alexgarel
Copy link
Member

@Fedeton a quality check is failing, can you fix it ?

@Fedeton
Copy link
Contributor Author

Fedeton commented Dec 1, 2023

I'm sorry. Give me some time and than I try to fix it.

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's indeed important !

@alexgarel
Copy link
Member

Still failing @Fedeton !

@Fedeton
Copy link
Contributor Author

Fedeton commented Dec 1, 2023

I have made another commit, should I do something else or should I just wait?

@Fedeton Fedeton marked this pull request as draft December 4, 2023 14:27
@Fedeton Fedeton marked this pull request as ready for review December 4, 2023 14:31
@alexgarel
Copy link
Member

@Fedeton still failing :-/ (were you able to run tests them locally ?)

openfoodfacts/api.py:90: error: Incompatible types in assignment (expression has type "str", target has type "int") [assignment]
Found 1 error in 1 file (checked 15 source files)
Error: Process completed with exit code 1.

@raphael0202
Copy link
Contributor

@Fedeton can you update your branch with latest commit in develop?
mypy was temporarily failing on some commits in develop, but it's now fixed.

Copy link

sonarcloud bot commented Dec 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Fedeton
Copy link
Contributor Author

Fedeton commented Dec 4, 2023

Hello, I have performed the following steps on my local repo:

  1. git remote add upstream https://github.com/openfoodfacts/openfoodfacts-python.git
  2. git fetch upstream
  3. git checkout develop
  4. git rebase upstream/develop
  5. git checkout product-search
  6. git merge develop
  7. git push
    Are these steps okay?

@alexgarel
Copy link
Member

@Fedeton I invited you to our python team so next time you can start your branch directly on the project :-)

@alexgarel alexgarel merged commit 94c5600 into openfoodfacts:develop Dec 12, 2023
7 checks passed
@alexgarel
Copy link
Member

Thanks for your contribution 🎉

@Fedeton
Copy link
Contributor Author

Fedeton commented Dec 12, 2023

It was a pleasure, thanks to all of you for the support

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.

Problem with product search, something is certainly hardcoded
3 participants