algolia 3.0.0.beta.9 → 3.0.0.beta.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +4 -2
- data/lib/algolia/api/ingestion_client.rb +912 -359
- data/lib/algolia/api/search_client.rb +17 -17
- data/lib/algolia/error.rb +10 -0
- data/lib/algolia/logger_helper.rb +11 -2
- data/lib/algolia/models/ingestion/action.rb +45 -0
- data/lib/algolia/models/ingestion/batch_request.rb +247 -0
- data/lib/algolia/models/ingestion/batch_write_params.rb +216 -0
- data/lib/algolia/models/ingestion/list_tasks_response_v1.rb +227 -0
- data/lib/algolia/models/ingestion/source_shopify.rb +10 -77
- data/lib/algolia/models/ingestion/source_update_shopify.rb +10 -76
- data/lib/algolia/models/ingestion/task.rb +30 -9
- data/lib/algolia/models/ingestion/task_create.rb +11 -12
- data/lib/algolia/models/ingestion/task_create_v1.rb +328 -0
- data/lib/algolia/models/ingestion/task_update.rb +8 -7
- data/lib/algolia/models/ingestion/task_update_v1.rb +269 -0
- data/lib/algolia/models/ingestion/task_v1.rb +373 -0
- data/lib/algolia/models/recommend/get_recommendations_response.rb +2 -0
- data/lib/algolia/models/recommend/trending_items.rb +0 -4
- data/lib/algolia/models/recommend/trending_items_query.rb +0 -4
- data/lib/algolia/models/search/settings_response.rb +1028 -0
- data/lib/algolia/models/search/with_primary.rb +212 -0
- data/lib/algolia/transport/transport.rb +9 -3
- data/lib/algolia/version.rb +1 -1
- metadata +11 -2
@@ -0,0 +1,1028 @@
|
|
1
|
+
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "time"
|
5
|
+
|
6
|
+
module Algolia
|
7
|
+
module Search
|
8
|
+
class SettingsResponse
|
9
|
+
# Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows using this attribute as a filter, but doesn't evalue the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
|
10
|
+
attr_accessor :attributes_for_faceting
|
11
|
+
|
12
|
+
# Creates [replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/). Replicas are copies of a primary index with the same records but different settings, synonyms, or rules. If you want to offer a different ranking or sorting of your search results, you'll use replica indices. All index operations on a primary index are automatically forwarded to its replicas. To add a replica index, you must provide the complete set of replicas to this parameter. If you omit a replica from this list, the replica turns into a regular, standalone index that will no longer by synced with the primary index. **Modifier** - `virtual(\"REPLICA\")`. Create a virtual replica, Virtual replicas don't increase the number of records and are optimized for [Relevant sorting](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/relevant-sort/).
|
13
|
+
attr_accessor :replicas
|
14
|
+
|
15
|
+
# Maximum number of search results that can be obtained through pagination. Higher pagination limits might slow down your search. For pagination limits above 1,000, the sorting of results beyond the 1,000th hit can't be guaranteed.
|
16
|
+
attr_accessor :pagination_limited_to
|
17
|
+
|
18
|
+
# Attributes that can't be retrieved at query time. This can be useful if you want to use an attribute for ranking or to [restrict access](https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data/), but don't want to include it in the search results. Attribute names are case-sensitive.
|
19
|
+
attr_accessor :unretrievable_attributes
|
20
|
+
|
21
|
+
# Words for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) for the specified words.
|
22
|
+
attr_accessor :disable_typo_tolerance_on_words
|
23
|
+
|
24
|
+
# Attributes, for which you want to support [Japanese transliteration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#japanese-transliteration-and-type-ahead). Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive.
|
25
|
+
attr_accessor :attributes_to_transliterate
|
26
|
+
|
27
|
+
# Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive.
|
28
|
+
attr_accessor :camel_case_attributes
|
29
|
+
|
30
|
+
# Searchable attributes to which Algolia should apply [word segmentation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) (decompounding). Attribute names are case-sensitive. Compound words are formed by combining two or more individual words, and are particularly prevalent in Germanic languages—for example, \"firefighter\". With decompounding, the individual components are indexed separately. You can specify different lists for different languages. Decompounding is supported for these languages: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`).
|
31
|
+
attr_accessor :decompounded_attributes
|
32
|
+
|
33
|
+
# Languages for language-specific processing steps, such as word detection and dictionary settings. **You should always specify an indexing language.** If 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/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For 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/).
|
34
|
+
attr_accessor :index_languages
|
35
|
+
|
36
|
+
# Searchable attributes for which you want to turn off [prefix matching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#adjusting-prefix-search). Attribute names are case-sensitive.
|
37
|
+
attr_accessor :disable_prefix_on_attributes
|
38
|
+
|
39
|
+
# Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered.
|
40
|
+
attr_accessor :allow_compression_of_integer_array
|
41
|
+
|
42
|
+
# Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. If you want to turn off filtering for all numeric attributes, specifiy an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly(\"ATTRIBUTE\")`. Support only filtering based on equality comparisons `=` and `!=`.
|
43
|
+
attr_accessor :numeric_attributes_for_filtering
|
44
|
+
|
45
|
+
# Controls which separators are indexed. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. By default, separator characters aren't indexed. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, a search for `C#` would report two matches.
|
46
|
+
attr_accessor :separators_to_index
|
47
|
+
|
48
|
+
# Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without modifier, matches at the beginning of an attribute rank higer than matches at the end.
|
49
|
+
attr_accessor :searchable_attributes
|
50
|
+
|
51
|
+
# An object with custom data. You can store up to 32kB as custom data.
|
52
|
+
attr_accessor :user_data
|
53
|
+
|
54
|
+
# Characters and their normalized replacements. This overrides Algolia's default [normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/).
|
55
|
+
attr_accessor :custom_normalization
|
56
|
+
|
57
|
+
# Attribute that should be used to establish groups of results. Attribute names are case-sensitive. All records with the same value for this attribute are considered a group. You can combine `attributeForDistinct` with the `distinct` search parameter to control how many items per group are included in the search results. If you want to use the same attribute also for faceting, use the `afterDistinct` modifier of the `attributesForFaceting` setting. This applies faceting _after_ deduplication, which will result in accurate facet counts.
|
58
|
+
attr_accessor :attribute_for_distinct
|
59
|
+
|
60
|
+
# 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.
|
61
|
+
attr_accessor :attributes_to_retrieve
|
62
|
+
|
63
|
+
# 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/).
|
64
|
+
attr_accessor :ranking
|
65
|
+
|
66
|
+
# 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.
|
67
|
+
attr_accessor :custom_ranking
|
68
|
+
|
69
|
+
# 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.
|
70
|
+
attr_accessor :relevancy_strictness
|
71
|
+
|
72
|
+
# 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/).
|
73
|
+
attr_accessor :attributes_to_highlight
|
74
|
+
|
75
|
+
# 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.
|
76
|
+
attr_accessor :attributes_to_snippet
|
77
|
+
|
78
|
+
# HTML tag to insert before the highlighted parts in all highlighted results and snippets.
|
79
|
+
attr_accessor :highlight_pre_tag
|
80
|
+
|
81
|
+
# HTML tag to insert after the highlighted parts in all highlighted results and snippets.
|
82
|
+
attr_accessor :highlight_post_tag
|
83
|
+
|
84
|
+
# String used as an ellipsis indicator when a snippet is truncated.
|
85
|
+
attr_accessor :snippet_ellipsis_text
|
86
|
+
|
87
|
+
# Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted.
|
88
|
+
attr_accessor :restrict_highlight_and_snippet_arrays
|
89
|
+
|
90
|
+
# Number of hits per page.
|
91
|
+
attr_accessor :hits_per_page
|
92
|
+
|
93
|
+
# 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).
|
94
|
+
attr_accessor :min_word_sizefor1_typo
|
95
|
+
|
96
|
+
# 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).
|
97
|
+
attr_accessor :min_word_sizefor2_typos
|
98
|
+
|
99
|
+
attr_accessor :typo_tolerance
|
100
|
+
|
101
|
+
# 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.
|
102
|
+
attr_accessor :allow_typos_on_numeric_tokens
|
103
|
+
|
104
|
+
# 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.
|
105
|
+
attr_accessor :disable_typo_tolerance_on_attributes
|
106
|
+
|
107
|
+
attr_accessor :ignore_plurals
|
108
|
+
|
109
|
+
attr_accessor :remove_stop_words
|
110
|
+
|
111
|
+
# Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
|
112
|
+
attr_accessor :keep_diacritics_on_characters
|
113
|
+
|
114
|
+
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This 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. To support this, you must place the CJK language **first**. **You should always specify a query language.** If 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/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For 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/).
|
115
|
+
attr_accessor :query_languages
|
116
|
+
|
117
|
+
# Whether to split compound words into their building blocks. For 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). Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian.
|
118
|
+
attr_accessor :decompound_query
|
119
|
+
|
120
|
+
# Whether to enable rules.
|
121
|
+
attr_accessor :enable_rules
|
122
|
+
|
123
|
+
# Whether to enable Personalization.
|
124
|
+
attr_accessor :enable_personalization
|
125
|
+
|
126
|
+
attr_accessor :query_type
|
127
|
+
|
128
|
+
attr_accessor :remove_words_if_no_results
|
129
|
+
|
130
|
+
attr_accessor :mode
|
131
|
+
|
132
|
+
attr_accessor :semantic_search
|
133
|
+
|
134
|
+
# Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
|
135
|
+
attr_accessor :advanced_syntax
|
136
|
+
|
137
|
+
# 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).
|
138
|
+
attr_accessor :optional_words
|
139
|
+
|
140
|
+
# 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.
|
141
|
+
attr_accessor :disable_exact_on_attributes
|
142
|
+
|
143
|
+
attr_accessor :exact_on_single_word_query
|
144
|
+
|
145
|
+
# 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.
|
146
|
+
attr_accessor :alternatives_as_exact
|
147
|
+
|
148
|
+
# 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.
|
149
|
+
attr_accessor :advanced_syntax_features
|
150
|
+
|
151
|
+
attr_accessor :distinct
|
152
|
+
|
153
|
+
# Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted. With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurences of \"house\" are replaced by \"home\" in the highlighted response.
|
154
|
+
attr_accessor :replace_synonyms_in_highlight
|
155
|
+
|
156
|
+
# Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart. For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
|
157
|
+
attr_accessor :min_proximity
|
158
|
+
|
159
|
+
# Properties to include in the API response of `search` and `browse` requests. By default, all response properties are included. To reduce the response size, you can select, which attributes should be included. You can't exclude these properties: `message`, `warning`, `cursor`, `serverUsed`, `indexUsed`, `abTestVariantID`, `parsedQuery`, or any property triggered by the `getRankingInfo` parameter. Don't exclude properties that you might need in your search UI.
|
160
|
+
attr_accessor :response_fields
|
161
|
+
|
162
|
+
# Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
|
163
|
+
attr_accessor :max_facet_hits
|
164
|
+
|
165
|
+
# Maximum number of facet values to return for each facet.
|
166
|
+
attr_accessor :max_values_per_facet
|
167
|
+
|
168
|
+
# 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/).
|
169
|
+
attr_accessor :sort_facet_values_by
|
170
|
+
|
171
|
+
# 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.
|
172
|
+
attr_accessor :attribute_criteria_computed_by_min_proximity
|
173
|
+
|
174
|
+
attr_accessor :rendering_content
|
175
|
+
|
176
|
+
# Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
177
|
+
attr_accessor :enable_re_ranking
|
178
|
+
|
179
|
+
attr_accessor :re_ranking_apply_filter
|
180
|
+
|
181
|
+
# Replica indices only: the name of the primary index for this replica.
|
182
|
+
attr_accessor :primary
|
183
|
+
|
184
|
+
class EnumAttributeValidator
|
185
|
+
attr_reader :datatype
|
186
|
+
attr_reader :allowable_values
|
187
|
+
|
188
|
+
def initialize(datatype, allowable_values)
|
189
|
+
@allowable_values = allowable_values.map do |value|
|
190
|
+
case datatype.to_s
|
191
|
+
when /Integer/i
|
192
|
+
value.to_i
|
193
|
+
when /Float/i
|
194
|
+
value.to_f
|
195
|
+
else
|
196
|
+
value
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
def valid?(value)
|
202
|
+
!value || allowable_values.include?(value)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
207
|
+
def self.attribute_map
|
208
|
+
{
|
209
|
+
:attributes_for_faceting => :attributesForFaceting,
|
210
|
+
:replicas => :replicas,
|
211
|
+
:pagination_limited_to => :paginationLimitedTo,
|
212
|
+
:unretrievable_attributes => :unretrievableAttributes,
|
213
|
+
:disable_typo_tolerance_on_words => :disableTypoToleranceOnWords,
|
214
|
+
:attributes_to_transliterate => :attributesToTransliterate,
|
215
|
+
:camel_case_attributes => :camelCaseAttributes,
|
216
|
+
:decompounded_attributes => :decompoundedAttributes,
|
217
|
+
:index_languages => :indexLanguages,
|
218
|
+
:disable_prefix_on_attributes => :disablePrefixOnAttributes,
|
219
|
+
:allow_compression_of_integer_array => :allowCompressionOfIntegerArray,
|
220
|
+
:numeric_attributes_for_filtering => :numericAttributesForFiltering,
|
221
|
+
:separators_to_index => :separatorsToIndex,
|
222
|
+
:searchable_attributes => :searchableAttributes,
|
223
|
+
:user_data => :userData,
|
224
|
+
:custom_normalization => :customNormalization,
|
225
|
+
:attribute_for_distinct => :attributeForDistinct,
|
226
|
+
:attributes_to_retrieve => :attributesToRetrieve,
|
227
|
+
:ranking => :ranking,
|
228
|
+
:custom_ranking => :customRanking,
|
229
|
+
:relevancy_strictness => :relevancyStrictness,
|
230
|
+
:attributes_to_highlight => :attributesToHighlight,
|
231
|
+
:attributes_to_snippet => :attributesToSnippet,
|
232
|
+
:highlight_pre_tag => :highlightPreTag,
|
233
|
+
:highlight_post_tag => :highlightPostTag,
|
234
|
+
:snippet_ellipsis_text => :snippetEllipsisText,
|
235
|
+
:restrict_highlight_and_snippet_arrays => :restrictHighlightAndSnippetArrays,
|
236
|
+
:hits_per_page => :hitsPerPage,
|
237
|
+
:min_word_sizefor1_typo => :minWordSizefor1Typo,
|
238
|
+
:min_word_sizefor2_typos => :minWordSizefor2Typos,
|
239
|
+
:typo_tolerance => :typoTolerance,
|
240
|
+
:allow_typos_on_numeric_tokens => :allowTyposOnNumericTokens,
|
241
|
+
:disable_typo_tolerance_on_attributes => :disableTypoToleranceOnAttributes,
|
242
|
+
:ignore_plurals => :ignorePlurals,
|
243
|
+
:remove_stop_words => :removeStopWords,
|
244
|
+
:keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
|
245
|
+
:query_languages => :queryLanguages,
|
246
|
+
:decompound_query => :decompoundQuery,
|
247
|
+
:enable_rules => :enableRules,
|
248
|
+
:enable_personalization => :enablePersonalization,
|
249
|
+
:query_type => :queryType,
|
250
|
+
:remove_words_if_no_results => :removeWordsIfNoResults,
|
251
|
+
:mode => :mode,
|
252
|
+
:semantic_search => :semanticSearch,
|
253
|
+
:advanced_syntax => :advancedSyntax,
|
254
|
+
:optional_words => :optionalWords,
|
255
|
+
:disable_exact_on_attributes => :disableExactOnAttributes,
|
256
|
+
:exact_on_single_word_query => :exactOnSingleWordQuery,
|
257
|
+
:alternatives_as_exact => :alternativesAsExact,
|
258
|
+
:advanced_syntax_features => :advancedSyntaxFeatures,
|
259
|
+
:distinct => :distinct,
|
260
|
+
:replace_synonyms_in_highlight => :replaceSynonymsInHighlight,
|
261
|
+
:min_proximity => :minProximity,
|
262
|
+
:response_fields => :responseFields,
|
263
|
+
:max_facet_hits => :maxFacetHits,
|
264
|
+
:max_values_per_facet => :maxValuesPerFacet,
|
265
|
+
:sort_facet_values_by => :sortFacetValuesBy,
|
266
|
+
:attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
|
267
|
+
:rendering_content => :renderingContent,
|
268
|
+
:enable_re_ranking => :enableReRanking,
|
269
|
+
:re_ranking_apply_filter => :reRankingApplyFilter,
|
270
|
+
:primary => :primary
|
271
|
+
}
|
272
|
+
end
|
273
|
+
|
274
|
+
# Returns all the JSON keys this model knows about
|
275
|
+
def self.acceptable_attributes
|
276
|
+
attribute_map.values
|
277
|
+
end
|
278
|
+
|
279
|
+
# Attribute type mapping.
|
280
|
+
def self.types_mapping
|
281
|
+
{
|
282
|
+
:attributes_for_faceting => :"Array<String>",
|
283
|
+
:replicas => :"Array<String>",
|
284
|
+
:pagination_limited_to => :"Integer",
|
285
|
+
:unretrievable_attributes => :"Array<String>",
|
286
|
+
:disable_typo_tolerance_on_words => :"Array<String>",
|
287
|
+
:attributes_to_transliterate => :"Array<String>",
|
288
|
+
:camel_case_attributes => :"Array<String>",
|
289
|
+
:decompounded_attributes => :"Object",
|
290
|
+
:index_languages => :"Array<SupportedLanguage>",
|
291
|
+
:disable_prefix_on_attributes => :"Array<String>",
|
292
|
+
:allow_compression_of_integer_array => :"Boolean",
|
293
|
+
:numeric_attributes_for_filtering => :"Array<String>",
|
294
|
+
:separators_to_index => :"String",
|
295
|
+
:searchable_attributes => :"Array<String>",
|
296
|
+
:user_data => :"Object",
|
297
|
+
:custom_normalization => :"Hash<String, Hash<String, String>>",
|
298
|
+
:attribute_for_distinct => :"String",
|
299
|
+
:attributes_to_retrieve => :"Array<String>",
|
300
|
+
:ranking => :"Array<String>",
|
301
|
+
:custom_ranking => :"Array<String>",
|
302
|
+
:relevancy_strictness => :"Integer",
|
303
|
+
:attributes_to_highlight => :"Array<String>",
|
304
|
+
:attributes_to_snippet => :"Array<String>",
|
305
|
+
:highlight_pre_tag => :"String",
|
306
|
+
:highlight_post_tag => :"String",
|
307
|
+
:snippet_ellipsis_text => :"String",
|
308
|
+
:restrict_highlight_and_snippet_arrays => :"Boolean",
|
309
|
+
:hits_per_page => :"Integer",
|
310
|
+
:min_word_sizefor1_typo => :"Integer",
|
311
|
+
:min_word_sizefor2_typos => :"Integer",
|
312
|
+
:typo_tolerance => :"TypoTolerance",
|
313
|
+
:allow_typos_on_numeric_tokens => :"Boolean",
|
314
|
+
:disable_typo_tolerance_on_attributes => :"Array<String>",
|
315
|
+
:ignore_plurals => :"IgnorePlurals",
|
316
|
+
:remove_stop_words => :"RemoveStopWords",
|
317
|
+
:keep_diacritics_on_characters => :"String",
|
318
|
+
:query_languages => :"Array<SupportedLanguage>",
|
319
|
+
:decompound_query => :"Boolean",
|
320
|
+
:enable_rules => :"Boolean",
|
321
|
+
:enable_personalization => :"Boolean",
|
322
|
+
:query_type => :"QueryType",
|
323
|
+
:remove_words_if_no_results => :"RemoveWordsIfNoResults",
|
324
|
+
:mode => :"Mode",
|
325
|
+
:semantic_search => :"SemanticSearch",
|
326
|
+
:advanced_syntax => :"Boolean",
|
327
|
+
:optional_words => :"Array<String>",
|
328
|
+
:disable_exact_on_attributes => :"Array<String>",
|
329
|
+
:exact_on_single_word_query => :"ExactOnSingleWordQuery",
|
330
|
+
:alternatives_as_exact => :"Array<AlternativesAsExact>",
|
331
|
+
:advanced_syntax_features => :"Array<AdvancedSyntaxFeatures>",
|
332
|
+
:distinct => :"Distinct",
|
333
|
+
:replace_synonyms_in_highlight => :"Boolean",
|
334
|
+
:min_proximity => :"Integer",
|
335
|
+
:response_fields => :"Array<String>",
|
336
|
+
:max_facet_hits => :"Integer",
|
337
|
+
:max_values_per_facet => :"Integer",
|
338
|
+
:sort_facet_values_by => :"String",
|
339
|
+
:attribute_criteria_computed_by_min_proximity => :"Boolean",
|
340
|
+
:rendering_content => :"RenderingContent",
|
341
|
+
:enable_re_ranking => :"Boolean",
|
342
|
+
:re_ranking_apply_filter => :"ReRankingApplyFilter",
|
343
|
+
:primary => :"String"
|
344
|
+
}
|
345
|
+
end
|
346
|
+
|
347
|
+
# List of attributes with nullable: true
|
348
|
+
def self.openapi_nullable
|
349
|
+
Set.new(
|
350
|
+
[]
|
351
|
+
)
|
352
|
+
end
|
353
|
+
|
354
|
+
# List of class defined in allOf (OpenAPI v3)
|
355
|
+
def self.openapi_all_of
|
356
|
+
[
|
357
|
+
:"IndexSettings",
|
358
|
+
:"WithPrimary"
|
359
|
+
]
|
360
|
+
end
|
361
|
+
|
362
|
+
# Initializes the object
|
363
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
364
|
+
def initialize(attributes = {})
|
365
|
+
if (!attributes.is_a?(Hash))
|
366
|
+
raise(
|
367
|
+
ArgumentError,
|
368
|
+
"The input argument (attributes) must be a hash in `Algolia::SettingsResponse` initialize method"
|
369
|
+
)
|
370
|
+
end
|
371
|
+
|
372
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
373
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
374
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
375
|
+
raise(
|
376
|
+
ArgumentError,
|
377
|
+
"`#{k}` is not a valid attribute in `Algolia::SettingsResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
378
|
+
self.class.attribute_map.keys.inspect
|
379
|
+
)
|
380
|
+
end
|
381
|
+
|
382
|
+
h[k.to_sym] = v
|
383
|
+
}
|
384
|
+
|
385
|
+
if attributes.key?(:attributes_for_faceting)
|
386
|
+
if (value = attributes[:attributes_for_faceting]).is_a?(Array)
|
387
|
+
self.attributes_for_faceting = value
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
if attributes.key?(:replicas)
|
392
|
+
if (value = attributes[:replicas]).is_a?(Array)
|
393
|
+
self.replicas = value
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
if attributes.key?(:pagination_limited_to)
|
398
|
+
self.pagination_limited_to = attributes[:pagination_limited_to]
|
399
|
+
end
|
400
|
+
|
401
|
+
if attributes.key?(:unretrievable_attributes)
|
402
|
+
if (value = attributes[:unretrievable_attributes]).is_a?(Array)
|
403
|
+
self.unretrievable_attributes = value
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
if attributes.key?(:disable_typo_tolerance_on_words)
|
408
|
+
if (value = attributes[:disable_typo_tolerance_on_words]).is_a?(Array)
|
409
|
+
self.disable_typo_tolerance_on_words = value
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
if attributes.key?(:attributes_to_transliterate)
|
414
|
+
if (value = attributes[:attributes_to_transliterate]).is_a?(Array)
|
415
|
+
self.attributes_to_transliterate = value
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
419
|
+
if attributes.key?(:camel_case_attributes)
|
420
|
+
if (value = attributes[:camel_case_attributes]).is_a?(Array)
|
421
|
+
self.camel_case_attributes = value
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
if attributes.key?(:decompounded_attributes)
|
426
|
+
self.decompounded_attributes = attributes[:decompounded_attributes]
|
427
|
+
end
|
428
|
+
|
429
|
+
if attributes.key?(:index_languages)
|
430
|
+
if (value = attributes[:index_languages]).is_a?(Array)
|
431
|
+
self.index_languages = value
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
435
|
+
if attributes.key?(:disable_prefix_on_attributes)
|
436
|
+
if (value = attributes[:disable_prefix_on_attributes]).is_a?(Array)
|
437
|
+
self.disable_prefix_on_attributes = value
|
438
|
+
end
|
439
|
+
end
|
440
|
+
|
441
|
+
if attributes.key?(:allow_compression_of_integer_array)
|
442
|
+
self.allow_compression_of_integer_array = attributes[:allow_compression_of_integer_array]
|
443
|
+
end
|
444
|
+
|
445
|
+
if attributes.key?(:numeric_attributes_for_filtering)
|
446
|
+
if (value = attributes[:numeric_attributes_for_filtering]).is_a?(Array)
|
447
|
+
self.numeric_attributes_for_filtering = value
|
448
|
+
end
|
449
|
+
end
|
450
|
+
|
451
|
+
if attributes.key?(:separators_to_index)
|
452
|
+
self.separators_to_index = attributes[:separators_to_index]
|
453
|
+
end
|
454
|
+
|
455
|
+
if attributes.key?(:searchable_attributes)
|
456
|
+
if (value = attributes[:searchable_attributes]).is_a?(Array)
|
457
|
+
self.searchable_attributes = value
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
if attributes.key?(:user_data)
|
462
|
+
self.user_data = attributes[:user_data]
|
463
|
+
end
|
464
|
+
|
465
|
+
if attributes.key?(:custom_normalization)
|
466
|
+
if (value = attributes[:custom_normalization]).is_a?(Hash)
|
467
|
+
self.custom_normalization = value
|
468
|
+
end
|
469
|
+
end
|
470
|
+
|
471
|
+
if attributes.key?(:attribute_for_distinct)
|
472
|
+
self.attribute_for_distinct = attributes[:attribute_for_distinct]
|
473
|
+
end
|
474
|
+
|
475
|
+
if attributes.key?(:attributes_to_retrieve)
|
476
|
+
if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
|
477
|
+
self.attributes_to_retrieve = value
|
478
|
+
end
|
479
|
+
end
|
480
|
+
|
481
|
+
if attributes.key?(:ranking)
|
482
|
+
if (value = attributes[:ranking]).is_a?(Array)
|
483
|
+
self.ranking = value
|
484
|
+
end
|
485
|
+
end
|
486
|
+
|
487
|
+
if attributes.key?(:custom_ranking)
|
488
|
+
if (value = attributes[:custom_ranking]).is_a?(Array)
|
489
|
+
self.custom_ranking = value
|
490
|
+
end
|
491
|
+
end
|
492
|
+
|
493
|
+
if attributes.key?(:relevancy_strictness)
|
494
|
+
self.relevancy_strictness = attributes[:relevancy_strictness]
|
495
|
+
end
|
496
|
+
|
497
|
+
if attributes.key?(:attributes_to_highlight)
|
498
|
+
if (value = attributes[:attributes_to_highlight]).is_a?(Array)
|
499
|
+
self.attributes_to_highlight = value
|
500
|
+
end
|
501
|
+
end
|
502
|
+
|
503
|
+
if attributes.key?(:attributes_to_snippet)
|
504
|
+
if (value = attributes[:attributes_to_snippet]).is_a?(Array)
|
505
|
+
self.attributes_to_snippet = value
|
506
|
+
end
|
507
|
+
end
|
508
|
+
|
509
|
+
if attributes.key?(:highlight_pre_tag)
|
510
|
+
self.highlight_pre_tag = attributes[:highlight_pre_tag]
|
511
|
+
end
|
512
|
+
|
513
|
+
if attributes.key?(:highlight_post_tag)
|
514
|
+
self.highlight_post_tag = attributes[:highlight_post_tag]
|
515
|
+
end
|
516
|
+
|
517
|
+
if attributes.key?(:snippet_ellipsis_text)
|
518
|
+
self.snippet_ellipsis_text = attributes[:snippet_ellipsis_text]
|
519
|
+
end
|
520
|
+
|
521
|
+
if attributes.key?(:restrict_highlight_and_snippet_arrays)
|
522
|
+
self.restrict_highlight_and_snippet_arrays = attributes[:restrict_highlight_and_snippet_arrays]
|
523
|
+
end
|
524
|
+
|
525
|
+
if attributes.key?(:hits_per_page)
|
526
|
+
self.hits_per_page = attributes[:hits_per_page]
|
527
|
+
end
|
528
|
+
|
529
|
+
if attributes.key?(:min_word_sizefor1_typo)
|
530
|
+
self.min_word_sizefor1_typo = attributes[:min_word_sizefor1_typo]
|
531
|
+
end
|
532
|
+
|
533
|
+
if attributes.key?(:min_word_sizefor2_typos)
|
534
|
+
self.min_word_sizefor2_typos = attributes[:min_word_sizefor2_typos]
|
535
|
+
end
|
536
|
+
|
537
|
+
if attributes.key?(:typo_tolerance)
|
538
|
+
self.typo_tolerance = attributes[:typo_tolerance]
|
539
|
+
end
|
540
|
+
|
541
|
+
if attributes.key?(:allow_typos_on_numeric_tokens)
|
542
|
+
self.allow_typos_on_numeric_tokens = attributes[:allow_typos_on_numeric_tokens]
|
543
|
+
end
|
544
|
+
|
545
|
+
if attributes.key?(:disable_typo_tolerance_on_attributes)
|
546
|
+
if (value = attributes[:disable_typo_tolerance_on_attributes]).is_a?(Array)
|
547
|
+
self.disable_typo_tolerance_on_attributes = value
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
551
|
+
if attributes.key?(:ignore_plurals)
|
552
|
+
self.ignore_plurals = attributes[:ignore_plurals]
|
553
|
+
end
|
554
|
+
|
555
|
+
if attributes.key?(:remove_stop_words)
|
556
|
+
self.remove_stop_words = attributes[:remove_stop_words]
|
557
|
+
end
|
558
|
+
|
559
|
+
if attributes.key?(:keep_diacritics_on_characters)
|
560
|
+
self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
|
561
|
+
end
|
562
|
+
|
563
|
+
if attributes.key?(:query_languages)
|
564
|
+
if (value = attributes[:query_languages]).is_a?(Array)
|
565
|
+
self.query_languages = value
|
566
|
+
end
|
567
|
+
end
|
568
|
+
|
569
|
+
if attributes.key?(:decompound_query)
|
570
|
+
self.decompound_query = attributes[:decompound_query]
|
571
|
+
end
|
572
|
+
|
573
|
+
if attributes.key?(:enable_rules)
|
574
|
+
self.enable_rules = attributes[:enable_rules]
|
575
|
+
end
|
576
|
+
|
577
|
+
if attributes.key?(:enable_personalization)
|
578
|
+
self.enable_personalization = attributes[:enable_personalization]
|
579
|
+
end
|
580
|
+
|
581
|
+
if attributes.key?(:query_type)
|
582
|
+
self.query_type = attributes[:query_type]
|
583
|
+
end
|
584
|
+
|
585
|
+
if attributes.key?(:remove_words_if_no_results)
|
586
|
+
self.remove_words_if_no_results = attributes[:remove_words_if_no_results]
|
587
|
+
end
|
588
|
+
|
589
|
+
if attributes.key?(:mode)
|
590
|
+
self.mode = attributes[:mode]
|
591
|
+
end
|
592
|
+
|
593
|
+
if attributes.key?(:semantic_search)
|
594
|
+
self.semantic_search = attributes[:semantic_search]
|
595
|
+
end
|
596
|
+
|
597
|
+
if attributes.key?(:advanced_syntax)
|
598
|
+
self.advanced_syntax = attributes[:advanced_syntax]
|
599
|
+
end
|
600
|
+
|
601
|
+
if attributes.key?(:optional_words)
|
602
|
+
if (value = attributes[:optional_words]).is_a?(Array)
|
603
|
+
self.optional_words = value
|
604
|
+
end
|
605
|
+
end
|
606
|
+
|
607
|
+
if attributes.key?(:disable_exact_on_attributes)
|
608
|
+
if (value = attributes[:disable_exact_on_attributes]).is_a?(Array)
|
609
|
+
self.disable_exact_on_attributes = value
|
610
|
+
end
|
611
|
+
end
|
612
|
+
|
613
|
+
if attributes.key?(:exact_on_single_word_query)
|
614
|
+
self.exact_on_single_word_query = attributes[:exact_on_single_word_query]
|
615
|
+
end
|
616
|
+
|
617
|
+
if attributes.key?(:alternatives_as_exact)
|
618
|
+
if (value = attributes[:alternatives_as_exact]).is_a?(Array)
|
619
|
+
self.alternatives_as_exact = value
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
if attributes.key?(:advanced_syntax_features)
|
624
|
+
if (value = attributes[:advanced_syntax_features]).is_a?(Array)
|
625
|
+
self.advanced_syntax_features = value
|
626
|
+
end
|
627
|
+
end
|
628
|
+
|
629
|
+
if attributes.key?(:distinct)
|
630
|
+
self.distinct = attributes[:distinct]
|
631
|
+
end
|
632
|
+
|
633
|
+
if attributes.key?(:replace_synonyms_in_highlight)
|
634
|
+
self.replace_synonyms_in_highlight = attributes[:replace_synonyms_in_highlight]
|
635
|
+
end
|
636
|
+
|
637
|
+
if attributes.key?(:min_proximity)
|
638
|
+
self.min_proximity = attributes[:min_proximity]
|
639
|
+
end
|
640
|
+
|
641
|
+
if attributes.key?(:response_fields)
|
642
|
+
if (value = attributes[:response_fields]).is_a?(Array)
|
643
|
+
self.response_fields = value
|
644
|
+
end
|
645
|
+
end
|
646
|
+
|
647
|
+
if attributes.key?(:max_facet_hits)
|
648
|
+
self.max_facet_hits = attributes[:max_facet_hits]
|
649
|
+
end
|
650
|
+
|
651
|
+
if attributes.key?(:max_values_per_facet)
|
652
|
+
self.max_values_per_facet = attributes[:max_values_per_facet]
|
653
|
+
end
|
654
|
+
|
655
|
+
if attributes.key?(:sort_facet_values_by)
|
656
|
+
self.sort_facet_values_by = attributes[:sort_facet_values_by]
|
657
|
+
end
|
658
|
+
|
659
|
+
if attributes.key?(:attribute_criteria_computed_by_min_proximity)
|
660
|
+
self.attribute_criteria_computed_by_min_proximity = attributes[:attribute_criteria_computed_by_min_proximity]
|
661
|
+
end
|
662
|
+
|
663
|
+
if attributes.key?(:rendering_content)
|
664
|
+
self.rendering_content = attributes[:rendering_content]
|
665
|
+
end
|
666
|
+
|
667
|
+
if attributes.key?(:enable_re_ranking)
|
668
|
+
self.enable_re_ranking = attributes[:enable_re_ranking]
|
669
|
+
end
|
670
|
+
|
671
|
+
if attributes.key?(:re_ranking_apply_filter)
|
672
|
+
self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
|
673
|
+
end
|
674
|
+
|
675
|
+
if attributes.key?(:primary)
|
676
|
+
self.primary = attributes[:primary]
|
677
|
+
end
|
678
|
+
end
|
679
|
+
|
680
|
+
# Custom attribute writer method with validation
|
681
|
+
# @param [Object] pagination_limited_to Value to be assigned
|
682
|
+
def pagination_limited_to=(pagination_limited_to)
|
683
|
+
if pagination_limited_to.nil?
|
684
|
+
raise ArgumentError, "pagination_limited_to cannot be nil"
|
685
|
+
end
|
686
|
+
|
687
|
+
if pagination_limited_to > 20000
|
688
|
+
raise ArgumentError, "invalid value for \"pagination_limited_to\", must be smaller than or equal to 20000."
|
689
|
+
end
|
690
|
+
|
691
|
+
@pagination_limited_to = pagination_limited_to
|
692
|
+
end
|
693
|
+
|
694
|
+
# Custom attribute writer method with validation
|
695
|
+
# @param [Object] hits_per_page Value to be assigned
|
696
|
+
def hits_per_page=(hits_per_page)
|
697
|
+
if hits_per_page.nil?
|
698
|
+
raise ArgumentError, "hits_per_page cannot be nil"
|
699
|
+
end
|
700
|
+
|
701
|
+
if hits_per_page > 1000
|
702
|
+
raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
|
703
|
+
end
|
704
|
+
|
705
|
+
if hits_per_page < 1
|
706
|
+
raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
|
707
|
+
end
|
708
|
+
|
709
|
+
@hits_per_page = hits_per_page
|
710
|
+
end
|
711
|
+
|
712
|
+
# Custom attribute writer method with validation
|
713
|
+
# @param [Object] min_proximity Value to be assigned
|
714
|
+
def min_proximity=(min_proximity)
|
715
|
+
if min_proximity.nil?
|
716
|
+
raise ArgumentError, "min_proximity cannot be nil"
|
717
|
+
end
|
718
|
+
|
719
|
+
if min_proximity > 7
|
720
|
+
raise ArgumentError, "invalid value for \"min_proximity\", must be smaller than or equal to 7."
|
721
|
+
end
|
722
|
+
|
723
|
+
if min_proximity < 1
|
724
|
+
raise ArgumentError, "invalid value for \"min_proximity\", must be greater than or equal to 1."
|
725
|
+
end
|
726
|
+
|
727
|
+
@min_proximity = min_proximity
|
728
|
+
end
|
729
|
+
|
730
|
+
# Custom attribute writer method with validation
|
731
|
+
# @param [Object] max_facet_hits Value to be assigned
|
732
|
+
def max_facet_hits=(max_facet_hits)
|
733
|
+
if max_facet_hits.nil?
|
734
|
+
raise ArgumentError, "max_facet_hits cannot be nil"
|
735
|
+
end
|
736
|
+
|
737
|
+
if max_facet_hits > 100
|
738
|
+
raise ArgumentError, "invalid value for \"max_facet_hits\", must be smaller than or equal to 100."
|
739
|
+
end
|
740
|
+
|
741
|
+
@max_facet_hits = max_facet_hits
|
742
|
+
end
|
743
|
+
|
744
|
+
# Custom attribute writer method with validation
|
745
|
+
# @param [Object] max_values_per_facet Value to be assigned
|
746
|
+
def max_values_per_facet=(max_values_per_facet)
|
747
|
+
if max_values_per_facet.nil?
|
748
|
+
raise ArgumentError, "max_values_per_facet cannot be nil"
|
749
|
+
end
|
750
|
+
|
751
|
+
if max_values_per_facet > 1000
|
752
|
+
raise ArgumentError, "invalid value for \"max_values_per_facet\", must be smaller than or equal to 1000."
|
753
|
+
end
|
754
|
+
|
755
|
+
@max_values_per_facet = max_values_per_facet
|
756
|
+
end
|
757
|
+
|
758
|
+
# Checks equality by comparing each attribute.
|
759
|
+
# @param [Object] Object to be compared
|
760
|
+
def ==(other)
|
761
|
+
return true if self.equal?(other)
|
762
|
+
self.class == other.class &&
|
763
|
+
attributes_for_faceting == other.attributes_for_faceting &&
|
764
|
+
replicas == other.replicas &&
|
765
|
+
pagination_limited_to == other.pagination_limited_to &&
|
766
|
+
unretrievable_attributes == other.unretrievable_attributes &&
|
767
|
+
disable_typo_tolerance_on_words == other.disable_typo_tolerance_on_words &&
|
768
|
+
attributes_to_transliterate == other.attributes_to_transliterate &&
|
769
|
+
camel_case_attributes == other.camel_case_attributes &&
|
770
|
+
decompounded_attributes == other.decompounded_attributes &&
|
771
|
+
index_languages == other.index_languages &&
|
772
|
+
disable_prefix_on_attributes == other.disable_prefix_on_attributes &&
|
773
|
+
allow_compression_of_integer_array == other.allow_compression_of_integer_array &&
|
774
|
+
numeric_attributes_for_filtering == other.numeric_attributes_for_filtering &&
|
775
|
+
separators_to_index == other.separators_to_index &&
|
776
|
+
searchable_attributes == other.searchable_attributes &&
|
777
|
+
user_data == other.user_data &&
|
778
|
+
custom_normalization == other.custom_normalization &&
|
779
|
+
attribute_for_distinct == other.attribute_for_distinct &&
|
780
|
+
attributes_to_retrieve == other.attributes_to_retrieve &&
|
781
|
+
ranking == other.ranking &&
|
782
|
+
custom_ranking == other.custom_ranking &&
|
783
|
+
relevancy_strictness == other.relevancy_strictness &&
|
784
|
+
attributes_to_highlight == other.attributes_to_highlight &&
|
785
|
+
attributes_to_snippet == other.attributes_to_snippet &&
|
786
|
+
highlight_pre_tag == other.highlight_pre_tag &&
|
787
|
+
highlight_post_tag == other.highlight_post_tag &&
|
788
|
+
snippet_ellipsis_text == other.snippet_ellipsis_text &&
|
789
|
+
restrict_highlight_and_snippet_arrays == other.restrict_highlight_and_snippet_arrays &&
|
790
|
+
hits_per_page == other.hits_per_page &&
|
791
|
+
min_word_sizefor1_typo == other.min_word_sizefor1_typo &&
|
792
|
+
min_word_sizefor2_typos == other.min_word_sizefor2_typos &&
|
793
|
+
typo_tolerance == other.typo_tolerance &&
|
794
|
+
allow_typos_on_numeric_tokens == other.allow_typos_on_numeric_tokens &&
|
795
|
+
disable_typo_tolerance_on_attributes == other.disable_typo_tolerance_on_attributes &&
|
796
|
+
ignore_plurals == other.ignore_plurals &&
|
797
|
+
remove_stop_words == other.remove_stop_words &&
|
798
|
+
keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
|
799
|
+
query_languages == other.query_languages &&
|
800
|
+
decompound_query == other.decompound_query &&
|
801
|
+
enable_rules == other.enable_rules &&
|
802
|
+
enable_personalization == other.enable_personalization &&
|
803
|
+
query_type == other.query_type &&
|
804
|
+
remove_words_if_no_results == other.remove_words_if_no_results &&
|
805
|
+
mode == other.mode &&
|
806
|
+
semantic_search == other.semantic_search &&
|
807
|
+
advanced_syntax == other.advanced_syntax &&
|
808
|
+
optional_words == other.optional_words &&
|
809
|
+
disable_exact_on_attributes == other.disable_exact_on_attributes &&
|
810
|
+
exact_on_single_word_query == other.exact_on_single_word_query &&
|
811
|
+
alternatives_as_exact == other.alternatives_as_exact &&
|
812
|
+
advanced_syntax_features == other.advanced_syntax_features &&
|
813
|
+
distinct == other.distinct &&
|
814
|
+
replace_synonyms_in_highlight == other.replace_synonyms_in_highlight &&
|
815
|
+
min_proximity == other.min_proximity &&
|
816
|
+
response_fields == other.response_fields &&
|
817
|
+
max_facet_hits == other.max_facet_hits &&
|
818
|
+
max_values_per_facet == other.max_values_per_facet &&
|
819
|
+
sort_facet_values_by == other.sort_facet_values_by &&
|
820
|
+
attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
|
821
|
+
rendering_content == other.rendering_content &&
|
822
|
+
enable_re_ranking == other.enable_re_ranking &&
|
823
|
+
re_ranking_apply_filter == other.re_ranking_apply_filter &&
|
824
|
+
primary == other.primary
|
825
|
+
end
|
826
|
+
|
827
|
+
# @see the `==` method
|
828
|
+
# @param [Object] Object to be compared
|
829
|
+
def eql?(other)
|
830
|
+
self == other
|
831
|
+
end
|
832
|
+
|
833
|
+
# Calculates hash code according to all attributes.
|
834
|
+
# @return [Integer] Hash code
|
835
|
+
def hash
|
836
|
+
[
|
837
|
+
attributes_for_faceting,
|
838
|
+
replicas,
|
839
|
+
pagination_limited_to,
|
840
|
+
unretrievable_attributes,
|
841
|
+
disable_typo_tolerance_on_words,
|
842
|
+
attributes_to_transliterate,
|
843
|
+
camel_case_attributes,
|
844
|
+
decompounded_attributes,
|
845
|
+
index_languages,
|
846
|
+
disable_prefix_on_attributes,
|
847
|
+
allow_compression_of_integer_array,
|
848
|
+
numeric_attributes_for_filtering,
|
849
|
+
separators_to_index,
|
850
|
+
searchable_attributes,
|
851
|
+
user_data,
|
852
|
+
custom_normalization,
|
853
|
+
attribute_for_distinct,
|
854
|
+
attributes_to_retrieve,
|
855
|
+
ranking,
|
856
|
+
custom_ranking,
|
857
|
+
relevancy_strictness,
|
858
|
+
attributes_to_highlight,
|
859
|
+
attributes_to_snippet,
|
860
|
+
highlight_pre_tag,
|
861
|
+
highlight_post_tag,
|
862
|
+
snippet_ellipsis_text,
|
863
|
+
restrict_highlight_and_snippet_arrays,
|
864
|
+
hits_per_page,
|
865
|
+
min_word_sizefor1_typo,
|
866
|
+
min_word_sizefor2_typos,
|
867
|
+
typo_tolerance,
|
868
|
+
allow_typos_on_numeric_tokens,
|
869
|
+
disable_typo_tolerance_on_attributes,
|
870
|
+
ignore_plurals,
|
871
|
+
remove_stop_words,
|
872
|
+
keep_diacritics_on_characters,
|
873
|
+
query_languages,
|
874
|
+
decompound_query,
|
875
|
+
enable_rules,
|
876
|
+
enable_personalization,
|
877
|
+
query_type,
|
878
|
+
remove_words_if_no_results,
|
879
|
+
mode,
|
880
|
+
semantic_search,
|
881
|
+
advanced_syntax,
|
882
|
+
optional_words,
|
883
|
+
disable_exact_on_attributes,
|
884
|
+
exact_on_single_word_query,
|
885
|
+
alternatives_as_exact,
|
886
|
+
advanced_syntax_features,
|
887
|
+
distinct,
|
888
|
+
replace_synonyms_in_highlight,
|
889
|
+
min_proximity,
|
890
|
+
response_fields,
|
891
|
+
max_facet_hits,
|
892
|
+
max_values_per_facet,
|
893
|
+
sort_facet_values_by,
|
894
|
+
attribute_criteria_computed_by_min_proximity,
|
895
|
+
rendering_content,
|
896
|
+
enable_re_ranking,
|
897
|
+
re_ranking_apply_filter,
|
898
|
+
primary
|
899
|
+
].hash
|
900
|
+
end
|
901
|
+
|
902
|
+
# Builds the object from hash
|
903
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
904
|
+
# @return [Object] Returns the model itself
|
905
|
+
def self.build_from_hash(attributes)
|
906
|
+
return nil unless attributes.is_a?(Hash)
|
907
|
+
attributes = attributes.transform_keys(&:to_sym)
|
908
|
+
transformed_hash = {}
|
909
|
+
types_mapping.each_pair do |key, type|
|
910
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
911
|
+
transformed_hash[key.to_sym] = nil
|
912
|
+
elsif type =~ /\AArray<(.*)>/i
|
913
|
+
# check to ensure the input is an array given that the attribute
|
914
|
+
# is documented as an array but the input is not
|
915
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
916
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
917
|
+
_deserialize(::Regexp.last_match(1), v)
|
918
|
+
}
|
919
|
+
end
|
920
|
+
elsif !attributes[attribute_map[key]].nil?
|
921
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
922
|
+
end
|
923
|
+
end
|
924
|
+
|
925
|
+
new(transformed_hash)
|
926
|
+
end
|
927
|
+
|
928
|
+
# Deserializes the data based on type
|
929
|
+
# @param string type Data type
|
930
|
+
# @param string value Value to be deserialized
|
931
|
+
# @return [Object] Deserialized data
|
932
|
+
def self._deserialize(type, value)
|
933
|
+
case type.to_sym
|
934
|
+
when :Time
|
935
|
+
Time.parse(value)
|
936
|
+
when :Date
|
937
|
+
Date.parse(value)
|
938
|
+
when :String
|
939
|
+
value.to_s
|
940
|
+
when :Integer
|
941
|
+
value.to_i
|
942
|
+
when :Float
|
943
|
+
value.to_f
|
944
|
+
when :Boolean
|
945
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
946
|
+
true
|
947
|
+
else
|
948
|
+
false
|
949
|
+
end
|
950
|
+
|
951
|
+
when :Object
|
952
|
+
# generic object (usually a Hash), return directly
|
953
|
+
value
|
954
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
955
|
+
inner_type = Regexp.last_match[:inner_type]
|
956
|
+
value.map { |v| _deserialize(inner_type, v) }
|
957
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
958
|
+
k_type = Regexp.last_match[:k_type]
|
959
|
+
v_type = Regexp.last_match[:v_type]
|
960
|
+
{}.tap do |hash|
|
961
|
+
value.each do |k, v|
|
962
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
963
|
+
end
|
964
|
+
end
|
965
|
+
# model
|
966
|
+
else
|
967
|
+
# models (e.g. Pet) or oneOf
|
968
|
+
klass = Algolia::Search.const_get(type)
|
969
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
970
|
+
.build_from_hash(value)
|
971
|
+
end
|
972
|
+
end
|
973
|
+
|
974
|
+
# Returns the string representation of the object
|
975
|
+
# @return [String] String presentation of the object
|
976
|
+
def to_s
|
977
|
+
to_hash.to_s
|
978
|
+
end
|
979
|
+
|
980
|
+
# to_body is an alias to to_hash (backward compatibility)
|
981
|
+
# @return [Hash] Returns the object in the form of hash
|
982
|
+
def to_body
|
983
|
+
to_hash
|
984
|
+
end
|
985
|
+
|
986
|
+
def to_json(*_args)
|
987
|
+
to_hash.to_json
|
988
|
+
end
|
989
|
+
|
990
|
+
# Returns the object in the form of hash
|
991
|
+
# @return [Hash] Returns the object in the form of hash
|
992
|
+
def to_hash
|
993
|
+
hash = {}
|
994
|
+
self.class.attribute_map.each_pair do |attr, param|
|
995
|
+
value = send(attr)
|
996
|
+
if value.nil?
|
997
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
998
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
999
|
+
end
|
1000
|
+
|
1001
|
+
hash[param] = _to_hash(value)
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
hash
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
# Outputs non-array value in the form of hash
|
1008
|
+
# For object, use to_hash. Otherwise, just return the value
|
1009
|
+
# @param [Object] value Any valid value
|
1010
|
+
# @return [Hash] Returns the value in the form of hash
|
1011
|
+
def _to_hash(value)
|
1012
|
+
if value.is_a?(Array)
|
1013
|
+
value.compact.map { |v| _to_hash(v) }
|
1014
|
+
elsif value.is_a?(Hash)
|
1015
|
+
{}.tap do |hash|
|
1016
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
1017
|
+
end
|
1018
|
+
elsif value.respond_to?(:to_hash)
|
1019
|
+
value.to_hash
|
1020
|
+
else
|
1021
|
+
value
|
1022
|
+
end
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
end
|
1028
|
+
end
|