algolia 3.3.2 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,10 +5,8 @@ require "time"
5
5
 
6
6
  module Algolia
7
7
  module Recommend
8
- class SearchParams
9
- # Search query.
10
- attr_accessor :query
11
-
8
+ # Search parameters for filtering the recommendations.
9
+ class RecommendSearchParams
12
10
  # 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
11
  attr_accessor :similar_query
14
12
 
@@ -35,15 +33,6 @@ module Algolia
35
33
  # Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
36
34
  attr_accessor :faceting_after_distinct
37
35
 
38
- # Page of search results to retrieve.
39
- attr_accessor :page
40
-
41
- # Position of the first hit to retrieve.
42
- attr_accessor :offset
43
-
44
- # Number of hits to retrieve (used in combination with `offset`).
45
- attr_accessor :length
46
-
47
36
  # Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
48
37
  attr_accessor :around_lat_lng
49
38
 
@@ -96,15 +85,66 @@ module Algolia
96
85
  # Whether to enable A/B testing for this search.
97
86
  attr_accessor :enable_ab_test
98
87
 
88
+ # Search query.
89
+ attr_accessor :query
90
+
91
+ # 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))`.
92
+ attr_accessor :attributes_for_faceting
93
+
94
+ # 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/).
95
+ attr_accessor :replicas
96
+
97
+ # 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.
98
+ attr_accessor :pagination_limited_to
99
+
100
+ # 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.
101
+ attr_accessor :unretrievable_attributes
102
+
103
+ # 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.
104
+ attr_accessor :disable_typo_tolerance_on_words
105
+
106
+ # 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.
107
+ attr_accessor :attributes_to_transliterate
108
+
109
+ # Attributes for which to split [camel case](https://wikipedia.org/wiki/Camel_case) words. Attribute names are case-sensitive.
110
+ attr_accessor :camel_case_attributes
111
+
112
+ # 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`). Decompounding doesn't work for words with [non-spacing mark Unicode characters](https://www.charactercodes.net/category/non-spacing_mark). For example, `Gartenstühle` won't be decompounded if the `ü` consists of `u` (U+0075) and `◌̈` (U+0308).
113
+ attr_accessor :decompounded_attributes
114
+
115
+ # 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/).
116
+ attr_accessor :index_languages
117
+
118
+ # 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.
119
+ attr_accessor :disable_prefix_on_attributes
120
+
121
+ # Whether arrays with exclusively non-negative integers should be compressed for better performance. If true, the compressed arrays may be reordered.
122
+ attr_accessor :allow_compression_of_integer_array
123
+
124
+ # 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 `!=`.
125
+ attr_accessor :numeric_attributes_for_filtering
126
+
127
+ # 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.
128
+ attr_accessor :separators_to_index
129
+
130
+ # 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.
131
+ attr_accessor :searchable_attributes
132
+
133
+ # An object with custom data. You can store up to 32kB as custom data.
134
+ attr_accessor :user_data
135
+
136
+ # 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/).
137
+ attr_accessor :custom_normalization
138
+
139
+ # 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.
140
+ attr_accessor :attribute_for_distinct
141
+
99
142
  # 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
143
  attr_accessor :attributes_to_retrieve
101
144
 
102
145
  # 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
146
  attr_accessor :ranking
104
147
 
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.
106
- attr_accessor :custom_ranking
107
-
108
148
  # 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
149
  attr_accessor :relevancy_strictness
110
150
 
@@ -126,9 +166,6 @@ module Algolia
126
166
  # Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted.
127
167
  attr_accessor :restrict_highlight_and_snippet_arrays
128
168
 
129
- # Number of hits per page.
130
- attr_accessor :hits_per_page
131
-
132
169
  # 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).
133
170
  attr_accessor :min_word_sizefor1_typo
134
171
 
@@ -147,9 +184,6 @@ module Algolia
147
184
 
148
185
  attr_accessor :remove_stop_words
149
186
 
150
- # 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.
151
- attr_accessor :keep_diacritics_on_characters
152
-
153
187
  # 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/).
154
188
  attr_accessor :query_languages
155
189
 
@@ -166,10 +200,6 @@ module Algolia
166
200
 
167
201
  attr_accessor :remove_words_if_no_results
168
202
 
169
- attr_accessor :mode
170
-
171
- attr_accessor :semantic_search
172
-
173
203
  # Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
174
204
  attr_accessor :advanced_syntax
175
205
 
@@ -220,7 +250,6 @@ module Algolia
220
250
  # Attribute mapping from ruby-style variable name to JSON key.
221
251
  def self.attribute_map
222
252
  {
223
- :query => :query,
224
253
  :similar_query => :similarQuery,
225
254
  :filters => :filters,
226
255
  :facet_filters => :facetFilters,
@@ -231,9 +260,6 @@ module Algolia
231
260
  :restrict_searchable_attributes => :restrictSearchableAttributes,
232
261
  :facets => :facets,
233
262
  :faceting_after_distinct => :facetingAfterDistinct,
234
- :page => :page,
235
- :offset => :offset,
236
- :length => :length,
237
263
  :around_lat_lng => :aroundLatLng,
238
264
  :around_lat_lng_via_ip => :aroundLatLngViaIP,
239
265
  :around_radius => :aroundRadius,
@@ -252,9 +278,26 @@ module Algolia
252
278
  :analytics_tags => :analyticsTags,
253
279
  :percentile_computation => :percentileComputation,
254
280
  :enable_ab_test => :enableABTest,
281
+ :query => :query,
282
+ :attributes_for_faceting => :attributesForFaceting,
283
+ :replicas => :replicas,
284
+ :pagination_limited_to => :paginationLimitedTo,
285
+ :unretrievable_attributes => :unretrievableAttributes,
286
+ :disable_typo_tolerance_on_words => :disableTypoToleranceOnWords,
287
+ :attributes_to_transliterate => :attributesToTransliterate,
288
+ :camel_case_attributes => :camelCaseAttributes,
289
+ :decompounded_attributes => :decompoundedAttributes,
290
+ :index_languages => :indexLanguages,
291
+ :disable_prefix_on_attributes => :disablePrefixOnAttributes,
292
+ :allow_compression_of_integer_array => :allowCompressionOfIntegerArray,
293
+ :numeric_attributes_for_filtering => :numericAttributesForFiltering,
294
+ :separators_to_index => :separatorsToIndex,
295
+ :searchable_attributes => :searchableAttributes,
296
+ :user_data => :userData,
297
+ :custom_normalization => :customNormalization,
298
+ :attribute_for_distinct => :attributeForDistinct,
255
299
  :attributes_to_retrieve => :attributesToRetrieve,
256
300
  :ranking => :ranking,
257
- :custom_ranking => :customRanking,
258
301
  :relevancy_strictness => :relevancyStrictness,
259
302
  :attributes_to_highlight => :attributesToHighlight,
260
303
  :attributes_to_snippet => :attributesToSnippet,
@@ -262,7 +305,6 @@ module Algolia
262
305
  :highlight_post_tag => :highlightPostTag,
263
306
  :snippet_ellipsis_text => :snippetEllipsisText,
264
307
  :restrict_highlight_and_snippet_arrays => :restrictHighlightAndSnippetArrays,
265
- :hits_per_page => :hitsPerPage,
266
308
  :min_word_sizefor1_typo => :minWordSizefor1Typo,
267
309
  :min_word_sizefor2_typos => :minWordSizefor2Typos,
268
310
  :typo_tolerance => :typoTolerance,
@@ -270,15 +312,12 @@ module Algolia
270
312
  :disable_typo_tolerance_on_attributes => :disableTypoToleranceOnAttributes,
271
313
  :ignore_plurals => :ignorePlurals,
272
314
  :remove_stop_words => :removeStopWords,
273
- :keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
274
315
  :query_languages => :queryLanguages,
275
316
  :decompound_query => :decompoundQuery,
276
317
  :enable_rules => :enableRules,
277
318
  :enable_personalization => :enablePersonalization,
278
319
  :query_type => :queryType,
279
320
  :remove_words_if_no_results => :removeWordsIfNoResults,
280
- :mode => :mode,
281
- :semantic_search => :semanticSearch,
282
321
  :advanced_syntax => :advancedSyntax,
283
322
  :optional_words => :optionalWords,
284
323
  :disable_exact_on_attributes => :disableExactOnAttributes,
@@ -307,7 +346,6 @@ module Algolia
307
346
  # Attribute type mapping.
308
347
  def self.types_mapping
309
348
  {
310
- :query => :"String",
311
349
  :similar_query => :"String",
312
350
  :filters => :"String",
313
351
  :facet_filters => :"FacetFilters",
@@ -318,9 +356,6 @@ module Algolia
318
356
  :restrict_searchable_attributes => :"Array<String>",
319
357
  :facets => :"Array<String>",
320
358
  :faceting_after_distinct => :"Boolean",
321
- :page => :"Integer",
322
- :offset => :"Integer",
323
- :length => :"Integer",
324
359
  :around_lat_lng => :"String",
325
360
  :around_lat_lng_via_ip => :"Boolean",
326
361
  :around_radius => :"AroundRadius",
@@ -339,9 +374,26 @@ module Algolia
339
374
  :analytics_tags => :"Array<String>",
340
375
  :percentile_computation => :"Boolean",
341
376
  :enable_ab_test => :"Boolean",
377
+ :query => :"String",
378
+ :attributes_for_faceting => :"Array<String>",
379
+ :replicas => :"Array<String>",
380
+ :pagination_limited_to => :"Integer",
381
+ :unretrievable_attributes => :"Array<String>",
382
+ :disable_typo_tolerance_on_words => :"Array<String>",
383
+ :attributes_to_transliterate => :"Array<String>",
384
+ :camel_case_attributes => :"Array<String>",
385
+ :decompounded_attributes => :"Object",
386
+ :index_languages => :"Array<SupportedLanguage>",
387
+ :disable_prefix_on_attributes => :"Array<String>",
388
+ :allow_compression_of_integer_array => :"Boolean",
389
+ :numeric_attributes_for_filtering => :"Array<String>",
390
+ :separators_to_index => :"String",
391
+ :searchable_attributes => :"Array<String>",
392
+ :user_data => :"Object",
393
+ :custom_normalization => :"Hash<String, Hash<String, String>>",
394
+ :attribute_for_distinct => :"String",
342
395
  :attributes_to_retrieve => :"Array<String>",
343
396
  :ranking => :"Array<String>",
344
- :custom_ranking => :"Array<String>",
345
397
  :relevancy_strictness => :"Integer",
346
398
  :attributes_to_highlight => :"Array<String>",
347
399
  :attributes_to_snippet => :"Array<String>",
@@ -349,7 +401,6 @@ module Algolia
349
401
  :highlight_post_tag => :"String",
350
402
  :snippet_ellipsis_text => :"String",
351
403
  :restrict_highlight_and_snippet_arrays => :"Boolean",
352
- :hits_per_page => :"Integer",
353
404
  :min_word_sizefor1_typo => :"Integer",
354
405
  :min_word_sizefor2_typos => :"Integer",
355
406
  :typo_tolerance => :"TypoTolerance",
@@ -357,15 +408,12 @@ module Algolia
357
408
  :disable_typo_tolerance_on_attributes => :"Array<String>",
358
409
  :ignore_plurals => :"IgnorePlurals",
359
410
  :remove_stop_words => :"RemoveStopWords",
360
- :keep_diacritics_on_characters => :"String",
361
411
  :query_languages => :"Array<SupportedLanguage>",
362
412
  :decompound_query => :"Boolean",
363
413
  :enable_rules => :"Boolean",
364
414
  :enable_personalization => :"Boolean",
365
415
  :query_type => :"QueryType",
366
416
  :remove_words_if_no_results => :"RemoveWordsIfNoResults",
367
- :mode => :"Mode",
368
- :semantic_search => :"SemanticSearch",
369
417
  :advanced_syntax => :"Boolean",
370
418
  :optional_words => :"Array<String>",
371
419
  :disable_exact_on_attributes => :"Array<String>",
@@ -396,7 +444,9 @@ module Algolia
396
444
  # List of class defined in allOf (OpenAPI v3)
397
445
  def self.openapi_all_of
398
446
  [
399
- :"SearchParamsObject"
447
+ :"BaseRecommendSearchParams",
448
+ :"RecommendIndexSettings",
449
+ :"SearchParamsQuery"
400
450
  ]
401
451
  end
402
452
 
@@ -406,7 +456,7 @@ module Algolia
406
456
  if (!attributes.is_a?(Hash))
407
457
  raise(
408
458
  ArgumentError,
409
- "The input argument (attributes) must be a hash in `Algolia::SearchParams` initialize method"
459
+ "The input argument (attributes) must be a hash in `Algolia::RecommendSearchParams` initialize method"
410
460
  )
411
461
  end
412
462
 
@@ -415,7 +465,7 @@ module Algolia
415
465
  if (!self.class.attribute_map.key?(k.to_sym))
416
466
  raise(
417
467
  ArgumentError,
418
- "`#{k}` is not a valid attribute in `Algolia::SearchParams`. Please check the name to make sure it's valid. List of attributes: " +
468
+ "`#{k}` is not a valid attribute in `Algolia::RecommendSearchParams`. Please check the name to make sure it's valid. List of attributes: " +
419
469
  self.class.attribute_map.keys.inspect
420
470
  )
421
471
  end
@@ -423,10 +473,6 @@ module Algolia
423
473
  h[k.to_sym] = v
424
474
  }
425
475
 
426
- if attributes.key?(:query)
427
- self.query = attributes[:query]
428
- end
429
-
430
476
  if attributes.key?(:similar_query)
431
477
  self.similar_query = attributes[:similar_query]
432
478
  end
@@ -471,18 +517,6 @@ module Algolia
471
517
  self.faceting_after_distinct = attributes[:faceting_after_distinct]
472
518
  end
473
519
 
474
- if attributes.key?(:page)
475
- self.page = attributes[:page]
476
- end
477
-
478
- if attributes.key?(:offset)
479
- self.offset = attributes[:offset]
480
- end
481
-
482
- if attributes.key?(:length)
483
- self.length = attributes[:length]
484
- end
485
-
486
520
  if attributes.key?(:around_lat_lng)
487
521
  self.around_lat_lng = attributes[:around_lat_lng]
488
522
  end
@@ -565,6 +599,100 @@ module Algolia
565
599
  self.enable_ab_test = attributes[:enable_ab_test]
566
600
  end
567
601
 
602
+ if attributes.key?(:query)
603
+ self.query = attributes[:query]
604
+ end
605
+
606
+ if attributes.key?(:attributes_for_faceting)
607
+ if (value = attributes[:attributes_for_faceting]).is_a?(Array)
608
+ self.attributes_for_faceting = value
609
+ end
610
+ end
611
+
612
+ if attributes.key?(:replicas)
613
+ if (value = attributes[:replicas]).is_a?(Array)
614
+ self.replicas = value
615
+ end
616
+ end
617
+
618
+ if attributes.key?(:pagination_limited_to)
619
+ self.pagination_limited_to = attributes[:pagination_limited_to]
620
+ end
621
+
622
+ if attributes.key?(:unretrievable_attributes)
623
+ if (value = attributes[:unretrievable_attributes]).is_a?(Array)
624
+ self.unretrievable_attributes = value
625
+ end
626
+ end
627
+
628
+ if attributes.key?(:disable_typo_tolerance_on_words)
629
+ if (value = attributes[:disable_typo_tolerance_on_words]).is_a?(Array)
630
+ self.disable_typo_tolerance_on_words = value
631
+ end
632
+ end
633
+
634
+ if attributes.key?(:attributes_to_transliterate)
635
+ if (value = attributes[:attributes_to_transliterate]).is_a?(Array)
636
+ self.attributes_to_transliterate = value
637
+ end
638
+ end
639
+
640
+ if attributes.key?(:camel_case_attributes)
641
+ if (value = attributes[:camel_case_attributes]).is_a?(Array)
642
+ self.camel_case_attributes = value
643
+ end
644
+ end
645
+
646
+ if attributes.key?(:decompounded_attributes)
647
+ self.decompounded_attributes = attributes[:decompounded_attributes]
648
+ end
649
+
650
+ if attributes.key?(:index_languages)
651
+ if (value = attributes[:index_languages]).is_a?(Array)
652
+ self.index_languages = value
653
+ end
654
+ end
655
+
656
+ if attributes.key?(:disable_prefix_on_attributes)
657
+ if (value = attributes[:disable_prefix_on_attributes]).is_a?(Array)
658
+ self.disable_prefix_on_attributes = value
659
+ end
660
+ end
661
+
662
+ if attributes.key?(:allow_compression_of_integer_array)
663
+ self.allow_compression_of_integer_array = attributes[:allow_compression_of_integer_array]
664
+ end
665
+
666
+ if attributes.key?(:numeric_attributes_for_filtering)
667
+ if (value = attributes[:numeric_attributes_for_filtering]).is_a?(Array)
668
+ self.numeric_attributes_for_filtering = value
669
+ end
670
+ end
671
+
672
+ if attributes.key?(:separators_to_index)
673
+ self.separators_to_index = attributes[:separators_to_index]
674
+ end
675
+
676
+ if attributes.key?(:searchable_attributes)
677
+ if (value = attributes[:searchable_attributes]).is_a?(Array)
678
+ self.searchable_attributes = value
679
+ end
680
+ end
681
+
682
+ if attributes.key?(:user_data)
683
+ self.user_data = attributes[:user_data]
684
+ end
685
+
686
+ if attributes.key?(:custom_normalization)
687
+ if (value = attributes[:custom_normalization]).is_a?(Hash)
688
+ self.custom_normalization = value
689
+ end
690
+ end
691
+
692
+ if attributes.key?(:attribute_for_distinct)
693
+ self.attribute_for_distinct = attributes[:attribute_for_distinct]
694
+ end
695
+
568
696
  if attributes.key?(:attributes_to_retrieve)
569
697
  if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
570
698
  self.attributes_to_retrieve = value
@@ -577,12 +705,6 @@ module Algolia
577
705
  end
578
706
  end
579
707
 
580
- if attributes.key?(:custom_ranking)
581
- if (value = attributes[:custom_ranking]).is_a?(Array)
582
- self.custom_ranking = value
583
- end
584
- end
585
-
586
708
  if attributes.key?(:relevancy_strictness)
587
709
  self.relevancy_strictness = attributes[:relevancy_strictness]
588
710
  end
@@ -615,10 +737,6 @@ module Algolia
615
737
  self.restrict_highlight_and_snippet_arrays = attributes[:restrict_highlight_and_snippet_arrays]
616
738
  end
617
739
 
618
- if attributes.key?(:hits_per_page)
619
- self.hits_per_page = attributes[:hits_per_page]
620
- end
621
-
622
740
  if attributes.key?(:min_word_sizefor1_typo)
623
741
  self.min_word_sizefor1_typo = attributes[:min_word_sizefor1_typo]
624
742
  end
@@ -649,10 +767,6 @@ module Algolia
649
767
  self.remove_stop_words = attributes[:remove_stop_words]
650
768
  end
651
769
 
652
- if attributes.key?(:keep_diacritics_on_characters)
653
- self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
654
- end
655
-
656
770
  if attributes.key?(:query_languages)
657
771
  if (value = attributes[:query_languages]).is_a?(Array)
658
772
  self.query_languages = value
@@ -679,14 +793,6 @@ module Algolia
679
793
  self.remove_words_if_no_results = attributes[:remove_words_if_no_results]
680
794
  end
681
795
 
682
- if attributes.key?(:mode)
683
- self.mode = attributes[:mode]
684
- end
685
-
686
- if attributes.key?(:semantic_search)
687
- self.semantic_search = attributes[:semantic_search]
688
- end
689
-
690
796
  if attributes.key?(:advanced_syntax)
691
797
  self.advanced_syntax = attributes[:advanced_syntax]
692
798
  end
@@ -766,38 +872,6 @@ module Algolia
766
872
  end
767
873
  end
768
874
 
769
- # Custom attribute writer method with validation
770
- # @param [Object] page Value to be assigned
771
- def page=(page)
772
- if page.nil?
773
- raise ArgumentError, "page cannot be nil"
774
- end
775
-
776
- if page < 0
777
- raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
778
- end
779
-
780
- @page = page
781
- end
782
-
783
- # Custom attribute writer method with validation
784
- # @param [Object] length Value to be assigned
785
- def length=(length)
786
- if length.nil?
787
- raise ArgumentError, "length cannot be nil"
788
- end
789
-
790
- if length > 1000
791
- raise ArgumentError, "invalid value for \"length\", must be smaller than or equal to 1000."
792
- end
793
-
794
- if length < 0
795
- raise ArgumentError, "invalid value for \"length\", must be greater than or equal to 0."
796
- end
797
-
798
- @length = length
799
- end
800
-
801
875
  # Custom attribute writer method with validation
802
876
  # @param [Object] minimum_around_radius Value to be assigned
803
877
  def minimum_around_radius=(minimum_around_radius)
@@ -831,21 +905,17 @@ module Algolia
831
905
  end
832
906
 
833
907
  # Custom attribute writer method with validation
834
- # @param [Object] hits_per_page Value to be assigned
835
- def hits_per_page=(hits_per_page)
836
- if hits_per_page.nil?
837
- raise ArgumentError, "hits_per_page cannot be nil"
838
- end
839
-
840
- if hits_per_page > 1000
841
- raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
908
+ # @param [Object] pagination_limited_to Value to be assigned
909
+ def pagination_limited_to=(pagination_limited_to)
910
+ if pagination_limited_to.nil?
911
+ raise ArgumentError, "pagination_limited_to cannot be nil"
842
912
  end
843
913
 
844
- if hits_per_page < 1
845
- raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
914
+ if pagination_limited_to > 20000
915
+ raise ArgumentError, "invalid value for \"pagination_limited_to\", must be smaller than or equal to 20000."
846
916
  end
847
917
 
848
- @hits_per_page = hits_per_page
918
+ @pagination_limited_to = pagination_limited_to
849
919
  end
850
920
 
851
921
  # Custom attribute writer method with validation
@@ -899,7 +969,6 @@ module Algolia
899
969
  def ==(other)
900
970
  return true if self.equal?(other)
901
971
  self.class == other.class &&
902
- query == other.query &&
903
972
  similar_query == other.similar_query &&
904
973
  filters == other.filters &&
905
974
  facet_filters == other.facet_filters &&
@@ -910,9 +979,6 @@ module Algolia
910
979
  restrict_searchable_attributes == other.restrict_searchable_attributes &&
911
980
  facets == other.facets &&
912
981
  faceting_after_distinct == other.faceting_after_distinct &&
913
- page == other.page &&
914
- offset == other.offset &&
915
- length == other.length &&
916
982
  around_lat_lng == other.around_lat_lng &&
917
983
  around_lat_lng_via_ip == other.around_lat_lng_via_ip &&
918
984
  around_radius == other.around_radius &&
@@ -931,9 +997,26 @@ module Algolia
931
997
  analytics_tags == other.analytics_tags &&
932
998
  percentile_computation == other.percentile_computation &&
933
999
  enable_ab_test == other.enable_ab_test &&
1000
+ query == other.query &&
1001
+ attributes_for_faceting == other.attributes_for_faceting &&
1002
+ replicas == other.replicas &&
1003
+ pagination_limited_to == other.pagination_limited_to &&
1004
+ unretrievable_attributes == other.unretrievable_attributes &&
1005
+ disable_typo_tolerance_on_words == other.disable_typo_tolerance_on_words &&
1006
+ attributes_to_transliterate == other.attributes_to_transliterate &&
1007
+ camel_case_attributes == other.camel_case_attributes &&
1008
+ decompounded_attributes == other.decompounded_attributes &&
1009
+ index_languages == other.index_languages &&
1010
+ disable_prefix_on_attributes == other.disable_prefix_on_attributes &&
1011
+ allow_compression_of_integer_array == other.allow_compression_of_integer_array &&
1012
+ numeric_attributes_for_filtering == other.numeric_attributes_for_filtering &&
1013
+ separators_to_index == other.separators_to_index &&
1014
+ searchable_attributes == other.searchable_attributes &&
1015
+ user_data == other.user_data &&
1016
+ custom_normalization == other.custom_normalization &&
1017
+ attribute_for_distinct == other.attribute_for_distinct &&
934
1018
  attributes_to_retrieve == other.attributes_to_retrieve &&
935
1019
  ranking == other.ranking &&
936
- custom_ranking == other.custom_ranking &&
937
1020
  relevancy_strictness == other.relevancy_strictness &&
938
1021
  attributes_to_highlight == other.attributes_to_highlight &&
939
1022
  attributes_to_snippet == other.attributes_to_snippet &&
@@ -941,7 +1024,6 @@ module Algolia
941
1024
  highlight_post_tag == other.highlight_post_tag &&
942
1025
  snippet_ellipsis_text == other.snippet_ellipsis_text &&
943
1026
  restrict_highlight_and_snippet_arrays == other.restrict_highlight_and_snippet_arrays &&
944
- hits_per_page == other.hits_per_page &&
945
1027
  min_word_sizefor1_typo == other.min_word_sizefor1_typo &&
946
1028
  min_word_sizefor2_typos == other.min_word_sizefor2_typos &&
947
1029
  typo_tolerance == other.typo_tolerance &&
@@ -949,15 +1031,12 @@ module Algolia
949
1031
  disable_typo_tolerance_on_attributes == other.disable_typo_tolerance_on_attributes &&
950
1032
  ignore_plurals == other.ignore_plurals &&
951
1033
  remove_stop_words == other.remove_stop_words &&
952
- keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
953
1034
  query_languages == other.query_languages &&
954
1035
  decompound_query == other.decompound_query &&
955
1036
  enable_rules == other.enable_rules &&
956
1037
  enable_personalization == other.enable_personalization &&
957
1038
  query_type == other.query_type &&
958
1039
  remove_words_if_no_results == other.remove_words_if_no_results &&
959
- mode == other.mode &&
960
- semantic_search == other.semantic_search &&
961
1040
  advanced_syntax == other.advanced_syntax &&
962
1041
  optional_words == other.optional_words &&
963
1042
  disable_exact_on_attributes == other.disable_exact_on_attributes &&
@@ -987,7 +1066,6 @@ module Algolia
987
1066
  # @return [Integer] Hash code
988
1067
  def hash
989
1068
  [
990
- query,
991
1069
  similar_query,
992
1070
  filters,
993
1071
  facet_filters,
@@ -998,9 +1076,6 @@ module Algolia
998
1076
  restrict_searchable_attributes,
999
1077
  facets,
1000
1078
  faceting_after_distinct,
1001
- page,
1002
- offset,
1003
- length,
1004
1079
  around_lat_lng,
1005
1080
  around_lat_lng_via_ip,
1006
1081
  around_radius,
@@ -1019,9 +1094,26 @@ module Algolia
1019
1094
  analytics_tags,
1020
1095
  percentile_computation,
1021
1096
  enable_ab_test,
1097
+ query,
1098
+ attributes_for_faceting,
1099
+ replicas,
1100
+ pagination_limited_to,
1101
+ unretrievable_attributes,
1102
+ disable_typo_tolerance_on_words,
1103
+ attributes_to_transliterate,
1104
+ camel_case_attributes,
1105
+ decompounded_attributes,
1106
+ index_languages,
1107
+ disable_prefix_on_attributes,
1108
+ allow_compression_of_integer_array,
1109
+ numeric_attributes_for_filtering,
1110
+ separators_to_index,
1111
+ searchable_attributes,
1112
+ user_data,
1113
+ custom_normalization,
1114
+ attribute_for_distinct,
1022
1115
  attributes_to_retrieve,
1023
1116
  ranking,
1024
- custom_ranking,
1025
1117
  relevancy_strictness,
1026
1118
  attributes_to_highlight,
1027
1119
  attributes_to_snippet,
@@ -1029,7 +1121,6 @@ module Algolia
1029
1121
  highlight_post_tag,
1030
1122
  snippet_ellipsis_text,
1031
1123
  restrict_highlight_and_snippet_arrays,
1032
- hits_per_page,
1033
1124
  min_word_sizefor1_typo,
1034
1125
  min_word_sizefor2_typos,
1035
1126
  typo_tolerance,
@@ -1037,15 +1128,12 @@ module Algolia
1037
1128
  disable_typo_tolerance_on_attributes,
1038
1129
  ignore_plurals,
1039
1130
  remove_stop_words,
1040
- keep_diacritics_on_characters,
1041
1131
  query_languages,
1042
1132
  decompound_query,
1043
1133
  enable_rules,
1044
1134
  enable_personalization,
1045
1135
  query_type,
1046
1136
  remove_words_if_no_results,
1047
- mode,
1048
- semantic_search,
1049
1137
  advanced_syntax,
1050
1138
  optional_words,
1051
1139
  disable_exact_on_attributes,