-
Notifications
You must be signed in to change notification settings - Fork 157
[Search] Add ESQL version of full-text search + filtering tutorial #809
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
Conversation
This tutorial presents examples in {{esql}} syntax. Refer to [the Query DSL version](querydsl-full-text-filter-tutorial.md) for the equivalent examples in Query DSL syntax. | ||
::: | ||
|
||
This is a hands-on introduction to the basics of [full-text search](full-text.md) with Elasticsearch, also known as *lexical search*, and how to filter search results based on exact criteria. In this scenario, we're implementing a search function for a cooking blog. The blog contains recipes with various attributes including textual content, categorical data, and numerical ratings. |
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.
Here we focus primarily on lexical search. where do you think we should add a note on semantic search with match
? If possible I would add a section on semantic search in this guide - can also be done as a follow up.
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.
@ioanatia happy to do it here. The first pass was just duplicating the existing tutorial but I agree that given the simplicity of working with semantic_text in the match
workflow, why not add that here too.
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.
Looks great! 💯
| EVAL category_boost = CASE(category.keyword == "Main Course", 1.0, 0.0) # Conditional boost | ||
| EVAL date_boost = CASE(DATE_DIFF("month", date, NOW()) <= 1, 0.5, 0.0) # Boost recent content | ||
| EVAL custom_score = _score + category_boost + date_boost # Combine scores | ||
| WHERE NOT category.keyword == "Dessert" |
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.
Do you think we should move this closer to FROM, so it doesn't interfere with score calculation but is part of the filtering part?
Co-authored-by: Carlos Delgado <[email protected]>
ESQL equivalent of existing tutorial + semantic search bonus
I had a bash at adding this to learn the new syntax, hopefully at least a few of the examples are correct 😄
👀 Live URL preview