-
Notifications
You must be signed in to change notification settings - Fork 578
adding percolate query dsl docs #9798
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
base: main
Are you sure you want to change the base?
adding percolate query dsl docs #9798
Conversation
Signed-off-by: Anton Rubin <anton.rubin@eliatra.com>
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: Anton Rubin <anton.rubin@eliatra.com>
…atra/documentation-website into adding-perculate-query-dsl-docs
@kaushalmahi12 Could you please review this PR? Please carefully review the "Batch compared to named percolation" section and the table provided. The entry marked "Not possible" did not work - is there a way to get it working? Thanks! |
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 have some minor comments
|
||
You can percolate different documents inside a named query: |
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.
We should also mention the comparative performance of this ways vs multiple documents in single percolate query
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.
@kaushalmahi12 Thank you for the review. Regarding this comment, is the difference not already sufficiently covers in "Batch compared to named percolation", later in the page?
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.
Ah I see!, thanks
Signed-off-by: Anton Rubin <anton.rubin@eliatra.com>
|
||
You can percolate different documents inside a named query: |
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.
Ah I see!, thanks
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.
Thank you, @AntonEliatra! Please see my comments and let me know if you have any questions.
@@ -13,7 +13,7 @@ redirect_from: | |||
**Introduced 1.0** | |||
{: .label .label-purple } | |||
|
|||
A percolator field type specifies to treat this field as a query. Any JSON object field can be marked as a percolator field. Normally, documents are indexed and searches are run against them. When you use a percolator field, you store a search, and later the percolate query matches documents to that search. | |||
A percolator field type specifies to treat this field as a query. Any JSON object field can be marked as a percolator field. Normally, documents are indexed and searches are run against them. When you use a percolator field, you store a search, and later the percolate query matches documents to that search. For detailed example see [Percolate]({{site.url}}{{site.baseurl}}/query-dsl/specialized/percolate/) |
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.
A percolator field type specifies to treat this field as a query. Any JSON object field can be marked as a percolator field. Normally, documents are indexed and searches are run against them. When you use a percolator field, you store a search, and later the percolate query matches documents to that search. For detailed example see [Percolate]({{site.url}}{{site.baseurl}}/query-dsl/specialized/percolate/) | |
A percolator field type specifies to treat this field as a query. Any JSON object field can be marked as a percolator field. Normally, documents are indexed and searches are run against them. When you use a percolator field, you store a search, and later the percolate query matches documents to that search. For a detailed example see [Percolate]({{site.url}}{{site.baseurl}}/query-dsl/specialized/percolate/) |
|
||
# Percolate | ||
|
||
Use the `percolate` query to find stored queries that match a given document. This is the opposite of a regular search. Instead of finding documents that match a query, you find queries that match a document. Percolate queries are often used for alerting, notifications, and reverse search use cases. |
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.
Use the `percolate` query to find stored queries that match a given document. This is the opposite of a regular search. Instead of finding documents that match a query, you find queries that match a document. Percolate queries are often used for alerting, notifications, and reverse search use cases. | |
Use the `percolate` query to find stored queries that match a given document. This operation is the opposite of a regular search: instead of finding documents that match a query, you find queries that match a document. Percolate queries are often used for alerting, notifications, and reverse search use cases. |
|
||
Use the `percolate` query to find stored queries that match a given document. This is the opposite of a regular search. Instead of finding documents that match a query, you find queries that match a document. Percolate queries are often used for alerting, notifications, and reverse search use cases. | ||
|
||
- You can percolate a document provided inline or fetch an existing document from an index. |
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.
Please provide an intro sentence for this list.
- You can percolate a document provided inline or fetch an existing document from an index. | ||
- The document and the stored queries must use the same field names and types. | ||
- You can combine percolation with filtering and scoring to build complex matching systems. | ||
- Percolate queries are considered expensive and will only run if the cluster setting `search.allow_expensive_queries` is set to `true` (default). If this setting is `false`, percolate queries will be rejected. |
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.
Link to expensive queries section on the main query DSL page
|
||
Percolate queries are useful in a variety of real-time matching scenarios. Some common use cases include: | ||
|
||
- **E-commerce notifications**: Customers can register interest in products, for example: “Notify me when new Apple laptops are in stock”. When new product documents are indexed, the system finds all users with matching saved queries and sends alerts. |
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.
- **E-commerce notifications**: Customers can register interest in products, for example: “Notify me when new Apple laptops are in stock”. When new product documents are indexed, the system finds all users with matching saved queries and sends alerts. | |
- **E-commerce notifications**: Users can register interest in products, for example: “Notify me when new Apple laptops are in stock”. When new product documents are indexed, the system finds all users with matching saved queries and sends alerts. |
| `field` | Required | Field containing the stored percolator queries. | | ||
| `document` | Optional | Single inline document to match against saved queries. | | ||
| `documents` | Optional | Array of multiple inline documents to match. | | ||
| `index` | Optional | Index containing the document you want to match. | |
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.
| `index` | Optional | Index containing the document you want to match. | | |
| `index` | Optional | An index containing the document you want to match. | |
| `document` | Optional | Single inline document to match against saved queries. | | ||
| `documents` | Optional | Array of multiple inline documents to match. | | ||
| `index` | Optional | Index containing the document you want to match. | | ||
| `id` | Optional | ID of the document to fetch from the index. | |
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.
| `id` | Optional | ID of the document to fetch from the index. | | |
| `id` | Optional | The ID of the document to fetch from the index. | |
| `documents` | Optional | Array of multiple inline documents to match. | | ||
| `index` | Optional | Index containing the document you want to match. | | ||
| `id` | Optional | ID of the document to fetch from the index. | | ||
| `routing` | Optional | Routing value to use when fetching the document. | |
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.
| `routing` | Optional | Routing value to use when fetching the document. | | |
| `routing` | Optional | The routing value to use when fetching the document. | |
| `index` | Optional | Index containing the document you want to match. | | ||
| `id` | Optional | ID of the document to fetch from the index. | | ||
| `routing` | Optional | Routing value to use when fetching the document. | | ||
| `preference` | Optional | Preference for the shard routing when fetching the document. | |
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.
| `preference` | Optional | Preference for the shard routing when fetching the document. | | |
| `preference` | Optional | The preference for the shard routing when fetching the document. | |
| `id` | Optional | ID of the document to fetch from the index. | | ||
| `routing` | Optional | Routing value to use when fetching the document. | | ||
| `preference` | Optional | Preference for the shard routing when fetching the document. | | ||
| `name` | Optional | Name assigned to a percolate clause, helpful when using multiple percolates in a `bool` query. | |
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.
| `name` | Optional | Name assigned to a percolate clause, helpful when using multiple percolates in a `bool` query. | | |
| `name` | Optional | The name assigned to a `percolate` clause. Helpful when using multiple `percolate` clauses in a `bool` query. | |
Description
adding percolate query dsl docs
Version
all
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.