diff --git a/docs-site/content/27.1/api/curation.md b/docs-site/content/27.1/api/curation.md index 105a36b1..aa2f919c 100644 --- a/docs-site/content/27.1/api/curation.md +++ b/docs-site/content/27.1/api/curation.md @@ -19,16 +19,16 @@ When using [Synonyms](./synonyms.md) and Overrides together, Overrides are handl In the following example, we will: -1. Use the `includes` condition to place the documents with ids `422` and `54` in the first and second positions +1. Use the `includes` condition to place the documents with ids `422` and `54` in the first and second positions respectively. -2. Use the `excludes` condition to remove the document with id `287` from the results. - +2. Use the `excludes` condition to remove the document with id `287` from the results. + Typesense allows you to use both `includes` and `excludes` or just one of them for curation. -Note how we are applying these overrides to an `exact` match of the query `apple`. Instead, if we want to match all +Note how we are applying these overrides to an `exact` match of the query `apple`. Instead, if we want to match all queries containing the word `apple`, we will use the `contains` match instead. - + + @@ -228,7 +249,7 @@ You can add tags to override rules and then trigger curation by referring to the ] } ``` -Now, when we search the collection, we can pass one or more tags via the `override_tags` parameter to directly +Now, when we search the collection, we can pass one or more tags via the `override_tags` parameter to directly trigger the curations rules that match the tags: ```json @@ -241,18 +262,18 @@ trigger the curations rules that match the tags: If `override1` is tagged with `tagA,tagB`, and `override2` is tagged with just `tagA` and `override3` is not tagged: -1. If a search sets `override_tags` to `tagA`, we only consider overrides that contain `tagA` (`override1` and `override2`) +1. If a search sets `override_tags` to `tagA`, we only consider overrides that contain `tagA` (`override1` and `override2`) with the usual logic -- in alphabetic order of override name and then process both if stop rule processing is false. -2. If a search sets `override_tags` to `tagA,tagB`, we evaluate any rules that contain both `tagA` and tagB first, - then rules with either `tagA` or `tagB`, but not overrides that contain no tags. Within each group, we evaluate - in alphabetic order of override name and process multiple rules if `stop_processing` is `false`. +2. If a search sets `override_tags` to `tagA,tagB`, we evaluate any rules that contain both `tagA` and tagB first, + then rules with either `tagA` or `tagB`, but not overrides that contain no tags. Within each group, we evaluate + in alphabetic order of override name and process multiple rules if `stop_processing` is `false`. 3. If a search sets no `override_tags`, we only consider rules that have no tags associated with them. ### Dynamic filtering In the following example, we will apply a filter dynamically to a query that matches a rule. - + + @@ -371,22 +409,22 @@ curl "http://localhost:8108/collections/companies/overrides/brand-filter" -X PUT -With this override in effect, any query that contains a brand will automatically be filtered on the matching brand -directly. In addition, the brand will also be removed from the original query tokens, so that the search is made -only on the remaining tokens. +With this override in effect, any query that contains a brand will automatically be filtered on the matching brand +directly. In addition, the brand will also be removed from the original query tokens, so that the search is made +only on the remaining tokens. -For example, if someone searches for `sony ericsson phone`, the query will be re-written as `phone` and a -`sony ericsson` brand filter will be directly applied. If you don't wish to remove matching tokens from the query, +For example, if someone searches for `sony ericsson phone`, the query will be re-written as `phone` and a +`sony ericsson` brand filter will be directly applied. If you don't wish to remove matching tokens from the query, set `remove_matched_tokens` to `false`. By default, this parameter is set to `true`. :::tip Note -Fields used in the query for dynamic filtering should have `facet: true` in their field definition in the schema. +Fields used in the query for dynamic filtering should have `facet: true` in their field definition in the schema. ::: ### Curation and filtering `includes` is used to fix documents at certain positions in the results, but it's possible for these documents to -be filtered out when using `filter_curated_hits: true`. +be filtered out when using `filter_curated_hits: true`. When this happens, Typesense "slides" any remaining documents added by `includes` up in the results. For example, say you have a collection of product records that look like this when sorted on a `ranking` field: @@ -467,7 +505,7 @@ Listing all overrides associated with a given collection. NOTE: By default, ALL overrides are returned, but you can use the `offset` and `limit` parameters to paginate on the listing. - + + @@ -565,7 +610,7 @@ curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \ ## Retrieve an override Fetch an individual override associated with a collection. - + + @@ -659,7 +711,7 @@ curl "http://localhost:8108/collections/companies/overrides/customize-apple" -X ## Delete an override Deleting an override associated with a collection. - + +