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

feat: add taxonomy autocomplete feature to search-a-licious #60

Merged
merged 8 commits into from
Nov 9, 2023

Conversation

frankbaele
Copy link
Contributor

What

  • added taxonomy autocomplete

Copy link
Contributor

@raphael0202 raphael0202 left a comment

Choose a reason for hiding this comment

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

Thank you for your PR :)
I've added a couple of comments

app/api.py Show resolved Hide resolved
app/query.py Show resolved Hide resolved
app/query.py Outdated Show resolved Hide resolved
app/query.py Outdated Show resolved Hide resolved
"count": response.hits.total["value"]
}
options = []
for field in response.suggest:
Copy link
Contributor

Choose a reason for hiding this comment

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

Not mandatory, but you can use for field, suggestions in response.suggest.items() to avoid doing response.suggest[field][0] above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggest is not a regular dict but a AttrDict so it doesn't have items()

app/openfoodfacts.py Outdated Show resolved Hide resolved
app/indexing.py Outdated Show resolved Hide resolved
app/indexing.py Outdated Show resolved Hide resolved
app/indexing.py Outdated Show resolved Hide resolved
data/config/taxonomy.yml Outdated Show resolved Hide resolved
@raphael0202 raphael0202 changed the title Autocomplete feat: add taxonomy autocomplete feature to search-a-licious Nov 9, 2023
@raphael0202 raphael0202 self-requested a review November 9, 2023 09:30
@raphael0202 raphael0202 merged commit 0359c0b into openfoodfacts:develop Nov 9, 2023
1 of 2 checks passed
@alexgarel
Copy link
Member

Thank you so much @frankbaele for your contribution !

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

Successfully merging this pull request may close these issues.

4 participants