-
Notifications
You must be signed in to change notification settings - Fork 584
Add faceted search tutorial #10333
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
Add faceted search tutorial #10333
Conversation
Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged. Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer. When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review. |
Signed-off-by: kolchfa-aws <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
_tutorials/faceted-search.md
Outdated
|
||
A _facet_ is a filterable field that users can select to narrow their search results. In an e-commerce context, you might see facets like brand, color, size, and price range on the left side of search results. For example, a query like "winter jacket" may return many products. Facets let users filter products by a particular color or price range. | ||
|
||
Faceted search displays value or range counts for each facet, helping users understand the distribution of results and quickly apply filters. This approach is especially useful in e-commerce and location-based search. You can implement facets using `terms` aggregations for exact values (like colors or sizes) and `range` aggregations for continuous values (like prices, dates, or distances). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe link to terms and range aggregation doc
_tutorials/faceted-search.md
Outdated
|
||
The following sections provide examples of advanced faceted search functionality. | ||
|
||
### Post-filter faceting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this can be moved to section Filter by facet values
.
Also I don't think we need to mention the keyword post-filter
, but just describe the function or scenario.
Like the user selects a facet, the query results are filtered for that facet, but the facet selector is kept unchanged.
I think another thing worth mention is global aggregation https://docs.opensearch.org/latest/aggregations/bucket/global/. It always executed on the full dataset, seems a good way to have a unchanged facet selector.
_tutorials/faceted-search.md
Outdated
|
||
</details> | ||
|
||
### Exclude filtering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also feels belong to Filter by facet values
.
User can select or exclude.
_tutorials/faceted-search.md
Outdated
{: .text-delta} | ||
|
||
```json | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I added pictures for some of the responses for easier visualization.
Signed-off-by: Fanit Kolchina <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kolchfa-aws Very nice job on this 😄. Please see my comments (lines 1164 and 1973) and changes and let me know if you have any questions (I'd like you to verify my textual changes as well). Thanks!
Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: kolchfa-aws <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* First draft Signed-off-by: Fanit Kolchina <[email protected]> * Add more examples and extra credit Signed-off-by: Fanit Kolchina <[email protected]> * Add faceted search tutorial Signed-off-by: Fanit Kolchina <[email protected]> * Update _tutorials/faceted-search.md Signed-off-by: kolchfa-aws <[email protected]> * Remove multi-select faceting Signed-off-by: Fanit Kolchina <[email protected]> * Address tech review comments Signed-off-by: Fanit Kolchina <[email protected]> * Apply suggestions from code review Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> --------- Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> Co-authored-by: Nathan Bower <[email protected]> (cherry picked from commit e1dec2f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Closes #2157
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.