{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/algolia/main/json-schema/algolia-rule-schema.json", "title": "rule", "description": "Rule object.", "x-generated": "2026-09-23", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/algolia-search-api-openapi.yml#/components/schemas/rule", "type": "object", "additionalProperties": false, "properties": { "objectID": { "$ref": "#/$defs/ruleID" }, "conditions": { "type": "array", "minItems": 0, "maxItems": 25, "description": "Conditions that trigger a rule.\n\nSome consequences require specific conditions or don't require any condition.\nFor more information, see [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions).\n", "items": { "$ref": "#/$defs/condition" } }, "consequence": { "$ref": "#/$defs/consequence" }, "description": { "type": "string", "description": "Description of the rule's purpose to help you distinguish between different rules." }, "enabled": { "type": "boolean", "default": true, "description": "Whether the rule is active." }, "validity": { "type": "array", "description": "Time periods when the rule is active.", "items": { "$ref": "#/$defs/timeRange" } }, "tags": { "type": "array", "items": { "type": "string" } }, "scope": { "type": "string" }, "condition": { "deprecated": true, "description": "Legacy field for a single condition. This field is maintained for backward compatibility \nwith older rules but should not be used in new implementations.\n", "$ref": "#/$defs/condition" } }, "required": [ "objectID", "consequence" ], "$defs": { "IndexSettings_advancedSyntaxFeatures": { "type": "array", "items": { "$ref": "#/$defs/advancedSyntaxFeatures" }, "description": "Advanced search syntax features you want to support\n- `exactPhrase`.\n Phrases in quotes must match exactly.\n For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\"\n- `excludeWords`.\n Query words prefixed with a `-` must not occur in a record.\n For example, `search -engine` matches records that contain \"search\" but not \"engine\"\nThis setting only has an effect if `advancedSyntax` is true.\n", "default": [ "exactPhrase", "excludeWords" ], "x-categories": [ "Query strategy" ] }, "IndexSettings_alternativesAsExact": { "type": "array", "items": { "$ref": "#/$defs/alternativesAsExact" }, "description": "Determine which plurals and synonyms should be considered an exact matches\nBy default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching.\nFor example\n- \"swimsuit\" and \"swimsuits\" are treated the same\n- \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms))\n- `ignorePlurals`.\n Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches\n- `singleWordSynonym`.\n Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches\n- `multiWordsSynonym`.\n Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches.\n", "default": [ "ignorePlurals", "singleWordSynonym" ], "x-categories": [ "Query strategy" ] }, "advancedSyntax": { "type": "boolean", "description": "Whether to support phrase matching and excluding words from search queries\nUse the `advancedSyntaxFeatures` parameter to control which feature is supported.\n", "default": false, "x-categories": [ "Query strategy" ] }, "advancedSyntaxFeatures": { "type": "string", "enum": [ "exactPhrase", "excludeWords" ], "x-categories": [ "Query strategy" ] }, "allowTyposOnNumericTokens": { "type": "boolean", "description": "Whether to allow typos on numbers in the search query\nTurn off this setting to reduce the number of irrelevant matches\nwhen searching in large sets of similar numbers.\n", "default": true, "x-categories": [ "Typos" ] }, "alternativesAsExact": { "type": "string", "enum": [ "ignorePlurals", "singleWordSynonym", "multiWordsSynonym", "ignoreConjugations" ], "x-categories": [ "Query strategy" ] }, "analytics": { "type": "boolean", "description": "Whether this search will be included in Analytics.", "default": true, "x-categories": [ "Analytics" ] }, "analyticsTags": { "type": "array", "items": { "type": "string" }, "description": "Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments).", "default": [] }, "anchoring": { "type": "string", "description": "Which part of the search query the pattern should match:\n\n- `startsWith`. The pattern must match the beginning of the query.\n- `endsWith`. The pattern must match the end of the query.\n- `is`. The pattern must match the query exactly.\n- `contains`. The pattern must match anywhere in the query.\n\nEmpty queries are only allowed as patterns with `anchoring: is`.\n", "enum": [ "is", "startsWith", "endsWith", "contains" ] }, "aroundLatLng": { "type": "string", "description": "Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude.\n\nOnly records included within a circle around this central location are included in the results.\nThe radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings.\nThis parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.\n", "default": "", "x-categories": [ "Geo-Search" ] }, "aroundLatLngViaIP": { "type": "boolean", "description": "Whether to obtain the coordinates from the request's IP address.", "default": false, "x-categories": [ "Geo-Search" ] }, "aroundPrecision": { "description": "Precision of a coordinate-based search in meters to group results with similar distances.\n\nThe Geo ranking criterion considers all matches within the same range of distances to be equal.\n", "oneOf": [ { "type": "integer", "default": 10, "description": "Distance in meters to group results by similar distances.\n\nFor example, if you set `aroundPrecision` to 100, records wihin 100 meters to the central coordinate are considered to have the same distance,\nas are records between 100 and 199 meters.\n" }, { "$ref": "#/$defs/aroundPrecisionFromValue" } ], "x-categories": [ "Geo-Search" ] }, "aroundPrecisionFromValue": { "title": "range objects", "type": "array", "items": { "title": "range", "type": "object", "description": "Range object with lower and upper values in meters to define custom ranges.", "properties": { "from": { "type": "integer", "description": "Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal." }, "value": { "type": "integer", "description": "Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal." } } } }, "aroundRadius": { "description": "Maximum radius for a search around a central location.\n\nThis parameter works in combination with the `aroundLatLng` and `aroundLatLngViaIP` parameters.\nBy default, the search radius is determined automatically from the density of hits around the central location.\nThe search radius is small if there are many hits close to the central coordinates.\n", "oneOf": [ { "type": "integer", "minimum": 1, "description": "Maximum search radius around a central location in meters." }, { "$ref": "#/$defs/aroundRadiusAll" } ], "x-categories": [ "Geo-Search" ] }, "aroundRadiusAll": { "title": "all", "type": "string", "description": "Return all records with a valid `_geoloc` attribute. Don't filter by distance.", "enum": [ "all" ] }, "attributeCriteriaComputedByMinProximity": { "type": "boolean", "description": "Whether the best matching attribute should be determined by minimum proximity\nThis setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting.\nIf true, the best matching attribute is selected based on the minimum proximity of multiple matches.\nOtherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.\n", "default": false, "x-categories": [ "Advanced" ] }, "attributesToHighlight": { "type": "array", "items": { "type": "string" }, "description": "Attributes to highlight\nBy default, all searchable attributes are highlighted.\nUse `*` to highlight all attributes or use an empty array `[]` to turn off highlighting.\nAttribute names are case-sensitive\nWith highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`.\nYou can use this to visually highlight matching parts of a search query in your UI\nFor more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js).\n", "x-categories": [ "Highlighting and Snippeting" ] }, "attributesToRetrieve": { "type": "array", "items": { "type": "string" }, "description": "Attributes to include in the API response\nTo reduce the size of your response, you can retrieve only some of the attributes.\nAttribute names are case-sensitive\n- `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings.\n- To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`.\n- The `objectID` attribute is always included.\n", "default": [ "*" ], "x-categories": [ "Attributes" ] }, "attributesToSnippet": { "type": "array", "items": { "type": "string" }, "description": "Attributes for which to enable snippets.\nAttribute names are case-sensitive\nSnippets provide additional context to matched words.\nIf you enable snippets, they include 10 words, including the matched word.\nThe matched word will also be wrapped by HTML tags for highlighting.\nYou can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`,\nwhere `NUMBER` is the number of words to be extracted.\n", "default": [], "x-categories": [ "Highlighting and Snippeting" ] }, "automaticFacetFilter": { "type": "object", "description": "Filter or optional filter to be applied to the search.", "additionalProperties": false, "properties": { "facet": { "type": "string", "description": "Facet name to be applied as filter.\nThe name must match placeholders in the `pattern` parameter.\nFor example, with `pattern: {facet:genre}`, `automaticFacetFilters` must be `genre`.\n" }, "score": { "type": "integer", "default": 1, "description": "Filter scores to give different weights to individual filters." }, "disjunctive": { "type": "boolean", "default": false, "description": "Whether the filter is disjunctive or conjunctive.\n\nIf true the filter has multiple matches, multiple occurrences are combined with the logical `OR` operation.\nIf false, multiple occurrences are combined with the logical `AND` operation.\n" } }, "required": [ "facet" ] }, "automaticFacetFilters": { "description": "Filter to be applied to the search.\n\nYou can use this to respond to search queries that match a facet value.\nFor example, if users search for \"comedy\", which matches a facet value of the \"genre\" facet,\nyou can filter the results to show the top-ranked comedy movies.\n", "oneOf": [ { "type": "array", "items": { "$ref": "#/$defs/automaticFacetFilter" } }, { "type": "array", "items": { "type": "string" } } ] }, "banner": { "description": "Banner with image and link to redirect users.", "type": "object", "additionalProperties": false, "properties": { "image": { "$ref": "#/$defs/bannerImage" }, "link": { "$ref": "#/$defs/bannerLink" } } }, "bannerImage": { "description": "Image to show inside a banner.", "type": "object", "additionalProperties": false, "properties": { "urls": { "type": "array", "items": { "$ref": "#/$defs/bannerImageUrl" } }, "title": { "type": "string" } } }, "bannerImageUrl": { "description": "URL for an image to show inside a banner.", "type": "object", "additionalProperties": false, "properties": { "url": { "type": "string" } } }, "bannerLink": { "description": "Link for a banner defined in the Merchandising Studio.", "type": "object", "additionalProperties": false, "properties": { "url": { "type": "string" } } }, "banners": { "description": "Banners defined in the Merchandising Studio for a given search.", "type": "array", "items": { "$ref": "#/$defs/banner" } }, "baseSearchParamsWithoutQuery": { "type": "object", "additionalProperties": false, "properties": { "similarQuery": { "$ref": "#/$defs/similarQuery" }, "filters": { "$ref": "#/$defs/filters" }, "facetFilters": { "$ref": "#/$defs/facetFilters" }, "optionalFilters": { "$ref": "#/$defs/optionalFilters" }, "numericFilters": { "$ref": "#/$defs/numericFilters" }, "tagFilters": { "$ref": "#/$defs/tagFilters" }, "sumOrFiltersScores": { "$ref": "#/$defs/sumOrFiltersScores" }, "restrictSearchableAttributes": { "$ref": "#/$defs/restrictSearchableAttributes" }, "facets": { "type": "array", "items": { "type": "string" }, "description": "Facets for which to retrieve facet values that match the search criteria and the number of matching facet values\nTo retrieve all facets, use the wildcard character `*`.\nFor more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).\n", "default": [], "x-categories": [ "Faceting" ] }, "facetingAfterDistinct": { "$ref": "#/$defs/facetingAfterDistinct" }, "page": { "$ref": "#/$defs/page" }, "offset": { "type": "integer", "description": "Position of the first hit to retrieve.", "x-categories": [ "Pagination" ] }, "length": { "$ref": "#/$defs/length" }, "aroundLatLng": { "$ref": "#/$defs/aroundLatLng" }, "aroundLatLngViaIP": { "$ref": "#/$defs/aroundLatLngViaIP" }, "aroundRadius": { "$ref": "#/$defs/aroundRadius" }, "aroundPrecision": { "$ref": "#/$defs/aroundPrecision" }, "minimumAroundRadius": { "$ref": "#/$defs/minimumAroundRadius" }, "insideBoundingBox": { "$ref": "#/$defs/insideBoundingBox" }, "insidePolygon": { "$ref": "#/$defs/insidePolygon" }, "naturalLanguages": { "$ref": "#/$defs/naturalLanguages" }, "ruleContexts": { "$ref": "#/$defs/ruleContexts" }, "personalizationImpact": { "$ref": "#/$defs/personalizationImpact" }, "userToken": { "$ref": "#/$defs/userToken" }, "getRankingInfo": { "$ref": "#/$defs/getRankingInfo" }, "synonyms": { "$ref": "#/$defs/synonyms" }, "clickAnalytics": { "$ref": "#/$defs/clickAnalytics" }, "analytics": { "$ref": "#/$defs/analytics" }, "analyticsTags": { "$ref": "#/$defs/analyticsTags", "x-categories": [ "Analytics" ] }, "percentileComputation": { "$ref": "#/$defs/percentileComputation" }, "enableABTest": { "$ref": "#/$defs/enableABTest" } } }, "booleanString": { "type": "string", "enum": [ "true", "false" ] }, "clickAnalytics": { "type": "boolean", "description": "Whether to include a `queryID` attribute in the response\nThe query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).\n", "default": false, "x-categories": [ "Analytics" ] }, "condition": { "type": "object", "additionalProperties": false, "properties": { "pattern": { "type": "string", "description": "Query pattern that triggers the rule.\n\nYou can use either a literal string, or a special pattern `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name.\nThe rule is triggered if the query matches the literal string or a value of the specified facet.\nFor example, with `pattern: {facet:genre}`, the rule is triggered when users search for a genre, such as \"comedy\".\n" }, "anchoring": { "$ref": "#/$defs/anchoring" }, "alternatives": { "type": "boolean", "description": "Whether the pattern should match plurals, synonyms, and typos.", "default": false }, "context": { "$ref": "#/$defs/context" }, "filters": { "type": "string", "description": "Filters that trigger the rule.\n\nYou can add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected.\nYou can use `filters` on its own or combine it with the `pattern` parameter.\nYou can't combine multiple filters with `OR` and you can't use numeric filters.\n" } } }, "consequence": { "type": "object", "description": "Effect of the rule.\n\nFor more information, see [Consequences](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#consequences).\n", "additionalProperties": false, "properties": { "params": { "$ref": "#/$defs/consequenceParams" }, "promote": { "type": "array", "maxItems": 300, "description": "Records you want to pin to a specific position in the search results.\n\nYou can promote up to 300 records, either individually, or as groups of up to 100 records each.\n", "items": { "$ref": "#/$defs/promote" } }, "filterPromotes": { "type": "boolean", "default": false, "description": "Determines whether promoted records must also match active filters for the consequence to apply.\n\nThis ensures user-applied filters take priority and irrelevant matches aren't shown.\nFor example, if you promote a record with `color: red` but the user filters for `color: blue`,\nthe \"red\" record won't be shown.\n\n> In the Algolia dashboard, when you use the **Pin an item** consequence, `filterPromotes` appears as the checkbox: **Pinned items must match active filters to be displayed.** For examples, see [Promote results with rules](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/promote-hits/#promote-results-matching-active-filters).\n" }, "hide": { "type": "array", "maxItems": 50, "description": "Records you want to hide from the search results.", "items": { "title": "consequenceHide", "type": "object", "description": "Object ID of the record to hide.", "additionalProperties": false, "properties": { "objectID": { "$ref": "#/$defs/objectID" } }, "required": [ "objectID" ] } }, "redirect": { "title": "consequenceRedirect", "type": "object", "description": "Redirect to a virtual replica index.\n\nThis consequence is only valid for rules with `scope: redirect`.\n", "additionalProperties": false, "properties": { "indexName": { "type": "string", "description": "Name of the virtual replica index to redirect searches to." } }, "required": [ "indexName" ] }, "userData": { "type": "object", "description": "A JSON object with custom data that will be appended to the `userData` array in the response.\nThis object isn't interpreted by the API and is limited to 1 kB of minified JSON.\n" } } }, "consequenceParams": { "allOf": [ { "$ref": "#/$defs/baseSearchParamsWithoutQuery" }, { "$ref": "#/$defs/indexSettingsAsSearchParams" }, { "$ref": "#/$defs/params" } ] }, "consequenceQuery": { "description": "Replace or edit the search query.\n\nIf `consequenceQuery` is a string, the entire search query is replaced with that string.\nIf `consequenceQuery` is an object, it describes incremental edits made to the query.\n", "oneOf": [ { "$ref": "#/$defs/consequenceQueryObject" }, { "type": "string" } ] }, "consequenceQueryObject": { "type": "object", "additionalProperties": false, "properties": { "remove": { "description": "Words to remove from the search query.", "type": "array", "items": { "type": "string" } }, "edits": { "description": "Changes to make to the search query.", "type": "array", "items": { "$ref": "#/$defs/edit" } } } }, "context": { "type": "string", "pattern": "[A-Za-z0-9_-]+", "description": "An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter.\nFor example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`.\nA rule context must only contain alphanumeric characters.\n" }, "decompoundQuery": { "type": "boolean", "description": "Whether to split compound words in the query into their building blocks\nFor more information, see [Word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words).\nWord segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.\nDecompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark).\nFor example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).\n", "default": true, "x-categories": [ "Languages" ] }, "disableExactOnAttributes": { "type": "array", "items": { "type": "string" }, "description": "Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes).\nAttribute names are case-sensitive\nThis can be useful for attributes with long values, where the likelihood of an exact match is high,\nsuch as product descriptions.\nTurning off the Exact ranking criterion for these attributes favors exact matching on other attributes.\nThis reduces the impact of individual attributes with a lot of content on ranking.\n", "default": [], "x-categories": [ "Query strategy" ] }, "disableTypoToleranceOnAttributes": { "type": "array", "items": { "type": "string" }, "description": "Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance).\nAttribute names are case-sensitive\nReturning only exact matches can help when\n- [Searching in hyphenated attributes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes).\n- Reducing the number of matches when you have too many.\n This can happen with attributes that are long blocks of text, such as product descriptions\nConsider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.\n", "default": [], "x-categories": [ "Typos" ] }, "distinct": { "description": "Determines how many records of a group are included in the search results.\n\nRecords with the same value for the `attributeForDistinct` attribute are considered a group.\nThe `distinct` setting controls how many members of the group are returned.\nThis is useful for [deduplication and grouping](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature).\n\nThe `distinct` setting is ignored if `attributeForDistinct` is not set.\n", "oneOf": [ { "type": "boolean", "description": "Whether deduplication is turned on. If true, only one member of a group is shown in the search results." }, { "type": "integer", "description": "Number of members of a group of records to include in the search results.\n\n- Don't use `distinct > 1` for records that might be [promoted by rules](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/promote-hits).\n The number of hits won't be correct and faceting won't work as expected.\n- With `distinct > 1`, the `hitsPerPage` parameter controls the number of returned groups.\n For example, with `hitsPerPage: 10` and `distinct: 2`, up to 20 records are returned.\n Likewise, the `nbHits` response attribute contains the number of returned groups.\n", "minimum": 0, "maximum": 4, "default": 0 } ], "x-categories": [ "Advanced" ] }, "edit": { "type": "object", "additionalProperties": false, "properties": { "type": { "$ref": "#/$defs/editType" }, "delete": { "description": "Text or patterns to remove from the query string.", "type": "string" }, "insert": { "description": "Text to be added in place of the deleted text inside the query string.", "type": "string" } } }, "editType": { "description": "Type of edit.", "type": "string", "enum": [ "remove", "replace" ] }, "enableABTest": { "type": "boolean", "description": "Whether to enable A/B testing for this search.", "default": true, "x-categories": [ "Advanced" ] }, "enablePersonalization": { "type": "boolean", "description": "Whether to enable Personalization.", "default": false, "x-categories": [ "Personalization" ] }, "enableReRanking": { "type": "boolean", "description": "Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking)\nThis setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.\n", "default": true, "x-categories": [ "Filtering" ] }, "enableRules": { "type": "boolean", "description": "Whether to enable rules.", "default": true, "x-categories": [ "Rules" ] }, "exactOnSingleWordQuery": { "type": "string", "enum": [ "attribute", "none", "word" ], "description": "Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the search query has only one word.\n\n- `attribute`.\n The Exact ranking criterion is 1 if the query word and attribute value are the same.\n For example, a search for \"road\" will match the value \"road\", but not \"road trip\".\n\n- `none`.\n The Exact ranking criterion is ignored on single-word searches.\n\n- `word`.\n The Exact ranking criterion is 1 if the query word is found in the attribute value.\n The query word must have at least 3 characters and must not be a stop word.\n Only exact matches will be highlighted,\n partial and prefix matches won't.\n", "default": "attribute", "x-categories": [ "Query strategy" ] }, "facetFilters": { "description": "Filter the search by facet values, so that only records with the same facet values are retrieved.\n\n**Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.**\n\n- `[filter1, filter2]` is interpreted as `filter1 AND filter2`.\n- `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`.\n- `facet:-value` is interpreted as `NOT facet:value`.\n\nWhile it's best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash:\n`facet:\\-value`.\n", "oneOf": [ { "type": "array", "items": { "$ref": "#/$defs/facetFilters" } }, { "type": "string" } ], "x-categories": [ "Filtering" ] }, "facetOrdering": { "description": "Order of facet names and facet values in your UI.", "type": "object", "additionalProperties": false, "properties": { "facets": { "$ref": "#/$defs/facets" }, "values": { "$ref": "#/$defs/values" } } }, "facetingAfterDistinct": { "type": "boolean", "description": "Whether faceting should be applied after deduplication with `distinct`\nThis leads to accurate facet counts when using faceting in combination with `distinct`.\nIt's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting,\nas `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.\n", "default": false, "x-categories": [ "Faceting" ] }, "facets": { "description": "Order of facet names.", "type": "object", "additionalProperties": false, "properties": { "order": { "$ref": "#/$defs/order" } } }, "filters": { "type": "string", "description": "Filter expression to only include items that match the filter criteria in the response.\n\nYou can use these filter expressions:\n\n- **Numeric filters.** ` `, where `` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`.\n- **Ranges.** `: TO `, where `` and `` are the lower and upper limits of the range (inclusive).\n- **Facet filters.** `:`, where `` is a facet attribute (case-sensitive) and `` a facet value.\n- **Tag filters.** `_tags:` or just `` (case-sensitive).\n- **Boolean filters.** `: true | false`.\n\nYou can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions:\n\n- You can only combine filters of the same type with `OR`.\n **Not supported:** `facet:value OR num > 3`.\n- You can't use `NOT` with combinations of filters.\n **Not supported:** `NOT(facet:value OR facet:value)`\n- You can't combine conjunctions (`AND`) with `OR`.\n **Not supported:** `facet:value OR (facet:value AND facet:value)`\n\nUse quotes if the facet attribute name or facet value contains spaces, keywords (`OR`, `AND`, `NOT`), or quotes.\nIf a facet attribute is an array, the filter matches if it matches at least one element of the array.\n\nFor more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering).\n", "x-categories": [ "Filtering" ] }, "getRankingInfo": { "type": "boolean", "description": "Whether the search response should include detailed ranking information.", "default": false, "x-categories": [ "Advanced" ] }, "hide": { "description": "Hide facet values.", "type": "array", "items": { "type": "string" } }, "highlightPostTag": { "type": "string", "description": "HTML tag to insert after the highlighted parts in all highlighted results and snippets.", "default": "", "x-categories": [ "Highlighting and Snippeting" ] }, "highlightPreTag": { "type": "string", "description": "HTML tag to insert before the highlighted parts in all highlighted results and snippets.", "default": "", "x-categories": [ "Highlighting and Snippeting" ] }, "hitsPerPage": { "type": "integer", "description": "Number of hits per page.", "default": 20, "minimum": 1, "maximum": 1000, "x-categories": [ "Pagination" ] }, "ignorePlurals": { "description": "Treat singular, plurals, and other forms of declensions as equivalent.\nOnly use this feature for the languages used in your index.\n", "oneOf": [ { "type": "array", "description": "ISO code for languages for which this feature should be active.\nThis overrides languages you set with `queryLanguages`.\n", "items": { "$ref": "#/$defs/supportedLanguage" } }, { "$ref": "#/$defs/booleanString" }, { "type": "boolean", "description": "If true, `ignorePlurals` is active for all languages included in `queryLanguages`, or for all supported languages, if `queryLanguges` is empty.\nIf false, singulars, plurals, and other declensions won't be considered equivalent.\n", "default": false } ], "x-categories": [ "Languages" ] }, "indexSettingsAsSearchParams": { "type": "object", "additionalProperties": false, "properties": { "attributesToRetrieve": { "$ref": "#/$defs/attributesToRetrieve" }, "ranking": { "type": "array", "items": { "type": "string" }, "description": "Determines the order in which Algolia returns your results.\n\nBy default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria).\nThe tie-breaking algorithm sequentially applies each criterion in the order they're specified.\nIf you configure a replica index for [sorting by an attribute](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/sort-by-attribute),\nyou put the sorting attribute at the top of the list.\n\n**Modifiers**\n\n- `asc(\"ATTRIBUTE\")`.\n Sort the index by the values of an attribute, in ascending order.\n- `desc(\"ATTRIBUTE\")`.\n Sort the index by the values of an attribute, in descending order.\n\nBefore you modify the default setting,\ntest your changes in the dashboard,\nand by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing).\n", "default": [ "typo", "geo", "words", "filters", "proximity", "attribute", "exact", "custom" ], "x-categories": [ "Ranking" ] }, "relevancyStrictness": { "$ref": "#/$defs/relevancyStrictness" }, "attributesToHighlight": { "$ref": "#/$defs/attributesToHighlight" }, "attributesToSnippet": { "$ref": "#/$defs/attributesToSnippet" }, "highlightPreTag": { "$ref": "#/$defs/highlightPreTag" }, "highlightPostTag": { "$ref": "#/$defs/highlightPostTag" }, "snippetEllipsisText": { "$ref": "#/$defs/snippetEllipsisText" }, "restrictHighlightAndSnippetArrays": { "$ref": "#/$defs/restrictHighlightAndSnippetArrays" }, "hitsPerPage": { "$ref": "#/$defs/hitsPerPage" }, "minWordSizefor1Typo": { "$ref": "#/$defs/minWordSizefor1Typo" }, "minWordSizefor2Typos": { "$ref": "#/$defs/minWordSizefor2Typos" }, "typoTolerance": { "$ref": "#/$defs/typoTolerance" }, "allowTyposOnNumericTokens": { "$ref": "#/$defs/allowTyposOnNumericTokens" }, "disableTypoToleranceOnAttributes": { "$ref": "#/$defs/disableTypoToleranceOnAttributes" }, "ignorePlurals": { "$ref": "#/$defs/ignorePlurals" }, "removeStopWords": { "$ref": "#/$defs/removeStopWords" }, "queryLanguages": { "$ref": "#/$defs/queryLanguages" }, "decompoundQuery": { "$ref": "#/$defs/decompoundQuery" }, "enableRules": { "$ref": "#/$defs/enableRules" }, "enablePersonalization": { "$ref": "#/$defs/enablePersonalization" }, "queryType": { "$ref": "#/$defs/queryType" }, "removeWordsIfNoResults": { "$ref": "#/$defs/removeWordsIfNoResults" }, "mode": { "$ref": "#/$defs/mode" }, "semanticSearch": { "$ref": "#/$defs/semanticSearch" }, "advancedSyntax": { "$ref": "#/$defs/advancedSyntax" }, "optionalWords": { "$ref": "#/$defs/optionalWords" }, "disableExactOnAttributes": { "$ref": "#/$defs/disableExactOnAttributes" }, "exactOnSingleWordQuery": { "$ref": "#/$defs/exactOnSingleWordQuery" }, "alternativesAsExact": { "$ref": "#/$defs/IndexSettings_alternativesAsExact" }, "advancedSyntaxFeatures": { "$ref": "#/$defs/IndexSettings_advancedSyntaxFeatures" }, "distinct": { "$ref": "#/$defs/distinct" }, "replaceSynonymsInHighlight": { "$ref": "#/$defs/replaceSynonymsInHighlight" }, "minProximity": { "$ref": "#/$defs/minProximity" }, "responseFields": { "$ref": "#/$defs/responseFields" }, "maxValuesPerFacet": { "$ref": "#/$defs/maxValuesPerFacet" }, "sortFacetValuesBy": { "$ref": "#/$defs/sortFacetValuesBy" }, "attributeCriteriaComputedByMinProximity": { "$ref": "#/$defs/attributeCriteriaComputedByMinProximity" }, "renderingContent": { "$ref": "#/$defs/renderingContent" }, "enableReRanking": { "$ref": "#/$defs/enableReRanking" }, "reRankingApplyFilter": { "oneOf": [ { "$ref": "#/$defs/reRankingApplyFilter" }, { "type": "null" } ] } } }, "insideBoundingBox": { "oneOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/$defs/insideBoundingBoxArray" } ] }, "insideBoundingBoxArray": { "type": "array", "items": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "type": "number", "format": "double" } }, "description": "Coordinates for a rectangular area in which to search.\n\nEach bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair:\n`[p1 lat, p1 long, p2 lat, p2 long]`.\nProvide multiple bounding boxes as nested arrays.\nFor more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).\n", "x-categories": [ "Geo-Search" ] }, "insidePolygon": { "type": "array", "items": { "type": "array", "minItems": 6, "maxItems": 20000, "items": { "type": "number", "format": "double" } }, "description": "Coordinates of a polygon in which to search.\n\nPolygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude.\nProvide multiple polygons as nested arrays.\nFor more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).\nThis parameter is ignored if you also specify `insideBoundingBox`.\n", "x-categories": [ "Geo-Search" ] }, "length": { "type": "integer", "description": "Number of hits to retrieve (used in combination with `offset`).", "minimum": 0, "maximum": 1000, "x-categories": [ "Pagination" ] }, "maxValuesPerFacet": { "type": "integer", "description": "Maximum number of facet values to return for each facet.", "default": 100, "maximum": 1000, "x-categories": [ "Faceting" ] }, "minProximity": { "type": "integer", "minimum": 1, "maximum": 7, "description": "Minimum proximity score for two matching words\nThis adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity)\nby equally scoring matches that are farther apart\nFor example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.\n", "default": 1, "x-categories": [ "Advanced" ] }, "minWordSizefor1Typo": { "type": "integer", "description": "Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).", "default": 4, "x-categories": [ "Typos" ] }, "minWordSizefor2Typos": { "type": "integer", "description": "Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos).", "default": 8, "x-categories": [ "Typos" ] }, "minimumAroundRadius": { "type": "integer", "description": "Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set.", "minimum": 1, "x-categories": [ "Geo-Search" ] }, "mode": { "type": "string", "enum": [ "neuralSearch", "keywordSearch" ], "description": "Search mode the index will use to query for results.\n\nThis setting only applies to indices, for which Algolia enabled NeuralSearch for you.\n", "default": "keywordSearch", "x-categories": [ "Query strategy" ] }, "naturalLanguages": { "type": "array", "items": { "$ref": "#/$defs/supportedLanguage" }, "description": "ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches)\n- Sets `removeStopWords` and `ignorePlurals` to the list of provided languages.\n- Sets `removeWordsIfNoResults` to `allOptional`.\n- Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.\n", "default": [], "x-categories": [ "Languages" ] }, "numericFilters": { "description": "Filter by numeric facets.\n\n**Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.**\n\nYou can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, `>=`.\nComparisons are precise up to 3 decimals.\nYou can also provide ranges: `facet: TO `. The range includes the lower and upper boundaries.\nThe same combination rules apply as for `facetFilters`.\n", "oneOf": [ { "type": "array", "items": { "$ref": "#/$defs/numericFilters" } }, { "type": "string" } ], "x-categories": [ "Filtering" ] }, "objectID": { "type": "string", "description": "Unique record identifier." }, "optionalFilters": { "description": "Filters to promote or demote records in the search results.\n\nOptional filters work like facet filters, but they don't exclude records from the search results.\nRecords that match the optional filter rank before records that don't match.\nIf you're using a negative filter `facet:-value`, matching records rank after records that don't match.\n\n- Optional filters are applied _after_ sort-by attributes.\n- Optional filters are applied _before_ custom ranking attributes (in the default [ranking](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria)).\n- Optional filters don't work with numeric attributes.\n- On virtual replicas, optional filters are applied _after_ the replica's [relevant sort](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort).\n", "oneOf": [ { "type": "array", "items": { "$ref": "#/$defs/optionalFilters" } }, { "type": "string" } ], "x-categories": [ "Filtering" ] }, "optionalWords": { "description": "Words that should be considered optional when found in the query.\n\nBy default, records must match all words in the search query to be included in the search results.\nAdding optional words can increase the number of search results by running an additional search query that doesn't include the optional words.\nFor example, if the search query is \"action video\" and \"video\" is optional,\nthe search engine runs two queries: one for \"action video\" and one for \"action\".\nRecords that match all words are ranked higher.\n\nFor a search query with 4 or more words **and** all its words are optional,\nthe number of matched words required for a record to be included in the search results increases for every 1,000 records:\n\n- If `optionalWords` has fewer than 10 words, the required number of matched words increases by 1:\n results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 2 matched words.\n- If `optionalWords` has 10 or more words, the required number of matched words increases by the number of optional words divided by 5 (rounded down).\n Example: with 18 optional words, results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 4 matched words.\n\nFor more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words).\n", "oneOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/$defs/optionalWordsArray" } ] }, "optionalWordsArray": { "type": "array", "items": { "type": "string" }, "description": "List of [optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words).", "default": [], "x-categories": [ "Query strategy" ] }, "order": { "description": "Explicit order of facets or facet values.\n\nThis setting lets you always show specific facets or facet values at the top of the list.\n", "type": "array", "items": { "type": "string" } }, "page": { "type": "integer", "description": "Page of search results to retrieve.", "default": 0, "minimum": 0, "x-categories": [ "Pagination" ] }, "params": { "type": "object", "description": "Parameters to apply to this search.\n\nYou can use all search parameters, plus special `automaticFacetFilters`, `automaticOptionalFacetFilters`, and `query`.\n", "additionalProperties": false, "properties": { "query": { "$ref": "#/$defs/consequenceQuery" }, "automaticFacetFilters": { "$ref": "#/$defs/automaticFacetFilters" }, "automaticOptionalFacetFilters": { "$ref": "#/$defs/automaticFacetFilters" }, "renderingContent": { "$ref": "#/$defs/renderingContent" } } }, "percentileComputation": { "type": "boolean", "description": "Whether to include this search when calculating processing-time percentiles.", "default": true, "x-categories": [ "Advanced" ] }, "personalizationImpact": { "type": "integer", "description": "Impact that Personalization should have on this search\nThe higher this value is, the more Personalization determines the ranking compared to other factors.\nFor more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).\n", "default": 100, "minimum": 0, "maximum": 100, "x-categories": [ "Personalization" ] }, "promote": { "oneOf": [ { "$ref": "#/$defs/promoteObjectIDs" }, { "$ref": "#/$defs/promoteObjectID" } ] }, "promoteObjectID": { "title": "objectID", "description": "Record to promote.", "type": "object", "additionalProperties": false, "properties": { "objectID": { "$ref": "#/$defs/objectID" }, "position": { "$ref": "#/$defs/promotePosition" } }, "required": [ "position", "objectID" ], "x-discriminator-fields": [ "objectID" ] }, "promoteObjectIDs": { "title": "objectIDs", "description": "Records to promote.", "type": "object", "additionalProperties": false, "properties": { "objectIDs": { "type": "array", "maxItems": 100, "description": "Object IDs of the records you want to promote.\n\nThe records are placed as a group at the `position`.\nFor example, if you want to promote four records to position `0`,\nthey will be the first four search results.\n", "items": { "$ref": "#/$defs/objectID" } }, "position": { "$ref": "#/$defs/promotePosition" } }, "required": [ "position", "objectIDs" ], "x-discriminator-fields": [ "objectIDs" ] }, "promotePosition": { "type": "integer", "description": "Position in the search results where you want to show the promoted records." }, "queryLanguages": { "type": "array", "items": { "$ref": "#/$defs/supportedLanguage" }, "description": "Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries.\nThis setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings.\nThis setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages.\nTo support this, place the CJK language **first**.\n**Always specify a query language.**\nIf you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages),\nor the languages you specified with the `ignorePlurals` or `removeStopWords` parameters.\nThis can lead to unexpected search results.\nFor more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations).\n", "default": [], "x-categories": [ "Languages" ] }, "queryType": { "type": "string", "enum": [ "prefixLast", "prefixAll", "prefixNone" ], "description": "Determines if and how query words are interpreted as prefixes.\n\nBy default, only the last query word is treated as a prefix (`prefixLast`).\nTo turn off prefix search, use `prefixNone`.\nAvoid `prefixAll`, which treats all query words as prefixes.\nThis might lead to counterintuitive results and makes your search slower.\n\nFor more information, see [Prefix searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching).\n", "default": "prefixLast", "x-categories": [ "Query strategy" ] }, "reRankingApplyFilter": { "description": "Restrict [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) to records that match these filters.\n", "oneOf": [ { "type": "array", "items": { "$ref": "#/$defs/reRankingApplyFilter" } }, { "type": "string", "x-categories": [ "Filtering" ] } ] }, "redirectURL": { "description": "The redirect rule container.", "type": "object", "additionalProperties": false, "properties": { "url": { "type": "string" } } }, "relevancyStrictness": { "type": "integer", "description": "Relevancy threshold below which less relevant results aren't included in the results\nYou can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas).\nUse this setting to strike a balance between the relevance and number of returned results.\n", "default": 100, "x-categories": [ "Ranking" ] }, "removeStopWords": { "description": "Removes stop words from the search query.\n\nStop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own.\nIn English, \"the\", \"a\", or \"and\" are stop words.\n\nOnly use this feature for the languages used in your index.\n", "oneOf": [ { "type": "array", "description": "ISO code for languages for which stop words should be removed. This overrides languages you set in `queryLanguges`.", "items": { "$ref": "#/$defs/supportedLanguage" } }, { "type": "boolean", "default": false, "description": "If true, stop words are removed for all languages you included in `queryLanguages`, or for all supported languages, if `queryLanguages` is empty.\nIf false, stop words are not removed.\n" } ], "x-categories": [ "Languages" ] }, "removeWordsIfNoResults": { "type": "string", "enum": [ "none", "lastWords", "firstWords", "allOptional" ], "description": "Strategy for removing words from the query when it doesn't return any results.\nThis helps to avoid returning empty search results.\n\n- `none`.\n No words are removed when a query doesn't return results.\n\n- `lastWords`.\n Treat the last (then second to last, then third to last) word as optional,\n until there are results or at most 5 words have been removed.\n\n- `firstWords`.\n Treat the first (then second, then third) word as optional,\n until there are results or at most 5 words have been removed.\n\n- `allOptional`.\n Treat all words as optional.\n\nFor more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results).\n", "default": "none", "x-categories": [ "Query strategy" ] }, "renderingContent": { "description": "Extra data that can be used in the search UI.\n\nYou can use this to control aspects of your search UI, such as the order of facet names and values\nwithout changing your frontend code.\n", "type": "object", "additionalProperties": false, "properties": { "facetOrdering": { "$ref": "#/$defs/facetOrdering" }, "redirect": { "$ref": "#/$defs/redirectURL" }, "widgets": { "$ref": "#/$defs/widgets" } }, "x-categories": [ "Advanced" ] }, "replaceSynonymsInHighlight": { "type": "boolean", "description": "Whether to replace a highlighted word with the matched synonym\nBy default, the original words are highlighted even if a synonym matches.\nFor example, with `home` as a synonym for `house` and a search for `home`,\nrecords matching either \"home\" or \"house\" are included in the search results,\nand either \"home\" or \"house\" are highlighted\nWith `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records,\nbut all occurrences of \"house\" are replaced by \"home\" in the highlighted response.\n", "default": false, "x-categories": [ "Highlighting and Snippeting" ] }, "responseFields": { "type": "array", "items": { "type": "string" }, "description": "Properties to include in the API response of search and browse requests\nBy default, all response properties are included.\nTo reduce the response size, you can select which properties should be included\nAn empty list may lead to an empty API response (except properties you can't exclude)\nYou can't exclude these properties:\n`message`, `warning`, `cursor`, `abTestVariantID`,\nor any property added by setting `getRankingInfo` to true\nYour search depends on the `hits` field. If you omit this field, searches won't return any results.\nYour UI might also depend on other properties, for example, for pagination.\nBefore restricting the response size, check the impact on your search experience.\n", "default": [ "*" ], "x-categories": [ "Advanced" ] }, "restrictHighlightAndSnippetArrays": { "type": "boolean", "description": "Whether to restrict highlighting and snippeting to items that at least partially matched the search query.\nBy default, all items are highlighted and snippeted.\n", "default": false, "x-categories": [ "Highlighting and Snippeting" ] }, "restrictSearchableAttributes": { "type": "array", "items": { "type": "string" }, "description": "Restricts a search to a subset of your searchable attributes.\nAttribute names are case-sensitive.\n", "default": [], "x-categories": [ "Filtering" ] }, "ruleContexts": { "type": "array", "items": { "type": "string" }, "description": "Assigns a rule context to the search query\n[Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.\n", "default": [], "x-categories": [ "Rules" ] }, "ruleID": { "title": "objectID", "type": "string", "description": "Unique identifier of a rule object." }, "semanticSearch": { "type": "object", "description": "Settings for the semantic search part of NeuralSearch.\nOnly used when `mode` is `neuralSearch`.\n", "properties": { "eventSources": { "oneOf": [ { "type": "array", "description": "Indices from which to collect click and conversion events.\n\nIf null, the current index and all its replicas are used.\n", "items": { "type": "string" } }, { "type": "null" } ] } } }, "similarQuery": { "type": "string", "description": "Keywords to be used instead of the search query to conduct a more broader search\nUsing the `similarQuery` parameter changes other settings\n- `queryType` is set to `prefixNone`.\n- `removeStopWords` is set to true.\n- `words` is set as the first ranking criterion.\n- All remaining words are treated as `optionalWords`\nSince the `similarQuery` is supposed to do a broad search, they usually return many results.\nCombine it with `filters` to narrow down the list of results.\n", "default": "", "x-categories": [ "Search" ] }, "snippetEllipsisText": { "type": "string", "description": "String used as an ellipsis indicator when a snippet is truncated.", "default": "…", "x-categories": [ "Highlighting and Snippeting" ] }, "sortFacetValuesBy": { "type": "string", "description": "Order in which to retrieve facet values\n- `count`.\n Facet values are retrieved by decreasing count.\n The count is the number of matching records containing this facet value\n- `alpha`.\n Retrieve facet values alphabetically\nThis setting doesn't influence how facet values are displayed in your UI (see `renderingContent`).\nFor more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js).\n", "default": "count", "x-categories": [ "Faceting" ] }, "sortRemainingBy": { "description": "Order of facet values that aren't explicitly positioned with the `order` setting.\n\n- `count`.\n Order remaining facet values by decreasing count.\n The count is the number of matching records containing this facet value.\n\n- `alpha`.\n Sort facet values alphabetically.\n\n- `hidden`.\n Don't show facet values that aren't explicitly positioned.\n", "type": "string", "enum": [ "count", "alpha", "hidden" ] }, "sumOrFiltersScores": { "type": "boolean", "description": "Whether to sum all filter scores\nIf true, all filter scores are summed.\nOtherwise, the maximum filter score is kept.\nFor more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).\n", "default": false, "x-categories": [ "Filtering" ] }, "supportedLanguage": { "type": "string", "description": "ISO code for a supported language.", "enum": [ "af", "ar", "az", "bg", "bn", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr", "ga", "gl", "he", "hi", "hu", "hy", "id", "is", "it", "ja", "ka", "kk", "ko", "ku", "ky", "lt", "lv", "mi", "mn", "mr", "ms", "mt", "nb", "nl", "no", "ns", "pl", "ps", "pt", "pt-br", "qu", "ro", "ru", "sk", "sq", "sv", "sw", "ta", "te", "th", "tl", "tn", "tr", "tt", "uk", "ur", "uz", "zh" ] }, "synonyms": { "type": "boolean", "description": "Whether to take into account an index's synonyms for this search.", "default": true, "x-categories": [ "Advanced" ] }, "tagFilters": { "description": "Filter the search by values of the special `_tags` attribute.\n\n**Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.**\n\nDifferent from regular facets, `_tags` can only be used for filtering (including or excluding records).\nYou won't get a facet count.\nThe same combination and escaping rules apply as for `facetFilters`.\n", "oneOf": [ { "type": "array", "items": { "$ref": "#/$defs/tagFilters" } }, { "type": "string" } ], "x-categories": [ "Filtering" ] }, "timeRange": { "type": "object", "additionalProperties": false, "properties": { "from": { "type": "integer", "format": "int64", "description": "Timestamp when the rule should start to be active, measured in seconds since the Unix epoch." }, "until": { "type": "integer", "format": "int64", "description": "Timestamp when the rule should stop to be active, measured in seconds since the Unix epoch." } } }, "typoTolerance": { "description": "Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance) is enabled and how it is applied.\n\nIf typo tolerance is true, `min`, or `strict`, [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation) are also active.\n", "oneOf": [ { "type": "boolean", "default": true, "description": "Whether typo tolerance is active. If true, matches with typos are included in the search results and rank after exact matches." }, { "$ref": "#/$defs/typoToleranceEnum" } ], "x-categories": [ "Typos" ] }, "typoToleranceEnum": { "type": "string", "title": "typo tolerance", "description": "- `min`. Return matches with the lowest number of typos.\n For example, if you have matches without typos, only include those.\n But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos).\n- `strict`. Return matches with the two lowest numbers of typos.\n With `strict`, the Typo ranking criterion is applied first in the `ranking` setting.\n", "enum": [ "min", "strict", "true", "false" ] }, "userToken": { "type": "string", "description": "Unique pseudonymous or anonymous user identifier.\n\nThis helps with analytics and click and conversion events.\nFor more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).\n", "x-categories": [ "Personalization" ] }, "value": { "type": "object", "additionalProperties": false, "properties": { "order": { "$ref": "#/$defs/order" }, "sortRemainingBy": { "$ref": "#/$defs/sortRemainingBy" }, "hide": { "$ref": "#/$defs/hide" } } }, "values": { "description": "Order of facet values. One object for each facet.", "type": "object", "additionalProperties": { "x-additionalPropertiesName": "facet", "$ref": "#/$defs/value" } }, "widgets": { "description": "Widgets returned from any rules that are applied to the current search.", "type": "object", "additionalProperties": false, "properties": { "banners": { "$ref": "#/$defs/banners" } } } } }