feat: Implement search-a-licious endpoint support#415
Open
saivats wants to merge 4 commits intoopenfoodfacts:developfrom
Open
feat: Implement search-a-licious endpoint support#415saivats wants to merge 4 commits intoopenfoodfacts:developfrom
saivats wants to merge 4 commits intoopenfoodfacts:developfrom
Conversation
raphael0202
requested changes
Jan 26, 2026
Contributor
raphael0202
left a comment
There was a problem hiding this comment.
Thank you for the implementation!
raphael0202
reviewed
Jan 26, 2026
Comment on lines
+196
to
+198
| # Handle environment for Search-a-licious (Requested by review) | ||
| domain = "net" if self.api_config.environment == Environment.net else "org" | ||
| self.base_searchalicious_url = f"https://search.openfoodfacts.{domain}" |
Contributor
There was a problem hiding this comment.
You should probably use URLBuilder here, by adding a search method in a similar way as what's done for Robotoff:
Contributor
|
@saivats I added a comment above regarding URLBuilder, maybe you missed it! |
raphael0202
requested changes
Jan 28, 2026
|
raphael0202
requested changes
Feb 10, 2026
| self.base_search_url = URLBuilder.search(self.api_config.environment) | ||
|
|
||
| def get( | ||
| self, |
Contributor
There was a problem hiding this comment.
It seems you indented by mistake these methods. Can you fix it?
You should run black after each edit, to make sure the formatting stays consistent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR adds support for the new high-performance
search-a-liciousendpoint.Changes
search_a_liciousmethod toProductResource.query,page,sort_by) to the new API structure.hitstoproductsso the output structure matches the existingtext_searchbehavior.Motivation
As discussed with @teolemon and @raphael0202 on Slack, I am building a restaurant management tool (Restron) that requires faster bulk search capabilities. The existing CGI-based search was a bottleneck, so exposing this new endpoint was critical for my use case.
Related Issue
Fixes #314