algolia 3.0.0.alpha.16 → 3.0.0.alpha.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +10 -167
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/api/abtesting_client.rb +20 -20
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/personalization_client.rb +12 -12
- data/lib/algolia/api/recommend_client.rb +22 -22
- data/lib/algolia/api/search_client.rb +8 -8
- data/lib/algolia/api/usage_client.rb +329 -0
- data/lib/algolia/models/abtesting/ab_test.rb +41 -16
- data/lib/algolia/models/abtesting/ab_test_configuration.rb +217 -0
- data/lib/algolia/models/abtesting/ab_test_response.rb +2 -2
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +21 -3
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +21 -3
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +1 -1
- data/lib/algolia/models/abtesting/custom_search_params.rb +1 -1
- data/lib/algolia/models/abtesting/effect.rb +35 -0
- data/lib/algolia/models/abtesting/empty_search.rb +198 -0
- data/lib/algolia/models/abtesting/list_ab_tests_response.rb +1 -1
- data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +247 -0
- data/lib/algolia/models/abtesting/outliers.rb +198 -0
- data/lib/algolia/models/abtesting/status.rb +35 -0
- data/lib/algolia/models/abtesting/variant.rb +31 -13
- data/lib/algolia/models/analytics/get_status_response.rb +1 -1
- data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
- data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
- data/lib/algolia/models/ingestion/auth_input.rb +1 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- data/lib/algolia/models/ingestion/destination_index_name.rb +1 -1
- data/lib/algolia/models/ingestion/shopify_input.rb +212 -0
- data/lib/algolia/models/ingestion/shopify_market.rb +227 -0
- data/lib/algolia/models/ingestion/shopify_metafield.rb +221 -0
- data/lib/algolia/models/ingestion/source_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_shopify.rb +278 -0
- data/lib/algolia/models/{recommend/base_recommended_for_you_query_parameters.rb → ingestion/source_shopify_base.rb} +14 -14
- data/lib/algolia/models/ingestion/source_update_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_shopify.rb +258 -0
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +2 -2
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/clicked_filters.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/converted_filters.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/viewed_filters.rb +2 -2
- data/lib/algolia/models/insights/viewed_object_ids.rb +2 -2
- data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
- data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
- data/lib/algolia/models/monitoring/time_inner.rb +1 -1
- data/lib/algolia/models/personalization/delete_user_profile_response.rb +2 -2
- data/lib/algolia/models/personalization/event_scoring.rb +25 -4
- data/lib/algolia/models/personalization/event_type.rb +34 -0
- data/lib/algolia/models/personalization/facet_scoring.rb +2 -2
- data/lib/algolia/models/personalization/get_user_token_response.rb +3 -3
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +21 -3
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +3 -3
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +1 -1
- data/lib/algolia/models/query-suggestions/source_index.rb +1 -1
- data/lib/algolia/models/recommend/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +37 -8
- data/lib/algolia/models/recommend/base_search_params.rb +4 -4
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +4 -4
- data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
- data/lib/algolia/models/recommend/condition.rb +12 -62
- data/lib/algolia/models/recommend/consequence.rb +32 -54
- data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
- data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +17 -20
- data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
- data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
- data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
- data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +10 -10
- data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
- data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
- data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
- data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
- data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
- data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
- data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
- data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
- data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
- data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
- data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
- data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +36 -16
- data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
- data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
- data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +40 -20
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +33 -52
- data/lib/algolia/models/recommend/search_params_object.rb +15 -14
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
- data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
- data/lib/algolia/models/recommend/trending_facets.rb +243 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +51 -11
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +43 -17
- data/lib/algolia/models/search/add_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_index_settings.rb +10 -10
- data/lib/algolia/models/search/base_search_params.rb +4 -4
- data/lib/algolia/models/search/base_search_params_without_query.rb +4 -4
- data/lib/algolia/models/search/browse_params_object.rb +14 -14
- data/lib/algolia/models/search/consequence_params.rb +14 -14
- data/lib/algolia/models/search/created_at_response.rb +1 -1
- data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
- data/lib/algolia/models/search/delete_by_params.rb +2 -2
- data/lib/algolia/models/search/delete_source_response.rb +1 -1
- data/lib/algolia/models/search/deleted_at_response.rb +1 -1
- data/lib/algolia/models/search/fetched_index.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/index_settings.rb +20 -20
- data/lib/algolia/models/search/index_settings_as_search_params.rb +10 -10
- data/lib/algolia/models/search/log.rb +1 -1
- data/lib/algolia/models/search/multiple_batch_request.rb +1 -1
- data/lib/algolia/models/search/operation_index_params.rb +1 -1
- data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
- data/lib/algolia/models/search/remove_user_id_response.rb +1 -1
- data/lib/algolia/models/search/replace_source_response.rb +1 -1
- data/lib/algolia/models/search/save_object_response.rb +1 -1
- data/lib/algolia/models/search/save_synonym_response.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +15 -15
- data/lib/algolia/models/search/search_for_facets_options.rb +1 -1
- data/lib/algolia/models/search/search_for_hits.rb +15 -15
- data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
- data/lib/algolia/models/search/search_params_object.rb +15 -14
- data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/update_api_key_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
- data/lib/algolia/models/search/updated_rule_response.rb +1 -1
- data/lib/algolia/models/search/user_hit.rb +1 -1
- data/lib/algolia/models/search/user_id.rb +1 -1
- data/lib/algolia/models/usage/error_base.rb +205 -0
- data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
- data/lib/algolia/models/usage/get_usage400_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
- data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
- data/lib/algolia/models/usage/granularity.rb +33 -0
- data/lib/algolia/models/usage/statistic.rb +116 -0
- data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
- data/lib/algolia/version.rb +1 -1
- metadata +47 -25
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
- data/lib/algolia/models/recommend/consequence_query.rb +0 -97
- data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
@@ -5,11 +5,14 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
|
-
class
|
8
|
+
class SearchParams
|
9
|
+
# Search query.
|
10
|
+
attr_accessor :query
|
11
|
+
|
9
12
|
# Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
|
10
13
|
attr_accessor :similar_query
|
11
14
|
|
12
|
-
# Filter
|
15
|
+
# Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
13
16
|
attr_accessor :filters
|
14
17
|
|
15
18
|
attr_accessor :facet_filters
|
@@ -23,7 +26,7 @@ module Algolia
|
|
23
26
|
# Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
|
24
27
|
attr_accessor :sum_or_filters_scores
|
25
28
|
|
26
|
-
# Restricts a search to a subset of your searchable attributes.
|
29
|
+
# Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
27
30
|
attr_accessor :restrict_searchable_attributes
|
28
31
|
|
29
32
|
# Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
|
@@ -57,7 +60,7 @@ module Algolia
|
|
57
60
|
# Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
|
58
61
|
attr_accessor :inside_bounding_box
|
59
62
|
|
60
|
-
# Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored
|
63
|
+
# Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
|
61
64
|
attr_accessor :inside_polygon
|
62
65
|
|
63
66
|
# ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
@@ -93,22 +96,22 @@ module Algolia
|
|
93
96
|
# Whether to enable A/B testing for this search.
|
94
97
|
attr_accessor :enable_ab_test
|
95
98
|
|
96
|
-
# Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
99
|
+
# Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
97
100
|
attr_accessor :attributes_to_retrieve
|
98
101
|
|
99
|
-
# Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If 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/), you put the sorting attribute at the top of the list. **Modifiers**
|
102
|
+
# Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If 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/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/).
|
100
103
|
attr_accessor :ranking
|
101
104
|
|
102
|
-
# Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers**
|
105
|
+
# Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
|
103
106
|
attr_accessor :custom_ranking
|
104
107
|
|
105
108
|
# Relevancy threshold below which less relevant results aren't included in the results. You 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). Use this setting to strike a balance between the relevance and number of returned results.
|
106
109
|
attr_accessor :relevancy_strictness
|
107
110
|
|
108
|
-
# Attributes to highlight. By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI. For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js/).
|
111
|
+
# Attributes to highlight. By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. Attribute names are case-sensitive. With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI. For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js/).
|
109
112
|
attr_accessor :attributes_to_highlight
|
110
113
|
|
111
|
-
# Attributes for which to enable snippets. Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted.
|
114
|
+
# Attributes for which to enable snippets. Attribute names are case-sensitive. Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted.
|
112
115
|
attr_accessor :attributes_to_snippet
|
113
116
|
|
114
117
|
# HTML tag to insert before the highlighted parts in all highlighted results and snippets.
|
@@ -137,7 +140,7 @@ module Algolia
|
|
137
140
|
# Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers.
|
138
141
|
attr_accessor :allow_typos_on_numeric_tokens
|
139
142
|
|
140
|
-
# Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). Returning only exact matches can help when: - [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/). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
143
|
+
# Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). Attribute names are case-sensitive. Returning only exact matches can help when: - [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/). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
141
144
|
attr_accessor :disable_typo_tolerance_on_attributes
|
142
145
|
|
143
146
|
attr_accessor :ignore_plurals
|
@@ -173,15 +176,15 @@ module Algolia
|
|
173
176
|
# Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words dividied by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For 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).
|
174
177
|
attr_accessor :optional_words
|
175
178
|
|
176
|
-
# 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). This can be useful for attributes with long values, where the likelyhood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
|
179
|
+
# 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). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelyhood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
|
177
180
|
attr_accessor :disable_exact_on_attributes
|
178
181
|
|
179
182
|
attr_accessor :exact_on_single_word_query
|
180
183
|
|
181
|
-
# Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
|
184
|
+
# Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY/NYC\" are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY/New York\" are considered exact matches.
|
182
185
|
attr_accessor :alternatives_as_exact
|
183
186
|
|
184
|
-
# Advanced search syntax features you want to support.
|
187
|
+
# Advanced search syntax features you want to support. - `exactPhrase`. Phrases in quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\". - `excludeWords`. Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". This setting only has an effect if `advancedSyntax` is true.
|
185
188
|
attr_accessor :advanced_syntax_features
|
186
189
|
|
187
190
|
attr_accessor :distinct
|
@@ -201,7 +204,7 @@ module Algolia
|
|
201
204
|
# Maximum number of facet values to return for each facet.
|
202
205
|
attr_accessor :max_values_per_facet
|
203
206
|
|
204
|
-
# Order in which to retrieve facet values.
|
207
|
+
# Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/).
|
205
208
|
attr_accessor :sort_facet_values_by
|
206
209
|
|
207
210
|
# Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.
|
@@ -214,12 +217,6 @@ module Algolia
|
|
214
217
|
|
215
218
|
attr_accessor :re_ranking_apply_filter
|
216
219
|
|
217
|
-
attr_accessor :query
|
218
|
-
|
219
|
-
attr_accessor :automatic_facet_filters
|
220
|
-
|
221
|
-
attr_accessor :automatic_optional_facet_filters
|
222
|
-
|
223
220
|
class EnumAttributeValidator
|
224
221
|
attr_reader :datatype
|
225
222
|
attr_reader :allowable_values
|
@@ -245,6 +242,7 @@ module Algolia
|
|
245
242
|
# Attribute mapping from ruby-style variable name to JSON key.
|
246
243
|
def self.attribute_map
|
247
244
|
{
|
245
|
+
:query => :query,
|
248
246
|
:similar_query => :similarQuery,
|
249
247
|
:filters => :filters,
|
250
248
|
:facet_filters => :facetFilters,
|
@@ -319,10 +317,7 @@ module Algolia
|
|
319
317
|
:attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
|
320
318
|
:rendering_content => :renderingContent,
|
321
319
|
:enable_re_ranking => :enableReRanking,
|
322
|
-
:re_ranking_apply_filter => :reRankingApplyFilter
|
323
|
-
:query => :query,
|
324
|
-
:automatic_facet_filters => :automaticFacetFilters,
|
325
|
-
:automatic_optional_facet_filters => :automaticOptionalFacetFilters
|
320
|
+
:re_ranking_apply_filter => :reRankingApplyFilter
|
326
321
|
}
|
327
322
|
end
|
328
323
|
|
@@ -334,6 +329,7 @@ module Algolia
|
|
334
329
|
# Attribute type mapping.
|
335
330
|
def self.types_mapping
|
336
331
|
{
|
332
|
+
:query => :String,
|
337
333
|
:similar_query => :String,
|
338
334
|
:filters => :String,
|
339
335
|
:facet_filters => :FacetFilters,
|
@@ -354,7 +350,7 @@ module Algolia
|
|
354
350
|
:minimum_around_radius => :Integer,
|
355
351
|
:inside_bounding_box => :'Array<Array<Float>>',
|
356
352
|
:inside_polygon => :'Array<Array<Float>>',
|
357
|
-
:natural_languages => :'Array<
|
353
|
+
:natural_languages => :'Array<SupportedLanguage>',
|
358
354
|
:rule_contexts => :'Array<String>',
|
359
355
|
:personalization_impact => :Integer,
|
360
356
|
:user_token => :String,
|
@@ -408,10 +404,7 @@ module Algolia
|
|
408
404
|
:attribute_criteria_computed_by_min_proximity => :Boolean,
|
409
405
|
:rendering_content => :RenderingContent,
|
410
406
|
:enable_re_ranking => :Boolean,
|
411
|
-
:re_ranking_apply_filter => :ReRankingApplyFilter
|
412
|
-
:query => :ConsequenceQuery,
|
413
|
-
:automatic_facet_filters => :AutomaticFacetFilters,
|
414
|
-
:automatic_optional_facet_filters => :AutomaticFacetFilters
|
407
|
+
:re_ranking_apply_filter => :ReRankingApplyFilter
|
415
408
|
}
|
416
409
|
end
|
417
410
|
|
@@ -425,9 +418,7 @@ module Algolia
|
|
425
418
|
# List of class defined in allOf (OpenAPI v3)
|
426
419
|
def self.openapi_all_of
|
427
420
|
[
|
428
|
-
:
|
429
|
-
:IndexSettingsAsSearchParams,
|
430
|
-
:Params
|
421
|
+
:SearchParamsObject
|
431
422
|
]
|
432
423
|
end
|
433
424
|
|
@@ -435,19 +426,23 @@ module Algolia
|
|
435
426
|
# @param [Hash] attributes Model attributes in the form of hash
|
436
427
|
def initialize(attributes = {})
|
437
428
|
unless attributes.is_a?(Hash)
|
438
|
-
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::
|
429
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::SearchParams` initialize method"
|
439
430
|
end
|
440
431
|
|
441
432
|
# check to see if the attribute exists and convert string to symbol for hash key
|
442
433
|
attributes = attributes.each_with_object({}) do |(k, v), h|
|
443
434
|
unless self.class.attribute_map.key?(k.to_sym)
|
444
435
|
raise ArgumentError,
|
445
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
436
|
+
"`#{k}` is not a valid attribute in `Algolia::SearchParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
446
437
|
end
|
447
438
|
|
448
439
|
h[k.to_sym] = v
|
449
440
|
end
|
450
441
|
|
442
|
+
if attributes.key?(:query)
|
443
|
+
self.query = attributes[:query]
|
444
|
+
end
|
445
|
+
|
451
446
|
if attributes.key?(:similar_query)
|
452
447
|
self.similar_query = attributes[:similar_query]
|
453
448
|
end
|
@@ -785,18 +780,6 @@ module Algolia
|
|
785
780
|
if attributes.key?(:re_ranking_apply_filter)
|
786
781
|
self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
|
787
782
|
end
|
788
|
-
|
789
|
-
if attributes.key?(:query)
|
790
|
-
self.query = attributes[:query]
|
791
|
-
end
|
792
|
-
|
793
|
-
if attributes.key?(:automatic_facet_filters)
|
794
|
-
self.automatic_facet_filters = attributes[:automatic_facet_filters]
|
795
|
-
end
|
796
|
-
|
797
|
-
if attributes.key?(:automatic_optional_facet_filters)
|
798
|
-
self.automatic_optional_facet_filters = attributes[:automatic_optional_facet_filters]
|
799
|
-
end
|
800
783
|
end
|
801
784
|
|
802
785
|
# Custom attribute writer method with validation
|
@@ -933,6 +916,7 @@ module Algolia
|
|
933
916
|
return true if equal?(other)
|
934
917
|
|
935
918
|
self.class == other.class &&
|
919
|
+
query == other.query &&
|
936
920
|
similar_query == other.similar_query &&
|
937
921
|
filters == other.filters &&
|
938
922
|
facet_filters == other.facet_filters &&
|
@@ -1007,10 +991,7 @@ module Algolia
|
|
1007
991
|
attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
|
1008
992
|
rendering_content == other.rendering_content &&
|
1009
993
|
enable_re_ranking == other.enable_re_ranking &&
|
1010
|
-
re_ranking_apply_filter == other.re_ranking_apply_filter
|
1011
|
-
query == other.query &&
|
1012
|
-
automatic_facet_filters == other.automatic_facet_filters &&
|
1013
|
-
automatic_optional_facet_filters == other.automatic_optional_facet_filters
|
994
|
+
re_ranking_apply_filter == other.re_ranking_apply_filter
|
1014
995
|
end
|
1015
996
|
|
1016
997
|
# @see the `==` method
|
@@ -1022,8 +1003,8 @@ module Algolia
|
|
1022
1003
|
# Calculates hash code according to all attributes.
|
1023
1004
|
# @return [Integer] Hash code
|
1024
1005
|
def hash
|
1025
|
-
[similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
|
1026
|
-
faceting_after_distinct, page, offset, length, around_lat_lng, around_lat_lng_via_ip, around_radius, around_precision, minimum_around_radius, inside_bounding_box, inside_polygon, natural_languages, rule_contexts, personalization_impact, user_token, get_ranking_info, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test, attributes_to_retrieve, ranking, custom_ranking, relevancy_strictness, attributes_to_highlight, attributes_to_snippet, highlight_pre_tag, highlight_post_tag, snippet_ellipsis_text, restrict_highlight_and_snippet_arrays, hits_per_page, min_word_sizefor1_typo, min_word_sizefor2_typos, typo_tolerance, allow_typos_on_numeric_tokens, disable_typo_tolerance_on_attributes, ignore_plurals, remove_stop_words, keep_diacritics_on_characters, query_languages, decompound_query, enable_rules, enable_personalization, query_type, remove_words_if_no_results, mode, semantic_search, advanced_syntax, optional_words, disable_exact_on_attributes, exact_on_single_word_query, alternatives_as_exact, advanced_syntax_features, distinct, replace_synonyms_in_highlight, min_proximity, response_fields, max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, rendering_content, enable_re_ranking, re_ranking_apply_filter
|
1006
|
+
[query, similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
|
1007
|
+
faceting_after_distinct, page, offset, length, around_lat_lng, around_lat_lng_via_ip, around_radius, around_precision, minimum_around_radius, inside_bounding_box, inside_polygon, natural_languages, rule_contexts, personalization_impact, user_token, get_ranking_info, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test, attributes_to_retrieve, ranking, custom_ranking, relevancy_strictness, attributes_to_highlight, attributes_to_snippet, highlight_pre_tag, highlight_post_tag, snippet_ellipsis_text, restrict_highlight_and_snippet_arrays, hits_per_page, min_word_sizefor1_typo, min_word_sizefor2_typos, typo_tolerance, allow_typos_on_numeric_tokens, disable_typo_tolerance_on_attributes, ignore_plurals, remove_stop_words, keep_diacritics_on_characters, query_languages, decompound_query, enable_rules, enable_personalization, query_type, remove_words_if_no_results, mode, semantic_search, advanced_syntax, optional_words, disable_exact_on_attributes, exact_on_single_word_query, alternatives_as_exact, advanced_syntax_features, distinct, replace_synonyms_in_highlight, min_proximity, response_fields, max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, rendering_content, enable_re_ranking, re_ranking_apply_filter].hash
|
1027
1008
|
end
|
1028
1009
|
|
1029
1010
|
# Builds the object from hash
|
@@ -5,6 +5,7 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
|
+
# Each parameter value, including the `query` must not be larger than 512 bytes.
|
8
9
|
class SearchParamsObject
|
9
10
|
# Search query.
|
10
11
|
attr_accessor :query
|
@@ -12,7 +13,7 @@ module Algolia
|
|
12
13
|
# Keywords to be used instead of the search query to conduct a more broader search. Using the `similarQuery` parameter changes other settings: - `queryType` is set to `prefixNone`. - `removeStopWords` is set to true. - `words` is set as the first ranking criterion. - All remaining words are treated as `optionalWords`. Since the `similarQuery` is supposed to do a broad search, they usually return many results. Combine it with `filters` to narrow down the list of results.
|
13
14
|
attr_accessor :similar_query
|
14
15
|
|
15
|
-
# Filter
|
16
|
+
# Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
|
16
17
|
attr_accessor :filters
|
17
18
|
|
18
19
|
attr_accessor :facet_filters
|
@@ -26,7 +27,7 @@ module Algolia
|
|
26
27
|
# Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
|
27
28
|
attr_accessor :sum_or_filters_scores
|
28
29
|
|
29
|
-
# Restricts a search to a subset of your searchable attributes.
|
30
|
+
# Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
30
31
|
attr_accessor :restrict_searchable_attributes
|
31
32
|
|
32
33
|
# Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
|
@@ -60,7 +61,7 @@ module Algolia
|
|
60
61
|
# Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
|
61
62
|
attr_accessor :inside_bounding_box
|
62
63
|
|
63
|
-
# Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored
|
64
|
+
# Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
|
64
65
|
attr_accessor :inside_polygon
|
65
66
|
|
66
67
|
# ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
@@ -96,22 +97,22 @@ module Algolia
|
|
96
97
|
# Whether to enable A/B testing for this search.
|
97
98
|
attr_accessor :enable_ab_test
|
98
99
|
|
99
|
-
# Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
100
|
+
# Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive. - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
100
101
|
attr_accessor :attributes_to_retrieve
|
101
102
|
|
102
|
-
# Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If 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/), you put the sorting attribute at the top of the list. **Modifiers**
|
103
|
+
# Determines the order in which Algolia returns your results. By default, each entry corresponds to a [ranking criteria](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). The tie-breaking algorithm sequentially applies each criterion in the order they're specified. If 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/), you put the sorting attribute at the top of the list. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. Before you modify the default setting, you should test your changes in the dashboard, and by [A/B testing](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/).
|
103
104
|
attr_accessor :ranking
|
104
105
|
|
105
|
-
# Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers**
|
106
|
+
# Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
|
106
107
|
attr_accessor :custom_ranking
|
107
108
|
|
108
109
|
# Relevancy threshold below which less relevant results aren't included in the results. You 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). Use this setting to strike a balance between the relevance and number of returned results.
|
109
110
|
attr_accessor :relevancy_strictness
|
110
111
|
|
111
|
-
# Attributes to highlight. By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI. For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js/).
|
112
|
+
# Attributes to highlight. By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. Attribute names are case-sensitive. With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI. For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js/).
|
112
113
|
attr_accessor :attributes_to_highlight
|
113
114
|
|
114
|
-
# Attributes for which to enable snippets. Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted.
|
115
|
+
# Attributes for which to enable snippets. Attribute names are case-sensitive. Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted.
|
115
116
|
attr_accessor :attributes_to_snippet
|
116
117
|
|
117
118
|
# HTML tag to insert before the highlighted parts in all highlighted results and snippets.
|
@@ -140,7 +141,7 @@ module Algolia
|
|
140
141
|
# Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers.
|
141
142
|
attr_accessor :allow_typos_on_numeric_tokens
|
142
143
|
|
143
|
-
# Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). Returning only exact matches can help when: - [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/). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
144
|
+
# Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). Attribute names are case-sensitive. Returning only exact matches can help when: - [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/). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
144
145
|
attr_accessor :disable_typo_tolerance_on_attributes
|
145
146
|
|
146
147
|
attr_accessor :ignore_plurals
|
@@ -176,15 +177,15 @@ module Algolia
|
|
176
177
|
# Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can help to increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is an optional word, the search engine runs two queries. One for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has less than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - If `optionalWords` has 10 or more words, the number of required matched words increases by the number of optional words dividied by 5 (rounded down). For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. For 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).
|
177
178
|
attr_accessor :optional_words
|
178
179
|
|
179
|
-
# 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). This can be useful for attributes with long values, where the likelyhood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
|
180
|
+
# 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). Attribute names are case-sensitive. This can be useful for attributes with long values, where the likelyhood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
|
180
181
|
attr_accessor :disable_exact_on_attributes
|
181
182
|
|
182
183
|
attr_accessor :exact_on_single_word_query
|
183
184
|
|
184
|
-
# Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
|
185
|
+
# Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY/NYC\" are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY/New York\" are considered exact matches.
|
185
186
|
attr_accessor :alternatives_as_exact
|
186
187
|
|
187
|
-
# Advanced search syntax features you want to support.
|
188
|
+
# Advanced search syntax features you want to support. - `exactPhrase`. Phrases in quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\". - `excludeWords`. Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". This setting only has an effect if `advancedSyntax` is true.
|
188
189
|
attr_accessor :advanced_syntax_features
|
189
190
|
|
190
191
|
attr_accessor :distinct
|
@@ -204,7 +205,7 @@ module Algolia
|
|
204
205
|
# Maximum number of facet values to return for each facet.
|
205
206
|
attr_accessor :max_values_per_facet
|
206
207
|
|
207
|
-
# Order in which to retrieve facet values.
|
208
|
+
# Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js/).
|
208
209
|
attr_accessor :sort_facet_values_by
|
209
210
|
|
210
211
|
# Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.
|
@@ -350,7 +351,7 @@ module Algolia
|
|
350
351
|
:minimum_around_radius => :Integer,
|
351
352
|
:inside_bounding_box => :'Array<Array<Float>>',
|
352
353
|
:inside_polygon => :'Array<Array<Float>>',
|
353
|
-
:natural_languages => :'Array<
|
354
|
+
:natural_languages => :'Array<SupportedLanguage>',
|
354
355
|
:rule_contexts => :'Array<String>',
|
355
356
|
:personalization_impact => :Integer,
|
356
357
|
:user_token => :String,
|
@@ -5,12 +5,12 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
|
-
# Recommend rules
|
8
|
+
# Recommend rules parameters.
|
9
9
|
class SearchRecommendRulesParams
|
10
10
|
# Search query.
|
11
11
|
attr_accessor :query
|
12
12
|
|
13
|
-
#
|
13
|
+
# Only search for rules with matching context.
|
14
14
|
attr_accessor :context
|
15
15
|
|
16
16
|
# Requested page of the API response.
|
@@ -19,9 +19,18 @@ module Algolia
|
|
19
19
|
# Maximum number of hits per page.
|
20
20
|
attr_accessor :hits_per_page
|
21
21
|
|
22
|
-
#
|
22
|
+
# Whether to only show rules where the value of their `enabled` property matches this parameter. If absent, show all rules, regardless of their `enabled` property.
|
23
23
|
attr_accessor :enabled
|
24
24
|
|
25
|
+
# Filter expression. This only searches for rules matching the filter expression.
|
26
|
+
attr_accessor :filters
|
27
|
+
|
28
|
+
# Include facets and facet values in the response. Use `['*']` to include all facets.
|
29
|
+
attr_accessor :facets
|
30
|
+
|
31
|
+
# Maximum number of values to return for each facet.
|
32
|
+
attr_accessor :max_values_per_facet
|
33
|
+
|
25
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
35
|
def self.attribute_map
|
27
36
|
{
|
@@ -29,7 +38,10 @@ module Algolia
|
|
29
38
|
:context => :context,
|
30
39
|
:page => :page,
|
31
40
|
:hits_per_page => :hitsPerPage,
|
32
|
-
:enabled => :enabled
|
41
|
+
:enabled => :enabled,
|
42
|
+
:filters => :filters,
|
43
|
+
:facets => :facets,
|
44
|
+
:max_values_per_facet => :maxValuesPerFacet
|
33
45
|
}
|
34
46
|
end
|
35
47
|
|
@@ -45,15 +57,16 @@ module Algolia
|
|
45
57
|
:context => :String,
|
46
58
|
:page => :Integer,
|
47
59
|
:hits_per_page => :Integer,
|
48
|
-
:enabled => :Boolean
|
60
|
+
:enabled => :Boolean,
|
61
|
+
:filters => :String,
|
62
|
+
:facets => :'Array<String>',
|
63
|
+
:max_values_per_facet => :Integer
|
49
64
|
}
|
50
65
|
end
|
51
66
|
|
52
67
|
# List of attributes with nullable: true
|
53
68
|
def self.openapi_nullable
|
54
|
-
Set.new([
|
55
|
-
:enabled
|
56
|
-
])
|
69
|
+
Set.new([])
|
57
70
|
end
|
58
71
|
|
59
72
|
# Initializes the object
|
@@ -92,6 +105,20 @@ module Algolia
|
|
92
105
|
if attributes.key?(:enabled)
|
93
106
|
self.enabled = attributes[:enabled]
|
94
107
|
end
|
108
|
+
|
109
|
+
if attributes.key?(:filters)
|
110
|
+
self.filters = attributes[:filters]
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:facets)
|
114
|
+
if (value = attributes[:facets]).is_a?(Array)
|
115
|
+
self.facets = value
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:max_values_per_facet)
|
120
|
+
self.max_values_per_facet = attributes[:max_values_per_facet]
|
121
|
+
end
|
95
122
|
end
|
96
123
|
|
97
124
|
# Custom attribute writer method with validation
|
@@ -126,6 +153,24 @@ module Algolia
|
|
126
153
|
@hits_per_page = hits_per_page
|
127
154
|
end
|
128
155
|
|
156
|
+
# Custom attribute writer method with validation
|
157
|
+
# @param [Object] max_values_per_facet Value to be assigned
|
158
|
+
def max_values_per_facet=(max_values_per_facet)
|
159
|
+
if max_values_per_facet.nil?
|
160
|
+
raise ArgumentError, 'max_values_per_facet cannot be nil'
|
161
|
+
end
|
162
|
+
|
163
|
+
if max_values_per_facet > 1000
|
164
|
+
raise ArgumentError, 'invalid value for "max_values_per_facet", must be smaller than or equal to 1000.'
|
165
|
+
end
|
166
|
+
|
167
|
+
if max_values_per_facet < 1
|
168
|
+
raise ArgumentError, 'invalid value for "max_values_per_facet", must be greater than or equal to 1.'
|
169
|
+
end
|
170
|
+
|
171
|
+
@max_values_per_facet = max_values_per_facet
|
172
|
+
end
|
173
|
+
|
129
174
|
# Checks equality by comparing each attribute.
|
130
175
|
# @param [Object] Object to be compared
|
131
176
|
def ==(other)
|
@@ -136,7 +181,10 @@ module Algolia
|
|
136
181
|
context == other.context &&
|
137
182
|
page == other.page &&
|
138
183
|
hits_per_page == other.hits_per_page &&
|
139
|
-
enabled == other.enabled
|
184
|
+
enabled == other.enabled &&
|
185
|
+
filters == other.filters &&
|
186
|
+
facets == other.facets &&
|
187
|
+
max_values_per_facet == other.max_values_per_facet
|
140
188
|
end
|
141
189
|
|
142
190
|
# @see the `==` method
|
@@ -148,7 +196,7 @@ module Algolia
|
|
148
196
|
# Calculates hash code according to all attributes.
|
149
197
|
# @return [Integer] Hash code
|
150
198
|
def hash
|
151
|
-
[query, context, page, hits_per_page, enabled].hash
|
199
|
+
[query, context, page, hits_per_page, enabled, filters, facets, max_values_per_facet].hash
|
152
200
|
end
|
153
201
|
|
154
202
|
# Builds the object from hash
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Recommend
|
8
8
|
class SearchRecommendRulesResponse
|
9
|
-
#
|
9
|
+
# Recommend rules that match the search criteria.
|
10
10
|
attr_accessor :hits
|
11
11
|
|
12
12
|
# Number of results (hits).
|
@@ -36,7 +36,7 @@ module Algolia
|
|
36
36
|
# Attribute type mapping.
|
37
37
|
def self.types_mapping
|
38
38
|
{
|
39
|
-
:hits => :'Array<
|
39
|
+
:hits => :'Array<RecommendRule>',
|
40
40
|
:nb_hits => :Integer,
|
41
41
|
:page => :Integer,
|
42
42
|
:nb_pages => :Integer
|
@@ -10,10 +10,10 @@ module Algolia
|
|
10
10
|
# Recommendation score.
|
11
11
|
attr_accessor :_score
|
12
12
|
|
13
|
-
# Facet
|
13
|
+
# Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the facet filter will be returned.
|
14
14
|
attr_accessor :facet_name
|
15
15
|
|
16
|
-
# Facet value
|
16
|
+
# Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet filter will be returned.
|
17
17
|
attr_accessor :facet_value
|
18
18
|
|
19
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|