algolia 2.3.4 → 3.0.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -93
- data/Gemfile +1 -14
- data/Gemfile.lock +64 -0
- data/README.md +4 -6
- data/Rakefile +0 -39
- data/algolia.gemspec +24 -39
- data/lib/algolia/api/abtesting_client.rb +418 -0
- data/lib/algolia/api/analytics_client.rb +1294 -0
- data/lib/algolia/api/ingestion_client.rb +1659 -0
- data/lib/algolia/api/insights_client.rb +252 -0
- data/lib/algolia/api/monitoring_client.rb +555 -0
- data/lib/algolia/api/personalization_client.rb +365 -0
- data/lib/algolia/api/query_suggestions_client.rb +491 -0
- data/lib/algolia/api/recommend_client.rb +460 -0
- data/lib/algolia/api/search_client.rb +2723 -0
- data/lib/algolia/api_client.rb +153 -0
- data/lib/algolia/api_error.rb +48 -0
- data/lib/algolia/configuration.rb +41 -0
- data/lib/algolia/logger_helper.rb +1 -1
- data/lib/algolia/models/abtesting/ab_test.rb +332 -0
- data/lib/algolia/models/abtesting/ab_test_response.rb +219 -0
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +217 -0
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +236 -0
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +239 -0
- data/lib/algolia/models/abtesting/add_ab_tests_variant.rb +96 -0
- data/lib/algolia/models/abtesting/currencies_value.rb +223 -0
- data/lib/algolia/models/abtesting/custom_search_params.rb +195 -0
- data/lib/algolia/models/abtesting/error_base.rb +196 -0
- data/lib/algolia/models/abtesting/filter_effects.rb +202 -0
- data/lib/algolia/models/abtesting/filter_effects_empty_search.rb +204 -0
- data/lib/algolia/models/abtesting/filter_effects_outliers.rb +204 -0
- data/lib/algolia/models/abtesting/list_ab_tests_response.rb +221 -0
- data/lib/algolia/models/abtesting/variant.rb +399 -0
- data/lib/algolia/models/analytics/average_click_event.rb +219 -0
- data/lib/algolia/models/analytics/click_position.rb +209 -0
- data/lib/algolia/models/analytics/click_through_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/conversion_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/direction.rb +33 -0
- data/lib/algolia/models/analytics/error_base.rb +196 -0
- data/lib/algolia/models/analytics/get_average_click_position_response.rb +221 -0
- data/lib/algolia/models/analytics/get_click_positions_response.rb +215 -0
- data/lib/algolia/models/analytics/get_click_through_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_conversation_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_no_click_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_no_results_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_searches_count_response.rb +209 -0
- data/lib/algolia/models/analytics/get_searches_no_clicks_response.rb +197 -0
- data/lib/algolia/models/analytics/get_searches_no_results_response.rb +197 -0
- data/lib/algolia/models/analytics/get_status_response.rb +195 -0
- data/lib/algolia/models/analytics/get_top_countries_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filter_attribute.rb +207 -0
- data/lib/algolia/models/analytics/get_top_filter_attributes_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filter_for_attribute.rb +231 -0
- data/lib/algolia/models/analytics/get_top_filter_for_attribute_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filters_no_results_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filters_no_results_value.rb +219 -0
- data/lib/algolia/models/analytics/get_top_filters_no_results_values.rb +209 -0
- data/lib/algolia/models/analytics/get_top_hits_response.rb +96 -0
- data/lib/algolia/models/analytics/get_top_searches_response.rb +96 -0
- data/lib/algolia/models/analytics/get_users_count_response.rb +209 -0
- data/lib/algolia/models/analytics/no_click_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/no_results_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/order_by.rb +35 -0
- data/lib/algolia/models/analytics/search_event.rb +207 -0
- data/lib/algolia/models/analytics/search_no_click_event.rb +219 -0
- data/lib/algolia/models/analytics/search_no_result_event.rb +219 -0
- data/lib/algolia/models/analytics/top_country.rb +207 -0
- data/lib/algolia/models/analytics/top_hit.rb +207 -0
- data/lib/algolia/models/analytics/top_hit_with_analytics.rb +285 -0
- data/lib/algolia/models/analytics/top_hits_response.rb +197 -0
- data/lib/algolia/models/analytics/top_hits_response_with_analytics.rb +197 -0
- data/lib/algolia/models/analytics/top_search.rb +219 -0
- data/lib/algolia/models/analytics/top_search_with_analytics.rb +309 -0
- data/lib/algolia/models/analytics/top_searches_response.rb +197 -0
- data/lib/algolia/models/analytics/top_searches_response_with_analytics.rb +197 -0
- data/lib/algolia/models/analytics/user_with_date.rb +207 -0
- data/lib/algolia/models/ingestion/action_type.rb +34 -0
- data/lib/algolia/models/ingestion/auth_algolia.rb +207 -0
- data/lib/algolia/models/ingestion/auth_algolia_partial.rb +203 -0
- data/lib/algolia/models/ingestion/auth_api_key.rb +195 -0
- data/lib/algolia/models/ingestion/auth_api_key_partial.rb +193 -0
- data/lib/algolia/models/ingestion/auth_basic.rb +206 -0
- data/lib/algolia/models/ingestion/auth_basic_partial.rb +202 -0
- data/lib/algolia/models/ingestion/auth_google_service_account.rb +208 -0
- data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +204 -0
- data/lib/algolia/models/ingestion/auth_input.rb +99 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +99 -0
- data/lib/algolia/models/ingestion/auth_o_auth.rb +220 -0
- data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +214 -0
- data/lib/algolia/models/ingestion/authentication.rb +283 -0
- data/lib/algolia/models/ingestion/authentication_create.rb +249 -0
- data/lib/algolia/models/ingestion/authentication_create_response.rb +220 -0
- data/lib/algolia/models/ingestion/authentication_search.rb +197 -0
- data/lib/algolia/models/ingestion/authentication_sort_keys.rb +36 -0
- data/lib/algolia/models/ingestion/authentication_type.rb +36 -0
- data/lib/algolia/models/ingestion/authentication_update.rb +243 -0
- data/lib/algolia/models/ingestion/authentication_update_response.rb +220 -0
- data/lib/algolia/models/ingestion/big_commerce_channel.rb +207 -0
- data/lib/algolia/models/ingestion/big_commerce_metafield.rb +207 -0
- data/lib/algolia/models/ingestion/big_query_data_type.rb +33 -0
- data/lib/algolia/models/ingestion/delete_response.rb +195 -0
- data/lib/algolia/models/ingestion/destination.rb +283 -0
- data/lib/algolia/models/ingestion/destination_create.rb +250 -0
- data/lib/algolia/models/ingestion/destination_create_response.rb +220 -0
- data/lib/algolia/models/ingestion/destination_index_name.rb +238 -0
- data/lib/algolia/models/ingestion/destination_index_prefix.rb +195 -0
- data/lib/algolia/models/ingestion/destination_input.rb +96 -0
- data/lib/algolia/models/ingestion/destination_search.rb +197 -0
- data/lib/algolia/models/ingestion/destination_sort_keys.rb +35 -0
- data/lib/algolia/models/ingestion/destination_type.rb +34 -0
- data/lib/algolia/models/ingestion/destination_update.rb +243 -0
- data/lib/algolia/models/ingestion/destination_update_response.rb +220 -0
- data/lib/algolia/models/ingestion/docker_image_type.rb +34 -0
- data/lib/algolia/models/ingestion/docker_registry.rb +33 -0
- data/lib/algolia/models/ingestion/docker_source_discover.rb +207 -0
- data/lib/algolia/models/ingestion/docker_source_streams.rb +196 -0
- data/lib/algolia/models/ingestion/error_base.rb +196 -0
- data/lib/algolia/models/ingestion/event.rb +311 -0
- data/lib/algolia/models/ingestion/event_sort_keys.rb +34 -0
- data/lib/algolia/models/ingestion/event_status.rb +37 -0
- data/lib/algolia/models/ingestion/event_type.rb +35 -0
- data/lib/algolia/models/ingestion/list_authentications_response.rb +207 -0
- data/lib/algolia/models/ingestion/list_destinations_response.rb +207 -0
- data/lib/algolia/models/ingestion/list_events_response.rb +218 -0
- data/lib/algolia/models/ingestion/list_sources_response.rb +207 -0
- data/lib/algolia/models/ingestion/list_tasks_response.rb +208 -0
- data/lib/algolia/models/ingestion/mapping_type_csv.rb +36 -0
- data/lib/algolia/models/ingestion/method_type.rb +33 -0
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +208 -0
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +227 -0
- data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +217 -0
- data/lib/algolia/models/ingestion/on_demand_trigger_type.rb +32 -0
- data/lib/algolia/models/ingestion/order_keys.rb +33 -0
- data/lib/algolia/models/ingestion/pagination.rb +227 -0
- data/lib/algolia/models/ingestion/platform.rb +33 -0
- data/lib/algolia/models/ingestion/platform_none.rb +32 -0
- data/lib/algolia/models/ingestion/platform_with_none.rb +96 -0
- data/lib/algolia/models/ingestion/record_type.rb +33 -0
- data/lib/algolia/models/ingestion/run.rb +359 -0
- data/lib/algolia/models/ingestion/run_list_response.rb +218 -0
- data/lib/algolia/models/ingestion/run_outcome.rb +34 -0
- data/lib/algolia/models/ingestion/run_progress.rb +201 -0
- data/lib/algolia/models/ingestion/run_reason_code.rb +38 -0
- data/lib/algolia/models/ingestion/run_response.rb +208 -0
- data/lib/algolia/models/ingestion/run_sort_keys.rb +34 -0
- data/lib/algolia/models/ingestion/run_status.rb +36 -0
- data/lib/algolia/models/ingestion/run_type.rb +34 -0
- data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +214 -0
- data/lib/algolia/models/ingestion/schedule_trigger.rb +251 -0
- data/lib/algolia/models/ingestion/schedule_trigger_input.rb +229 -0
- data/lib/algolia/models/ingestion/schedule_trigger_type.rb +32 -0
- data/lib/algolia/models/ingestion/source.rb +282 -0
- data/lib/algolia/models/ingestion/source_big_commerce.rb +235 -0
- data/lib/algolia/models/ingestion/source_big_query.rb +278 -0
- data/lib/algolia/models/ingestion/source_commercetools.rb +238 -0
- data/lib/algolia/models/ingestion/source_create.rb +248 -0
- data/lib/algolia/models/ingestion/source_create_response.rb +218 -0
- data/lib/algolia/models/ingestion/source_csv.rb +276 -0
- data/lib/algolia/models/ingestion/source_docker.rb +261 -0
- data/lib/algolia/models/ingestion/source_input.rb +100 -0
- data/lib/algolia/models/ingestion/source_json.rb +236 -0
- data/lib/algolia/models/ingestion/source_search.rb +196 -0
- data/lib/algolia/models/ingestion/source_sort_keys.rb +35 -0
- data/lib/algolia/models/ingestion/source_type.rb +37 -0
- data/lib/algolia/models/ingestion/source_update.rb +211 -0
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +207 -0
- data/lib/algolia/models/ingestion/source_update_docker.rb +246 -0
- data/lib/algolia/models/ingestion/source_update_input.rb +99 -0
- data/lib/algolia/models/ingestion/source_update_response.rb +218 -0
- data/lib/algolia/models/ingestion/subscription_trigger.rb +217 -0
- data/lib/algolia/models/ingestion/subscription_trigger_type.rb +32 -0
- data/lib/algolia/models/ingestion/task.rb +334 -0
- data/lib/algolia/models/ingestion/task_create.rb +299 -0
- data/lib/algolia/models/ingestion/task_create_response.rb +208 -0
- data/lib/algolia/models/ingestion/task_create_trigger.rb +97 -0
- data/lib/algolia/models/ingestion/task_input.rb +96 -0
- data/lib/algolia/models/ingestion/task_search.rb +196 -0
- data/lib/algolia/models/ingestion/task_sort_keys.rb +36 -0
- data/lib/algolia/models/ingestion/task_update.rb +250 -0
- data/lib/algolia/models/ingestion/task_update_response.rb +208 -0
- data/lib/algolia/models/ingestion/trigger.rb +97 -0
- data/lib/algolia/models/ingestion/trigger_type.rb +34 -0
- data/lib/algolia/models/ingestion/trigger_update_input.rb +196 -0
- data/lib/algolia/models/ingestion/window.rb +208 -0
- data/lib/algolia/models/insights/add_to_cart_event.rb +32 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +384 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +419 -0
- data/lib/algolia/models/insights/click_event.rb +32 -0
- data/lib/algolia/models/insights/clicked_filters.rb +351 -0
- data/lib/algolia/models/insights/clicked_object_ids.rb +341 -0
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +418 -0
- data/lib/algolia/models/insights/conversion_event.rb +32 -0
- data/lib/algolia/models/insights/converted_filters.rb +350 -0
- data/lib/algolia/models/insights/converted_object_ids.rb +351 -0
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +386 -0
- data/lib/algolia/models/insights/discount.rb +97 -0
- data/lib/algolia/models/insights/error_base.rb +196 -0
- data/lib/algolia/models/insights/events_items.rb +106 -0
- data/lib/algolia/models/insights/events_response.rb +204 -0
- data/lib/algolia/models/insights/insights_events.rb +215 -0
- data/lib/algolia/models/insights/object_data.rb +211 -0
- data/lib/algolia/models/insights/object_data_after_search.rb +221 -0
- data/lib/algolia/models/insights/price.rb +97 -0
- data/lib/algolia/models/insights/purchase_event.rb +32 -0
- data/lib/algolia/models/insights/purchased_object_ids.rb +384 -0
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +419 -0
- data/lib/algolia/models/insights/view_event.rb +32 -0
- data/lib/algolia/models/insights/viewed_filters.rb +351 -0
- data/lib/algolia/models/insights/viewed_object_ids.rb +351 -0
- data/lib/algolia/models/monitoring/error_base.rb +196 -0
- data/lib/algolia/models/monitoring/get_inventory403_response.rb +192 -0
- data/lib/algolia/models/monitoring/incident.rb +225 -0
- data/lib/algolia/models/monitoring/incidents_inner.rb +202 -0
- data/lib/algolia/models/monitoring/incidents_response.rb +194 -0
- data/lib/algolia/models/monitoring/indexing_time_response.rb +192 -0
- data/lib/algolia/models/monitoring/indexing_time_response_metrics.rb +194 -0
- data/lib/algolia/models/monitoring/infrastructure_response.rb +192 -0
- data/lib/algolia/models/monitoring/infrastructure_response_metrics.rb +243 -0
- data/lib/algolia/models/monitoring/inventory_response.rb +194 -0
- data/lib/algolia/models/monitoring/latency_response.rb +192 -0
- data/lib/algolia/models/monitoring/latency_response_metrics.rb +194 -0
- data/lib/algolia/models/monitoring/metric.rb +37 -0
- data/lib/algolia/models/monitoring/period.rb +36 -0
- data/lib/algolia/models/monitoring/probes_metric.rb +203 -0
- data/lib/algolia/models/monitoring/region.rb +46 -0
- data/lib/algolia/models/monitoring/server.rb +272 -0
- data/lib/algolia/models/monitoring/server_status.rb +32 -0
- data/lib/algolia/models/monitoring/status.rb +35 -0
- data/lib/algolia/models/monitoring/status_response.rb +194 -0
- data/lib/algolia/models/monitoring/time_inner.rb +203 -0
- data/lib/algolia/models/monitoring/type.rb +32 -0
- data/lib/algolia/models/personalization/delete_user_profile_response.rb +207 -0
- data/lib/algolia/models/personalization/error_base.rb +196 -0
- data/lib/algolia/models/personalization/event_scoring.rb +219 -0
- data/lib/algolia/models/personalization/facet_scoring.rb +207 -0
- data/lib/algolia/models/personalization/get_user_token_response.rb +219 -0
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +223 -0
- data/lib/algolia/models/personalization/set_personalization_strategy_response.rb +195 -0
- data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb +223 -0
- data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb +195 -0
- data/lib/algolia/models/query-suggestions/base_response.rb +203 -0
- data/lib/algolia/models/query-suggestions/error_base.rb +196 -0
- data/lib/algolia/models/query-suggestions/facet.rb +204 -0
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +233 -0
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +244 -0
- data/lib/algolia/models/query-suggestions/languages.rb +97 -0
- data/lib/algolia/models/query-suggestions/log_level.rb +34 -0
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +255 -0
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +315 -0
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +275 -0
- data/lib/algolia/models/query-suggestions/source_index.rb +305 -0
- data/lib/algolia/models/recommend/advanced_syntax_features.rb +33 -0
- data/lib/algolia/models/recommend/alternatives_as_exact.rb +34 -0
- data/lib/algolia/models/recommend/anchoring.rb +35 -0
- data/lib/algolia/models/recommend/around_precision.rb +97 -0
- data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +201 -0
- data/lib/algolia/models/recommend/around_radius.rb +97 -0
- data/lib/algolia/models/recommend/around_radius_all.rb +32 -0
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +216 -0
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +97 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +233 -0
- data/lib/algolia/models/recommend/base_recommendations_query.rb +246 -0
- data/lib/algolia/models/recommend/base_recommended_for_you_query.rb +234 -0
- data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +195 -0
- data/lib/algolia/models/recommend/base_search_params.rb +564 -0
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +546 -0
- data/lib/algolia/models/recommend/base_search_response.rb +517 -0
- data/lib/algolia/models/recommend/base_trending_facets_query.rb +226 -0
- data/lib/algolia/models/recommend/base_trending_items_query.rb +252 -0
- data/lib/algolia/models/recommend/condition.rb +244 -0
- data/lib/algolia/models/recommend/consequence.rb +239 -0
- data/lib/algolia/models/recommend/consequence_hide.rb +196 -0
- data/lib/algolia/models/recommend/consequence_params.rb +1121 -0
- data/lib/algolia/models/recommend/consequence_query.rb +97 -0
- data/lib/algolia/models/recommend/consequence_query_object.rb +207 -0
- data/lib/algolia/models/recommend/deleted_at_response.rb +208 -0
- data/lib/algolia/models/recommend/distinct.rb +97 -0
- data/lib/algolia/models/recommend/edit.rb +234 -0
- data/lib/algolia/models/recommend/edit_type.rb +33 -0
- data/lib/algolia/models/recommend/error_base.rb +196 -0
- data/lib/algolia/models/recommend/exact_on_single_word_query.rb +34 -0
- data/lib/algolia/models/recommend/exhaustive.rb +234 -0
- data/lib/algolia/models/recommend/facet_filters.rb +97 -0
- data/lib/algolia/models/recommend/facet_ordering.rb +205 -0
- data/lib/algolia/models/recommend/facets.rb +196 -0
- data/lib/algolia/models/recommend/facets_stats.rb +223 -0
- data/lib/algolia/models/recommend/get_recommend_task_response.rb +216 -0
- data/lib/algolia/models/recommend/get_recommendations_params.rb +198 -0
- data/lib/algolia/models/recommend/get_recommendations_response.rb +194 -0
- data/lib/algolia/models/recommend/highlight_result.rb +96 -0
- data/lib/algolia/models/recommend/highlight_result_option.rb +253 -0
- data/lib/algolia/models/recommend/ignore_plurals.rb +97 -0
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +723 -0
- data/lib/algolia/models/recommend/match_level.rb +34 -0
- data/lib/algolia/models/recommend/matched_geo_location.rb +213 -0
- data/lib/algolia/models/recommend/mixed_search_filters.rb +96 -0
- data/lib/algolia/models/recommend/mode.rb +33 -0
- data/lib/algolia/models/recommend/numeric_filters.rb +97 -0
- data/lib/algolia/models/recommend/optional_filters.rb +97 -0
- data/lib/algolia/models/recommend/params.rb +220 -0
- data/lib/algolia/models/recommend/personalization.rb +213 -0
- data/lib/algolia/models/recommend/promote.rb +96 -0
- data/lib/algolia/models/recommend/promote_object_id.rb +208 -0
- data/lib/algolia/models/recommend/promote_object_ids.rb +210 -0
- data/lib/algolia/models/recommend/query_type.rb +34 -0
- data/lib/algolia/models/recommend/ranking_info.rb +328 -0
- data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +97 -0
- data/lib/algolia/models/recommend/recommend_hit.rb +271 -0
- data/lib/algolia/models/recommend/recommend_models.rb +35 -0
- data/lib/algolia/models/recommend/recommendation_models.rb +33 -0
- data/lib/algolia/models/recommend/recommendations_hit.rb +96 -0
- data/lib/algolia/models/recommend/recommendations_hits.rb +216 -0
- data/lib/algolia/models/recommend/recommendations_query.rb +304 -0
- data/lib/algolia/models/recommend/recommendations_request.rb +98 -0
- data/lib/algolia/models/recommend/recommendations_results.rb +553 -0
- data/lib/algolia/models/recommend/recommended_for_you_model.rb +32 -0
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +292 -0
- data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +1105 -0
- data/lib/algolia/models/recommend/redirect.rb +195 -0
- data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +242 -0
- data/lib/algolia/models/recommend/redirect_rule_index_metadata_data.rb +195 -0
- data/lib/algolia/models/recommend/remove_stop_words.rb +97 -0
- data/lib/algolia/models/recommend/remove_words_if_no_results.rb +35 -0
- data/lib/algolia/models/recommend/rendering_content.rb +193 -0
- data/lib/algolia/models/recommend/rule_response.rb +246 -0
- data/lib/algolia/models/recommend/rule_response_metadata.rb +193 -0
- data/lib/algolia/models/recommend/search_params_object.rb +1103 -0
- data/lib/algolia/models/recommend/search_params_query.rb +193 -0
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +268 -0
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +233 -0
- data/lib/algolia/models/recommend/semantic_search.rb +198 -0
- data/lib/algolia/models/recommend/snippet_result.rb +96 -0
- data/lib/algolia/models/recommend/snippet_result_option.rb +229 -0
- data/lib/algolia/models/recommend/sort_remaining_by.rb +34 -0
- data/lib/algolia/models/recommend/tag_filters.rb +97 -0
- data/lib/algolia/models/recommend/task_status.rb +33 -0
- data/lib/algolia/models/recommend/trending_facet_hit.rb +238 -0
- data/lib/algolia/models/recommend/trending_facets_model.rb +32 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +284 -0
- data/lib/algolia/models/recommend/trending_items_model.rb +32 -0
- data/lib/algolia/models/recommend/trending_items_query.rb +310 -0
- data/lib/algolia/models/recommend/typo_tolerance.rb +97 -0
- data/lib/algolia/models/recommend/typo_tolerance_enum.rb +33 -0
- data/lib/algolia/models/recommend/value.rb +226 -0
- data/lib/algolia/models/search/acl.rb +47 -0
- data/lib/algolia/models/search/action.rb +38 -0
- data/lib/algolia/models/search/add_api_key_response.rb +207 -0
- data/lib/algolia/models/search/advanced_syntax_features.rb +33 -0
- data/lib/algolia/models/search/alternatives_as_exact.rb +34 -0
- data/lib/algolia/models/search/anchoring.rb +35 -0
- data/lib/algolia/models/search/api_key.rb +272 -0
- data/lib/algolia/models/search/around_precision.rb +97 -0
- data/lib/algolia/models/search/around_precision_from_value_inner.rb +201 -0
- data/lib/algolia/models/search/around_radius.rb +97 -0
- data/lib/algolia/models/search/around_radius_all.rb +32 -0
- data/lib/algolia/models/search/assign_user_id_params.rb +196 -0
- data/lib/algolia/models/search/attribute_to_update.rb +96 -0
- data/lib/algolia/models/search/automatic_facet_filter.rb +216 -0
- data/lib/algolia/models/search/automatic_facet_filters.rb +97 -0
- data/lib/algolia/models/search/base_get_api_key_response.rb +205 -0
- data/lib/algolia/models/search/base_index_settings.rb +366 -0
- data/lib/algolia/models/search/base_search_params.rb +564 -0
- data/lib/algolia/models/search/base_search_params_without_query.rb +546 -0
- data/lib/algolia/models/search/base_search_response.rb +517 -0
- data/lib/algolia/models/search/batch_assign_user_ids_params.rb +210 -0
- data/lib/algolia/models/search/batch_dictionary_entries_params.rb +208 -0
- data/lib/algolia/models/search/batch_dictionary_entries_request.rb +227 -0
- data/lib/algolia/models/search/batch_params.rb +197 -0
- data/lib/algolia/models/search/batch_request.rb +228 -0
- data/lib/algolia/models/search/batch_response.rb +209 -0
- data/lib/algolia/models/search/batch_write_params.rb +197 -0
- data/lib/algolia/models/search/browse_params.rb +96 -0
- data/lib/algolia/models/search/browse_params_object.rb +1113 -0
- data/lib/algolia/models/search/browse_response.rb +568 -0
- data/lib/algolia/models/search/built_in_operation.rb +229 -0
- data/lib/algolia/models/search/built_in_operation_type.rb +38 -0
- data/lib/algolia/models/search/condition.rb +244 -0
- data/lib/algolia/models/search/consequence.rb +239 -0
- data/lib/algolia/models/search/consequence_hide.rb +196 -0
- data/lib/algolia/models/search/consequence_params.rb +1121 -0
- data/lib/algolia/models/search/consequence_query.rb +97 -0
- data/lib/algolia/models/search/consequence_query_object.rb +207 -0
- data/lib/algolia/models/search/created_at_response.rb +196 -0
- data/lib/algolia/models/search/cursor.rb +193 -0
- data/lib/algolia/models/search/delete_api_key_response.rb +195 -0
- data/lib/algolia/models/search/delete_by_params.rb +263 -0
- data/lib/algolia/models/search/delete_source_response.rb +195 -0
- data/lib/algolia/models/search/deleted_at_response.rb +208 -0
- data/lib/algolia/models/search/dictionary_action.rb +33 -0
- data/lib/algolia/models/search/dictionary_entry.rb +276 -0
- data/lib/algolia/models/search/dictionary_entry_state.rb +33 -0
- data/lib/algolia/models/search/dictionary_language.rb +194 -0
- data/lib/algolia/models/search/dictionary_settings_params.rb +195 -0
- data/lib/algolia/models/search/dictionary_type.rb +34 -0
- data/lib/algolia/models/search/distinct.rb +97 -0
- data/lib/algolia/models/search/edit.rb +234 -0
- data/lib/algolia/models/search/edit_type.rb +33 -0
- data/lib/algolia/models/search/error_base.rb +196 -0
- data/lib/algolia/models/search/exact_on_single_word_query.rb +34 -0
- data/lib/algolia/models/search/exhaustive.rb +234 -0
- data/lib/algolia/models/search/facet_filters.rb +97 -0
- data/lib/algolia/models/search/facet_hits.rb +219 -0
- data/lib/algolia/models/search/facet_ordering.rb +205 -0
- data/lib/algolia/models/search/facets.rb +196 -0
- data/lib/algolia/models/search/facets_stats.rb +223 -0
- data/lib/algolia/models/search/fetched_index.rb +313 -0
- data/lib/algolia/models/search/get_api_key_response.rb +301 -0
- data/lib/algolia/models/search/get_dictionary_settings_response.rb +194 -0
- data/lib/algolia/models/search/get_logs_response.rb +196 -0
- data/lib/algolia/models/search/get_objects_params.rb +197 -0
- data/lib/algolia/models/search/get_objects_request.rb +220 -0
- data/lib/algolia/models/search/get_objects_response.rb +197 -0
- data/lib/algolia/models/search/get_task_response.rb +216 -0
- data/lib/algolia/models/search/get_top_user_ids_response.rb +198 -0
- data/lib/algolia/models/search/has_pending_mappings_response.rb +207 -0
- data/lib/algolia/models/search/highlight_result.rb +96 -0
- data/lib/algolia/models/search/highlight_result_option.rb +253 -0
- data/lib/algolia/models/search/hit.rb +241 -0
- data/lib/algolia/models/search/ignore_plurals.rb +97 -0
- data/lib/algolia/models/search/index_settings.rb +912 -0
- data/lib/algolia/models/search/index_settings_as_search_params.rb +723 -0
- data/lib/algolia/models/search/languages.rb +221 -0
- data/lib/algolia/models/search/list_api_keys_response.rb +197 -0
- data/lib/algolia/models/search/list_clusters_response.rb +198 -0
- data/lib/algolia/models/search/list_indices_response.rb +207 -0
- data/lib/algolia/models/search/list_user_ids_response.rb +198 -0
- data/lib/algolia/models/search/log.rb +358 -0
- data/lib/algolia/models/search/log_query.rb +213 -0
- data/lib/algolia/models/search/log_type.rb +35 -0
- data/lib/algolia/models/search/match_level.rb +34 -0
- data/lib/algolia/models/search/matched_geo_location.rb +213 -0
- data/lib/algolia/models/search/mixed_search_filters.rb +96 -0
- data/lib/algolia/models/search/mode.rb +33 -0
- data/lib/algolia/models/search/multiple_batch_request.rb +240 -0
- data/lib/algolia/models/search/multiple_batch_response.rb +211 -0
- data/lib/algolia/models/search/numeric_filters.rb +97 -0
- data/lib/algolia/models/search/operation_index_params.rb +240 -0
- data/lib/algolia/models/search/operation_type.rb +33 -0
- data/lib/algolia/models/search/optional_filters.rb +97 -0
- data/lib/algolia/models/search/params.rb +220 -0
- data/lib/algolia/models/search/personalization.rb +213 -0
- data/lib/algolia/models/search/promote.rb +96 -0
- data/lib/algolia/models/search/promote_object_id.rb +208 -0
- data/lib/algolia/models/search/promote_object_ids.rb +210 -0
- data/lib/algolia/models/search/query_type.rb +34 -0
- data/lib/algolia/models/search/ranking_info.rb +328 -0
- data/lib/algolia/models/search/re_ranking_apply_filter.rb +97 -0
- data/lib/algolia/models/search/redirect.rb +195 -0
- data/lib/algolia/models/search/redirect_rule_index_metadata.rb +242 -0
- data/lib/algolia/models/search/redirect_rule_index_metadata_data.rb +195 -0
- data/lib/algolia/models/search/remove_stop_words.rb +97 -0
- data/lib/algolia/models/search/remove_user_id_response.rb +195 -0
- data/lib/algolia/models/search/remove_words_if_no_results.rb +35 -0
- data/lib/algolia/models/search/rendering_content.rb +193 -0
- data/lib/algolia/models/search/replace_source_response.rb +195 -0
- data/lib/algolia/models/search/rule.rb +249 -0
- data/lib/algolia/models/search/save_object_response.rb +217 -0
- data/lib/algolia/models/search/save_synonym_response.rb +219 -0
- data/lib/algolia/models/search/scope_type.rb +34 -0
- data/lib/algolia/models/search/search_dictionary_entries_params.rb +244 -0
- data/lib/algolia/models/search/search_for_facet_values_request.rb +227 -0
- data/lib/algolia/models/search/search_for_facet_values_response.rb +218 -0
- data/lib/algolia/models/search/search_for_facets.rb +1158 -0
- data/lib/algolia/models/search/search_for_facets_options.rb +274 -0
- data/lib/algolia/models/search/search_for_hits.rb +1134 -0
- data/lib/algolia/models/search/search_for_hits_options.rb +226 -0
- data/lib/algolia/models/search/search_hits.rb +223 -0
- data/lib/algolia/models/search/search_method_params.rb +227 -0
- data/lib/algolia/models/search/search_params.rb +96 -0
- data/lib/algolia/models/search/search_params_object.rb +1103 -0
- data/lib/algolia/models/search/search_params_query.rb +193 -0
- data/lib/algolia/models/search/search_params_string.rb +193 -0
- data/lib/algolia/models/search/search_query.rb +96 -0
- data/lib/algolia/models/search/search_response.rb +560 -0
- data/lib/algolia/models/search/search_responses.rb +196 -0
- data/lib/algolia/models/search/search_result.rb +96 -0
- data/lib/algolia/models/search/search_rules_params.rb +311 -0
- data/lib/algolia/models/search/search_rules_response.rb +233 -0
- data/lib/algolia/models/search/search_strategy.rb +33 -0
- data/lib/algolia/models/search/search_synonyms_params.rb +193 -0
- data/lib/algolia/models/search/search_synonyms_response.rb +212 -0
- data/lib/algolia/models/search/search_type_default.rb +32 -0
- data/lib/algolia/models/search/search_type_facet.rb +32 -0
- data/lib/algolia/models/search/search_user_ids_params.rb +244 -0
- data/lib/algolia/models/search/search_user_ids_response.rb +264 -0
- data/lib/algolia/models/search/semantic_search.rb +198 -0
- data/lib/algolia/models/search/snippet_result.rb +96 -0
- data/lib/algolia/models/search/snippet_result_option.rb +229 -0
- data/lib/algolia/models/search/sort_remaining_by.rb +34 -0
- data/lib/algolia/models/search/source.rb +206 -0
- data/lib/algolia/models/search/standard_entries.rb +224 -0
- data/lib/algolia/models/search/synonym_hit.rb +295 -0
- data/lib/algolia/models/search/synonym_type.rb +36 -0
- data/lib/algolia/models/search/tag_filters.rb +97 -0
- data/lib/algolia/models/search/task_status.rb +33 -0
- data/lib/algolia/models/search/time_range.rb +207 -0
- data/lib/algolia/models/search/typo_tolerance.rb +97 -0
- data/lib/algolia/models/search/typo_tolerance_enum.rb +33 -0
- data/lib/algolia/models/search/update_api_key_response.rb +207 -0
- data/lib/algolia/models/search/updated_at_response.rb +208 -0
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +214 -0
- data/lib/algolia/models/search/updated_rule_response.rb +219 -0
- data/lib/algolia/models/search/user_highlight_result.rb +205 -0
- data/lib/algolia/models/search/user_hit.rb +269 -0
- data/lib/algolia/models/search/user_id.rb +247 -0
- data/lib/algolia/models/search/value.rb +226 -0
- data/lib/algolia/transport/echo_requester.rb +10 -0
- data/lib/algolia/{http → transport/http}/http_requester.rb +24 -19
- data/lib/algolia/{http → transport/http}/response.rb +11 -1
- data/lib/algolia/transport/request_options.rb +19 -31
- data/lib/algolia/transport/retry_strategy.rb +5 -8
- data/lib/algolia/transport/stateful_host.rb +1 -2
- data/lib/algolia/transport/transport.rb +33 -73
- data/lib/algolia/user_agent.rb +4 -14
- data/lib/algolia/version.rb +3 -1
- data/lib/algolia.rb +23 -40
- metadata +522 -217
- data/.circleci/config.yml +0 -155
- data/.dockerignore +0 -38
- data/.github/ISSUE_TEMPLATE.md +0 -20
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -22
- data/.gitignore +0 -40
- data/.rubocop.yml +0 -189
- data/.rubocop_todo.yml +0 -14
- data/CODE_OF_CONDUCT.md +0 -74
- data/CONTRIBUTING.MD +0 -184
- data/DOCKER_README.MD +0 -89
- data/Dockerfile +0 -7
- data/LICENSE +0 -21
- data/SECURITY.md +0 -3
- data/Steepfile +0 -6
- data/bin/console +0 -21
- data/bin/setup +0 -8
- data/lib/algolia/account_client.rb +0 -65
- data/lib/algolia/analytics_client.rb +0 -105
- data/lib/algolia/config/analytics_config.rb +0 -20
- data/lib/algolia/config/base_config.rb +0 -43
- data/lib/algolia/config/insights_config.rb +0 -20
- data/lib/algolia/config/personalization_config.rb +0 -20
- data/lib/algolia/config/recommend_config.rb +0 -6
- data/lib/algolia/config/recommendation_config.rb +0 -7
- data/lib/algolia/config/search_config.rb +0 -40
- data/lib/algolia/defaults.rb +0 -35
- data/lib/algolia/helpers.rb +0 -134
- data/lib/algolia/insights_client.rb +0 -238
- data/lib/algolia/iterators/base_iterator.rb +0 -19
- data/lib/algolia/iterators/object_iterator.rb +0 -28
- data/lib/algolia/iterators/paginator_iterator.rb +0 -46
- data/lib/algolia/iterators/rule_iterator.rb +0 -9
- data/lib/algolia/iterators/synonym_iterator.rb +0 -9
- data/lib/algolia/personalization_client.rb +0 -60
- data/lib/algolia/recommend_client.rb +0 -134
- data/lib/algolia/recommendation_client.rb +0 -7
- data/lib/algolia/responses/add_api_key_response.rb +0 -38
- data/lib/algolia/responses/base_response.rb +0 -9
- data/lib/algolia/responses/delete_api_key_response.rb +0 -40
- data/lib/algolia/responses/dictionary_response.rb +0 -33
- data/lib/algolia/responses/indexing_response.rb +0 -28
- data/lib/algolia/responses/multiple_batch_indexing_response.rb +0 -29
- data/lib/algolia/responses/multiple_response.rb +0 -45
- data/lib/algolia/responses/restore_api_key_response.rb +0 -36
- data/lib/algolia/responses/update_api_key_response.rb +0 -39
- data/lib/algolia/search_client.rb +0 -791
- data/lib/algolia/search_index.rb +0 -1059
- data/renovate.json +0 -5
- data/sig/config/algolia_config.rbs +0 -24
- data/sig/config/analytics_config.rbs +0 -11
- data/sig/config/insights_config.rbs +0 -11
- data/sig/config/recommendation_config.rbs +0 -11
- data/sig/config/search_config.rbs +0 -11
- data/sig/enums/call_type.rbs +0 -5
- data/sig/helpers.rbs +0 -12
- data/sig/http/http_requester.rbs +0 -17
- data/sig/http/response.rbs +0 -14
- data/sig/interfaces/_connection.rbs +0 -16
- data/sig/iterators/base_iterator.rbs +0 -15
- data/sig/iterators/object_iterator.rbs +0 -6
- data/sig/iterators/paginator_iterator.rbs +0 -8
- data/sig/iterators/rule_iterator.rbs +0 -5
- data/sig/iterators/synonym_iterator.rbs +0 -5
- data/sig/transport/request_options.rbs +0 -33
- data/sig/transport/stateful_host.rbs +0 -21
- data/test/algolia/integration/account_client_test.rb +0 -47
- data/test/algolia/integration/analytics_client_test.rb +0 -117
- data/test/algolia/integration/base_test.rb +0 -9
- data/test/algolia/integration/insights_client_test.rb +0 -80
- data/test/algolia/integration/mocks/mock_requester.rb +0 -47
- data/test/algolia/integration/personalization_client_test.rb +0 -30
- data/test/algolia/integration/recommend_client_test.rb +0 -70
- data/test/algolia/integration/recommendation_client_test.rb +0 -30
- data/test/algolia/integration/search_client_test.rb +0 -465
- data/test/algolia/integration/search_index_test.rb +0 -729
- data/test/algolia/unit/algolia_config_test.rb +0 -16
- data/test/algolia/unit/helpers_test.rb +0 -92
- data/test/algolia/unit/http_requester_test.rb +0 -27
- data/test/algolia/unit/retry_strategy_test.rb +0 -139
- data/test/algolia/unit/user_agent_test.rb +0 -16
- data/test/test_helper.rb +0 -121
- data/upgrade_guide.md +0 -603
- /data/lib/algolia/{enums → transport}/call_type.rb +0 -0
- /data/lib/algolia/{enums → transport}/retry_outcome_type.rb +0 -0
@@ -0,0 +1,1121 @@
|
|
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 ConsequenceParams
|
9
|
+
# Overrides the query parameter and performs a more generic search.
|
10
|
+
attr_accessor :similar_query
|
11
|
+
|
12
|
+
# [Filter](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters.
|
13
|
+
attr_accessor :filters
|
14
|
+
|
15
|
+
attr_accessor :facet_filters
|
16
|
+
|
17
|
+
attr_accessor :optional_filters
|
18
|
+
|
19
|
+
attr_accessor :numeric_filters
|
20
|
+
|
21
|
+
attr_accessor :tag_filters
|
22
|
+
|
23
|
+
# Determines how to calculate [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If `false`, maximum score is kept. If `true`, score is summed.
|
24
|
+
attr_accessor :sum_or_filters_scores
|
25
|
+
|
26
|
+
# Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
27
|
+
attr_accessor :restrict_searchable_attributes
|
28
|
+
|
29
|
+
# Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.
|
30
|
+
attr_accessor :facets
|
31
|
+
|
32
|
+
# Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
|
33
|
+
attr_accessor :faceting_after_distinct
|
34
|
+
|
35
|
+
# Page to retrieve (the first page is `0`, not `1`).
|
36
|
+
attr_accessor :page
|
37
|
+
|
38
|
+
# Specifies the offset of the first hit to return. > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).
|
39
|
+
attr_accessor :offset
|
40
|
+
|
41
|
+
# Sets the number of hits to retrieve (for use with `offset`). > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length).
|
42
|
+
attr_accessor :length
|
43
|
+
|
44
|
+
# Search for entries [around a central location](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area.
|
45
|
+
attr_accessor :around_lat_lng
|
46
|
+
|
47
|
+
# Search for entries around a location. The location is automatically computed from the requester's IP address.
|
48
|
+
attr_accessor :around_lat_lng_via_ip
|
49
|
+
|
50
|
+
attr_accessor :around_radius
|
51
|
+
|
52
|
+
attr_accessor :around_precision
|
53
|
+
|
54
|
+
# Minimum radius (in meters) used for a geographical search when `aroundRadius` isn't set.
|
55
|
+
attr_accessor :minimum_around_radius
|
56
|
+
|
57
|
+
# Search inside a [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates).
|
58
|
+
attr_accessor :inside_bounding_box
|
59
|
+
|
60
|
+
# Search inside a [polygon](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates).
|
61
|
+
attr_accessor :inside_polygon
|
62
|
+
|
63
|
+
# Changes the default values of parameters that work best for a natural language query, such as `ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries.
|
64
|
+
attr_accessor :natural_languages
|
65
|
+
|
66
|
+
# Assigns [rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) to search queries.
|
67
|
+
attr_accessor :rule_contexts
|
68
|
+
|
69
|
+
# Defines how much [Personalization affects results](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
|
70
|
+
attr_accessor :personalization_impact
|
71
|
+
|
72
|
+
# Associates a [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search.
|
73
|
+
attr_accessor :user_token
|
74
|
+
|
75
|
+
# Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information).
|
76
|
+
attr_accessor :get_ranking_info
|
77
|
+
|
78
|
+
# Enriches the API's response with information about how the query was processed.
|
79
|
+
attr_accessor :explain
|
80
|
+
|
81
|
+
# Whether to take into account an index's synonyms for a particular search.
|
82
|
+
attr_accessor :synonyms
|
83
|
+
|
84
|
+
# Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
|
85
|
+
attr_accessor :click_analytics
|
86
|
+
|
87
|
+
# Indicates whether this query will be included in [analytics](https://www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/).
|
88
|
+
attr_accessor :analytics
|
89
|
+
|
90
|
+
# Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
91
|
+
attr_accessor :analytics_tags
|
92
|
+
|
93
|
+
# Whether to include or exclude a query from the processing-time percentile computation.
|
94
|
+
attr_accessor :percentile_computation
|
95
|
+
|
96
|
+
# Incidates whether this search will be considered in A/B testing.
|
97
|
+
attr_accessor :enable_ab_test
|
98
|
+
|
99
|
+
# Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/) and the [modifiers](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) that can be applied: `filterOnly`, `searchable`, and `afterDistinct`.
|
100
|
+
attr_accessor :attributes_for_faceting
|
101
|
+
|
102
|
+
# Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. By default, the response includes all attributes.
|
103
|
+
attr_accessor :attributes_to_retrieve
|
104
|
+
|
105
|
+
# Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/).
|
106
|
+
attr_accessor :ranking
|
107
|
+
|
108
|
+
# Specifies the [Custom ranking criterion](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Use the `asc` and `desc` modifiers to specify the ranking order: ascending or descending.
|
109
|
+
attr_accessor :custom_ranking
|
110
|
+
|
111
|
+
# Relevancy threshold below which less relevant results aren't included in the results.
|
112
|
+
attr_accessor :relevancy_strictness
|
113
|
+
|
114
|
+
# Attributes to highlight. Strings that match the search query in the attributes are highlighted by surrounding them with HTML tags (`highlightPreTag` and `highlightPostTag`).
|
115
|
+
attr_accessor :attributes_to_highlight
|
116
|
+
|
117
|
+
# Attributes to _snippet_. 'Snippeting' is shortening the attribute to a certain number of words. If not specified, the attribute is shortened to the 10 words around the matching string but you can specify the number. For example: `body:20`.
|
118
|
+
attr_accessor :attributes_to_snippet
|
119
|
+
|
120
|
+
# HTML string to insert before the highlighted parts in all highlight and snippet results.
|
121
|
+
attr_accessor :highlight_pre_tag
|
122
|
+
|
123
|
+
# HTML string to insert after the highlighted parts in all highlight and snippet results.
|
124
|
+
attr_accessor :highlight_post_tag
|
125
|
+
|
126
|
+
# String used as an ellipsis indicator when a snippet is truncated.
|
127
|
+
attr_accessor :snippet_ellipsis_text
|
128
|
+
|
129
|
+
# Restrict highlighting and snippeting to items that matched the query.
|
130
|
+
attr_accessor :restrict_highlight_and_snippet_arrays
|
131
|
+
|
132
|
+
# Number of hits per page.
|
133
|
+
attr_accessor :hits_per_page
|
134
|
+
|
135
|
+
# Minimum number of characters a word in the query string 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).
|
136
|
+
attr_accessor :min_word_sizefor1_typo
|
137
|
+
|
138
|
+
# Minimum number of characters a word in the query string 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).
|
139
|
+
attr_accessor :min_word_sizefor2_typos
|
140
|
+
|
141
|
+
attr_accessor :typo_tolerance
|
142
|
+
|
143
|
+
# Whether to allow typos on numbers (\"numeric tokens\") in the query string.
|
144
|
+
attr_accessor :allow_typos_on_numeric_tokens
|
145
|
+
|
146
|
+
# Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/).
|
147
|
+
attr_accessor :disable_typo_tolerance_on_attributes
|
148
|
+
|
149
|
+
attr_accessor :ignore_plurals
|
150
|
+
|
151
|
+
attr_accessor :remove_stop_words
|
152
|
+
|
153
|
+
# Characters that the engine shouldn't automatically [normalize](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/).
|
154
|
+
attr_accessor :keep_diacritics_on_characters
|
155
|
+
|
156
|
+
# Sets your user's search language. This adjusts language-specific settings and features such as `ignorePlurals`, `removeStopWords`, and [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) word detection.
|
157
|
+
attr_accessor :query_languages
|
158
|
+
|
159
|
+
# [Splits compound words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words) into their component word parts in the query.
|
160
|
+
attr_accessor :decompound_query
|
161
|
+
|
162
|
+
# Incidates whether [Rules](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/) are enabled.
|
163
|
+
attr_accessor :enable_rules
|
164
|
+
|
165
|
+
# Incidates whether [Personalization](https://www.algolia.com/doc/guides/personalization/what-is-personalization/) is enabled.
|
166
|
+
attr_accessor :enable_personalization
|
167
|
+
|
168
|
+
attr_accessor :query_type
|
169
|
+
|
170
|
+
attr_accessor :remove_words_if_no_results
|
171
|
+
|
172
|
+
attr_accessor :mode
|
173
|
+
|
174
|
+
attr_accessor :semantic_search
|
175
|
+
|
176
|
+
# Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax).
|
177
|
+
attr_accessor :advanced_syntax
|
178
|
+
|
179
|
+
# Words which should be considered [optional](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words) when found in a query.
|
180
|
+
attr_accessor :optional_words
|
181
|
+
|
182
|
+
# 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).
|
183
|
+
attr_accessor :disable_exact_on_attributes
|
184
|
+
|
185
|
+
attr_accessor :exact_on_single_word_query
|
186
|
+
|
187
|
+
# Alternatives that should be considered an exact match by [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).
|
188
|
+
attr_accessor :alternatives_as_exact
|
189
|
+
|
190
|
+
# Allows you to specify which advanced syntax features are active when `advancedSyntax` is enabled.
|
191
|
+
attr_accessor :advanced_syntax_features
|
192
|
+
|
193
|
+
attr_accessor :distinct
|
194
|
+
|
195
|
+
# Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
|
196
|
+
attr_accessor :replace_synonyms_in_highlight
|
197
|
+
|
198
|
+
# Precision of the [proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity).
|
199
|
+
attr_accessor :min_proximity
|
200
|
+
|
201
|
+
# Attributes to include in the API response for search and browse queries.
|
202
|
+
attr_accessor :response_fields
|
203
|
+
|
204
|
+
# Maximum number of facet hits to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
|
205
|
+
attr_accessor :max_facet_hits
|
206
|
+
|
207
|
+
# Maximum number of facet values to return for each facet.
|
208
|
+
attr_accessor :max_values_per_facet
|
209
|
+
|
210
|
+
# Controls how facet values are fetched.
|
211
|
+
attr_accessor :sort_facet_values_by
|
212
|
+
|
213
|
+
# When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage.
|
214
|
+
attr_accessor :attribute_criteria_computed_by_min_proximity
|
215
|
+
|
216
|
+
attr_accessor :rendering_content
|
217
|
+
|
218
|
+
# Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
219
|
+
attr_accessor :enable_re_ranking
|
220
|
+
|
221
|
+
attr_accessor :re_ranking_apply_filter
|
222
|
+
|
223
|
+
attr_accessor :query
|
224
|
+
|
225
|
+
attr_accessor :automatic_facet_filters
|
226
|
+
|
227
|
+
attr_accessor :automatic_optional_facet_filters
|
228
|
+
|
229
|
+
class EnumAttributeValidator
|
230
|
+
attr_reader :datatype
|
231
|
+
attr_reader :allowable_values
|
232
|
+
|
233
|
+
def initialize(datatype, allowable_values)
|
234
|
+
@allowable_values = allowable_values.map do |value|
|
235
|
+
case datatype.to_s
|
236
|
+
when /Integer/i
|
237
|
+
value.to_i
|
238
|
+
when /Float/i
|
239
|
+
value.to_f
|
240
|
+
else
|
241
|
+
value
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
def valid?(value)
|
247
|
+
!value || allowable_values.include?(value)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
252
|
+
def self.attribute_map
|
253
|
+
{
|
254
|
+
:similar_query => :similarQuery,
|
255
|
+
:filters => :filters,
|
256
|
+
:facet_filters => :facetFilters,
|
257
|
+
:optional_filters => :optionalFilters,
|
258
|
+
:numeric_filters => :numericFilters,
|
259
|
+
:tag_filters => :tagFilters,
|
260
|
+
:sum_or_filters_scores => :sumOrFiltersScores,
|
261
|
+
:restrict_searchable_attributes => :restrictSearchableAttributes,
|
262
|
+
:facets => :facets,
|
263
|
+
:faceting_after_distinct => :facetingAfterDistinct,
|
264
|
+
:page => :page,
|
265
|
+
:offset => :offset,
|
266
|
+
:length => :length,
|
267
|
+
:around_lat_lng => :aroundLatLng,
|
268
|
+
:around_lat_lng_via_ip => :aroundLatLngViaIP,
|
269
|
+
:around_radius => :aroundRadius,
|
270
|
+
:around_precision => :aroundPrecision,
|
271
|
+
:minimum_around_radius => :minimumAroundRadius,
|
272
|
+
:inside_bounding_box => :insideBoundingBox,
|
273
|
+
:inside_polygon => :insidePolygon,
|
274
|
+
:natural_languages => :naturalLanguages,
|
275
|
+
:rule_contexts => :ruleContexts,
|
276
|
+
:personalization_impact => :personalizationImpact,
|
277
|
+
:user_token => :userToken,
|
278
|
+
:get_ranking_info => :getRankingInfo,
|
279
|
+
:explain => :explain,
|
280
|
+
:synonyms => :synonyms,
|
281
|
+
:click_analytics => :clickAnalytics,
|
282
|
+
:analytics => :analytics,
|
283
|
+
:analytics_tags => :analyticsTags,
|
284
|
+
:percentile_computation => :percentileComputation,
|
285
|
+
:enable_ab_test => :enableABTest,
|
286
|
+
:attributes_for_faceting => :attributesForFaceting,
|
287
|
+
:attributes_to_retrieve => :attributesToRetrieve,
|
288
|
+
:ranking => :ranking,
|
289
|
+
:custom_ranking => :customRanking,
|
290
|
+
:relevancy_strictness => :relevancyStrictness,
|
291
|
+
:attributes_to_highlight => :attributesToHighlight,
|
292
|
+
:attributes_to_snippet => :attributesToSnippet,
|
293
|
+
:highlight_pre_tag => :highlightPreTag,
|
294
|
+
:highlight_post_tag => :highlightPostTag,
|
295
|
+
:snippet_ellipsis_text => :snippetEllipsisText,
|
296
|
+
:restrict_highlight_and_snippet_arrays => :restrictHighlightAndSnippetArrays,
|
297
|
+
:hits_per_page => :hitsPerPage,
|
298
|
+
:min_word_sizefor1_typo => :minWordSizefor1Typo,
|
299
|
+
:min_word_sizefor2_typos => :minWordSizefor2Typos,
|
300
|
+
:typo_tolerance => :typoTolerance,
|
301
|
+
:allow_typos_on_numeric_tokens => :allowTyposOnNumericTokens,
|
302
|
+
:disable_typo_tolerance_on_attributes => :disableTypoToleranceOnAttributes,
|
303
|
+
:ignore_plurals => :ignorePlurals,
|
304
|
+
:remove_stop_words => :removeStopWords,
|
305
|
+
:keep_diacritics_on_characters => :keepDiacriticsOnCharacters,
|
306
|
+
:query_languages => :queryLanguages,
|
307
|
+
:decompound_query => :decompoundQuery,
|
308
|
+
:enable_rules => :enableRules,
|
309
|
+
:enable_personalization => :enablePersonalization,
|
310
|
+
:query_type => :queryType,
|
311
|
+
:remove_words_if_no_results => :removeWordsIfNoResults,
|
312
|
+
:mode => :mode,
|
313
|
+
:semantic_search => :semanticSearch,
|
314
|
+
:advanced_syntax => :advancedSyntax,
|
315
|
+
:optional_words => :optionalWords,
|
316
|
+
:disable_exact_on_attributes => :disableExactOnAttributes,
|
317
|
+
:exact_on_single_word_query => :exactOnSingleWordQuery,
|
318
|
+
:alternatives_as_exact => :alternativesAsExact,
|
319
|
+
:advanced_syntax_features => :advancedSyntaxFeatures,
|
320
|
+
:distinct => :distinct,
|
321
|
+
:replace_synonyms_in_highlight => :replaceSynonymsInHighlight,
|
322
|
+
:min_proximity => :minProximity,
|
323
|
+
:response_fields => :responseFields,
|
324
|
+
:max_facet_hits => :maxFacetHits,
|
325
|
+
:max_values_per_facet => :maxValuesPerFacet,
|
326
|
+
:sort_facet_values_by => :sortFacetValuesBy,
|
327
|
+
:attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
|
328
|
+
:rendering_content => :renderingContent,
|
329
|
+
:enable_re_ranking => :enableReRanking,
|
330
|
+
:re_ranking_apply_filter => :reRankingApplyFilter,
|
331
|
+
:query => :query,
|
332
|
+
:automatic_facet_filters => :automaticFacetFilters,
|
333
|
+
:automatic_optional_facet_filters => :automaticOptionalFacetFilters
|
334
|
+
}
|
335
|
+
end
|
336
|
+
|
337
|
+
# Returns all the JSON keys this model knows about
|
338
|
+
def self.acceptable_attributes
|
339
|
+
attribute_map.values
|
340
|
+
end
|
341
|
+
|
342
|
+
# Attribute type mapping.
|
343
|
+
def self.types_mapping
|
344
|
+
{
|
345
|
+
:similar_query => :String,
|
346
|
+
:filters => :String,
|
347
|
+
:facet_filters => :FacetFilters,
|
348
|
+
:optional_filters => :OptionalFilters,
|
349
|
+
:numeric_filters => :NumericFilters,
|
350
|
+
:tag_filters => :TagFilters,
|
351
|
+
:sum_or_filters_scores => :Boolean,
|
352
|
+
:restrict_searchable_attributes => :'Array<String>',
|
353
|
+
:facets => :'Array<String>',
|
354
|
+
:faceting_after_distinct => :Boolean,
|
355
|
+
:page => :Integer,
|
356
|
+
:offset => :Integer,
|
357
|
+
:length => :Integer,
|
358
|
+
:around_lat_lng => :String,
|
359
|
+
:around_lat_lng_via_ip => :Boolean,
|
360
|
+
:around_radius => :AroundRadius,
|
361
|
+
:around_precision => :AroundPrecision,
|
362
|
+
:minimum_around_radius => :Integer,
|
363
|
+
:inside_bounding_box => :'Array<Array<Float>>',
|
364
|
+
:inside_polygon => :'Array<Array<Float>>',
|
365
|
+
:natural_languages => :'Array<String>',
|
366
|
+
:rule_contexts => :'Array<String>',
|
367
|
+
:personalization_impact => :Integer,
|
368
|
+
:user_token => :String,
|
369
|
+
:get_ranking_info => :Boolean,
|
370
|
+
:explain => :'Array<String>',
|
371
|
+
:synonyms => :Boolean,
|
372
|
+
:click_analytics => :Boolean,
|
373
|
+
:analytics => :Boolean,
|
374
|
+
:analytics_tags => :'Array<String>',
|
375
|
+
:percentile_computation => :Boolean,
|
376
|
+
:enable_ab_test => :Boolean,
|
377
|
+
:attributes_for_faceting => :'Array<String>',
|
378
|
+
:attributes_to_retrieve => :'Array<String>',
|
379
|
+
:ranking => :'Array<String>',
|
380
|
+
:custom_ranking => :'Array<String>',
|
381
|
+
:relevancy_strictness => :Integer,
|
382
|
+
:attributes_to_highlight => :'Array<String>',
|
383
|
+
:attributes_to_snippet => :'Array<String>',
|
384
|
+
:highlight_pre_tag => :String,
|
385
|
+
:highlight_post_tag => :String,
|
386
|
+
:snippet_ellipsis_text => :String,
|
387
|
+
:restrict_highlight_and_snippet_arrays => :Boolean,
|
388
|
+
:hits_per_page => :Integer,
|
389
|
+
:min_word_sizefor1_typo => :Integer,
|
390
|
+
:min_word_sizefor2_typos => :Integer,
|
391
|
+
:typo_tolerance => :TypoTolerance,
|
392
|
+
:allow_typos_on_numeric_tokens => :Boolean,
|
393
|
+
:disable_typo_tolerance_on_attributes => :'Array<String>',
|
394
|
+
:ignore_plurals => :IgnorePlurals,
|
395
|
+
:remove_stop_words => :RemoveStopWords,
|
396
|
+
:keep_diacritics_on_characters => :String,
|
397
|
+
:query_languages => :'Array<String>',
|
398
|
+
:decompound_query => :Boolean,
|
399
|
+
:enable_rules => :Boolean,
|
400
|
+
:enable_personalization => :Boolean,
|
401
|
+
:query_type => :QueryType,
|
402
|
+
:remove_words_if_no_results => :RemoveWordsIfNoResults,
|
403
|
+
:mode => :Mode,
|
404
|
+
:semantic_search => :SemanticSearch,
|
405
|
+
:advanced_syntax => :Boolean,
|
406
|
+
:optional_words => :'Array<String>',
|
407
|
+
:disable_exact_on_attributes => :'Array<String>',
|
408
|
+
:exact_on_single_word_query => :ExactOnSingleWordQuery,
|
409
|
+
:alternatives_as_exact => :'Array<AlternativesAsExact>',
|
410
|
+
:advanced_syntax_features => :'Array<AdvancedSyntaxFeatures>',
|
411
|
+
:distinct => :Distinct,
|
412
|
+
:replace_synonyms_in_highlight => :Boolean,
|
413
|
+
:min_proximity => :Integer,
|
414
|
+
:response_fields => :'Array<String>',
|
415
|
+
:max_facet_hits => :Integer,
|
416
|
+
:max_values_per_facet => :Integer,
|
417
|
+
:sort_facet_values_by => :String,
|
418
|
+
:attribute_criteria_computed_by_min_proximity => :Boolean,
|
419
|
+
:rendering_content => :RenderingContent,
|
420
|
+
:enable_re_ranking => :Boolean,
|
421
|
+
:re_ranking_apply_filter => :ReRankingApplyFilter,
|
422
|
+
:query => :ConsequenceQuery,
|
423
|
+
:automatic_facet_filters => :AutomaticFacetFilters,
|
424
|
+
:automatic_optional_facet_filters => :AutomaticFacetFilters
|
425
|
+
}
|
426
|
+
end
|
427
|
+
|
428
|
+
# List of attributes with nullable: true
|
429
|
+
def self.openapi_nullable
|
430
|
+
Set.new([
|
431
|
+
:re_ranking_apply_filter
|
432
|
+
])
|
433
|
+
end
|
434
|
+
|
435
|
+
# List of class defined in allOf (OpenAPI v3)
|
436
|
+
def self.openapi_all_of
|
437
|
+
[
|
438
|
+
:BaseSearchParamsWithoutQuery,
|
439
|
+
:IndexSettingsAsSearchParams,
|
440
|
+
:Params
|
441
|
+
]
|
442
|
+
end
|
443
|
+
|
444
|
+
# Initializes the object
|
445
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
446
|
+
def initialize(attributes = {})
|
447
|
+
unless attributes.is_a?(Hash)
|
448
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::ConsequenceParams` initialize method"
|
449
|
+
end
|
450
|
+
|
451
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
452
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
453
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
454
|
+
raise ArgumentError,
|
455
|
+
"`#{k}` is not a valid attribute in `Algolia::ConsequenceParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
456
|
+
end
|
457
|
+
|
458
|
+
h[k.to_sym] = v
|
459
|
+
end
|
460
|
+
|
461
|
+
if attributes.key?(:similar_query)
|
462
|
+
self.similar_query = attributes[:similar_query]
|
463
|
+
end
|
464
|
+
|
465
|
+
if attributes.key?(:filters)
|
466
|
+
self.filters = attributes[:filters]
|
467
|
+
end
|
468
|
+
|
469
|
+
if attributes.key?(:facet_filters)
|
470
|
+
self.facet_filters = attributes[:facet_filters]
|
471
|
+
end
|
472
|
+
|
473
|
+
if attributes.key?(:optional_filters)
|
474
|
+
self.optional_filters = attributes[:optional_filters]
|
475
|
+
end
|
476
|
+
|
477
|
+
if attributes.key?(:numeric_filters)
|
478
|
+
self.numeric_filters = attributes[:numeric_filters]
|
479
|
+
end
|
480
|
+
|
481
|
+
if attributes.key?(:tag_filters)
|
482
|
+
self.tag_filters = attributes[:tag_filters]
|
483
|
+
end
|
484
|
+
|
485
|
+
if attributes.key?(:sum_or_filters_scores)
|
486
|
+
self.sum_or_filters_scores = attributes[:sum_or_filters_scores]
|
487
|
+
end
|
488
|
+
|
489
|
+
if attributes.key?(:restrict_searchable_attributes)
|
490
|
+
if (value = attributes[:restrict_searchable_attributes]).is_a?(Array)
|
491
|
+
self.restrict_searchable_attributes = value
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
495
|
+
if attributes.key?(:facets)
|
496
|
+
if (value = attributes[:facets]).is_a?(Array)
|
497
|
+
self.facets = value
|
498
|
+
end
|
499
|
+
end
|
500
|
+
|
501
|
+
if attributes.key?(:faceting_after_distinct)
|
502
|
+
self.faceting_after_distinct = attributes[:faceting_after_distinct]
|
503
|
+
end
|
504
|
+
|
505
|
+
if attributes.key?(:page)
|
506
|
+
self.page = attributes[:page]
|
507
|
+
end
|
508
|
+
|
509
|
+
if attributes.key?(:offset)
|
510
|
+
self.offset = attributes[:offset]
|
511
|
+
end
|
512
|
+
|
513
|
+
if attributes.key?(:length)
|
514
|
+
self.length = attributes[:length]
|
515
|
+
end
|
516
|
+
|
517
|
+
if attributes.key?(:around_lat_lng)
|
518
|
+
self.around_lat_lng = attributes[:around_lat_lng]
|
519
|
+
end
|
520
|
+
|
521
|
+
if attributes.key?(:around_lat_lng_via_ip)
|
522
|
+
self.around_lat_lng_via_ip = attributes[:around_lat_lng_via_ip]
|
523
|
+
end
|
524
|
+
|
525
|
+
if attributes.key?(:around_radius)
|
526
|
+
self.around_radius = attributes[:around_radius]
|
527
|
+
end
|
528
|
+
|
529
|
+
if attributes.key?(:around_precision)
|
530
|
+
self.around_precision = attributes[:around_precision]
|
531
|
+
end
|
532
|
+
|
533
|
+
if attributes.key?(:minimum_around_radius)
|
534
|
+
self.minimum_around_radius = attributes[:minimum_around_radius]
|
535
|
+
end
|
536
|
+
|
537
|
+
if attributes.key?(:inside_bounding_box)
|
538
|
+
if (value = attributes[:inside_bounding_box]).is_a?(Array)
|
539
|
+
self.inside_bounding_box = value
|
540
|
+
end
|
541
|
+
end
|
542
|
+
|
543
|
+
if attributes.key?(:inside_polygon)
|
544
|
+
if (value = attributes[:inside_polygon]).is_a?(Array)
|
545
|
+
self.inside_polygon = value
|
546
|
+
end
|
547
|
+
end
|
548
|
+
|
549
|
+
if attributes.key?(:natural_languages)
|
550
|
+
if (value = attributes[:natural_languages]).is_a?(Array)
|
551
|
+
self.natural_languages = value
|
552
|
+
end
|
553
|
+
end
|
554
|
+
|
555
|
+
if attributes.key?(:rule_contexts)
|
556
|
+
if (value = attributes[:rule_contexts]).is_a?(Array)
|
557
|
+
self.rule_contexts = value
|
558
|
+
end
|
559
|
+
end
|
560
|
+
|
561
|
+
if attributes.key?(:personalization_impact)
|
562
|
+
self.personalization_impact = attributes[:personalization_impact]
|
563
|
+
end
|
564
|
+
|
565
|
+
if attributes.key?(:user_token)
|
566
|
+
self.user_token = attributes[:user_token]
|
567
|
+
end
|
568
|
+
|
569
|
+
if attributes.key?(:get_ranking_info)
|
570
|
+
self.get_ranking_info = attributes[:get_ranking_info]
|
571
|
+
end
|
572
|
+
|
573
|
+
if attributes.key?(:explain)
|
574
|
+
if (value = attributes[:explain]).is_a?(Array)
|
575
|
+
self.explain = value
|
576
|
+
end
|
577
|
+
end
|
578
|
+
|
579
|
+
if attributes.key?(:synonyms)
|
580
|
+
self.synonyms = attributes[:synonyms]
|
581
|
+
end
|
582
|
+
|
583
|
+
if attributes.key?(:click_analytics)
|
584
|
+
self.click_analytics = attributes[:click_analytics]
|
585
|
+
end
|
586
|
+
|
587
|
+
if attributes.key?(:analytics)
|
588
|
+
self.analytics = attributes[:analytics]
|
589
|
+
end
|
590
|
+
|
591
|
+
if attributes.key?(:analytics_tags)
|
592
|
+
if (value = attributes[:analytics_tags]).is_a?(Array)
|
593
|
+
self.analytics_tags = value
|
594
|
+
end
|
595
|
+
end
|
596
|
+
|
597
|
+
if attributes.key?(:percentile_computation)
|
598
|
+
self.percentile_computation = attributes[:percentile_computation]
|
599
|
+
end
|
600
|
+
|
601
|
+
if attributes.key?(:enable_ab_test)
|
602
|
+
self.enable_ab_test = attributes[:enable_ab_test]
|
603
|
+
end
|
604
|
+
|
605
|
+
if attributes.key?(:attributes_for_faceting)
|
606
|
+
if (value = attributes[:attributes_for_faceting]).is_a?(Array)
|
607
|
+
self.attributes_for_faceting = value
|
608
|
+
end
|
609
|
+
end
|
610
|
+
|
611
|
+
if attributes.key?(:attributes_to_retrieve)
|
612
|
+
if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
|
613
|
+
self.attributes_to_retrieve = value
|
614
|
+
end
|
615
|
+
end
|
616
|
+
|
617
|
+
if attributes.key?(:ranking)
|
618
|
+
if (value = attributes[:ranking]).is_a?(Array)
|
619
|
+
self.ranking = value
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
if attributes.key?(:custom_ranking)
|
624
|
+
if (value = attributes[:custom_ranking]).is_a?(Array)
|
625
|
+
self.custom_ranking = value
|
626
|
+
end
|
627
|
+
end
|
628
|
+
|
629
|
+
if attributes.key?(:relevancy_strictness)
|
630
|
+
self.relevancy_strictness = attributes[:relevancy_strictness]
|
631
|
+
end
|
632
|
+
|
633
|
+
if attributes.key?(:attributes_to_highlight)
|
634
|
+
if (value = attributes[:attributes_to_highlight]).is_a?(Array)
|
635
|
+
self.attributes_to_highlight = value
|
636
|
+
end
|
637
|
+
end
|
638
|
+
|
639
|
+
if attributes.key?(:attributes_to_snippet)
|
640
|
+
if (value = attributes[:attributes_to_snippet]).is_a?(Array)
|
641
|
+
self.attributes_to_snippet = value
|
642
|
+
end
|
643
|
+
end
|
644
|
+
|
645
|
+
if attributes.key?(:highlight_pre_tag)
|
646
|
+
self.highlight_pre_tag = attributes[:highlight_pre_tag]
|
647
|
+
end
|
648
|
+
|
649
|
+
if attributes.key?(:highlight_post_tag)
|
650
|
+
self.highlight_post_tag = attributes[:highlight_post_tag]
|
651
|
+
end
|
652
|
+
|
653
|
+
if attributes.key?(:snippet_ellipsis_text)
|
654
|
+
self.snippet_ellipsis_text = attributes[:snippet_ellipsis_text]
|
655
|
+
end
|
656
|
+
|
657
|
+
if attributes.key?(:restrict_highlight_and_snippet_arrays)
|
658
|
+
self.restrict_highlight_and_snippet_arrays = attributes[:restrict_highlight_and_snippet_arrays]
|
659
|
+
end
|
660
|
+
|
661
|
+
if attributes.key?(:hits_per_page)
|
662
|
+
self.hits_per_page = attributes[:hits_per_page]
|
663
|
+
end
|
664
|
+
|
665
|
+
if attributes.key?(:min_word_sizefor1_typo)
|
666
|
+
self.min_word_sizefor1_typo = attributes[:min_word_sizefor1_typo]
|
667
|
+
end
|
668
|
+
|
669
|
+
if attributes.key?(:min_word_sizefor2_typos)
|
670
|
+
self.min_word_sizefor2_typos = attributes[:min_word_sizefor2_typos]
|
671
|
+
end
|
672
|
+
|
673
|
+
if attributes.key?(:typo_tolerance)
|
674
|
+
self.typo_tolerance = attributes[:typo_tolerance]
|
675
|
+
end
|
676
|
+
|
677
|
+
if attributes.key?(:allow_typos_on_numeric_tokens)
|
678
|
+
self.allow_typos_on_numeric_tokens = attributes[:allow_typos_on_numeric_tokens]
|
679
|
+
end
|
680
|
+
|
681
|
+
if attributes.key?(:disable_typo_tolerance_on_attributes)
|
682
|
+
if (value = attributes[:disable_typo_tolerance_on_attributes]).is_a?(Array)
|
683
|
+
self.disable_typo_tolerance_on_attributes = value
|
684
|
+
end
|
685
|
+
end
|
686
|
+
|
687
|
+
if attributes.key?(:ignore_plurals)
|
688
|
+
self.ignore_plurals = attributes[:ignore_plurals]
|
689
|
+
end
|
690
|
+
|
691
|
+
if attributes.key?(:remove_stop_words)
|
692
|
+
self.remove_stop_words = attributes[:remove_stop_words]
|
693
|
+
end
|
694
|
+
|
695
|
+
if attributes.key?(:keep_diacritics_on_characters)
|
696
|
+
self.keep_diacritics_on_characters = attributes[:keep_diacritics_on_characters]
|
697
|
+
end
|
698
|
+
|
699
|
+
if attributes.key?(:query_languages)
|
700
|
+
if (value = attributes[:query_languages]).is_a?(Array)
|
701
|
+
self.query_languages = value
|
702
|
+
end
|
703
|
+
end
|
704
|
+
|
705
|
+
if attributes.key?(:decompound_query)
|
706
|
+
self.decompound_query = attributes[:decompound_query]
|
707
|
+
end
|
708
|
+
|
709
|
+
if attributes.key?(:enable_rules)
|
710
|
+
self.enable_rules = attributes[:enable_rules]
|
711
|
+
end
|
712
|
+
|
713
|
+
if attributes.key?(:enable_personalization)
|
714
|
+
self.enable_personalization = attributes[:enable_personalization]
|
715
|
+
end
|
716
|
+
|
717
|
+
if attributes.key?(:query_type)
|
718
|
+
self.query_type = attributes[:query_type]
|
719
|
+
end
|
720
|
+
|
721
|
+
if attributes.key?(:remove_words_if_no_results)
|
722
|
+
self.remove_words_if_no_results = attributes[:remove_words_if_no_results]
|
723
|
+
end
|
724
|
+
|
725
|
+
if attributes.key?(:mode)
|
726
|
+
self.mode = attributes[:mode]
|
727
|
+
end
|
728
|
+
|
729
|
+
if attributes.key?(:semantic_search)
|
730
|
+
self.semantic_search = attributes[:semantic_search]
|
731
|
+
end
|
732
|
+
|
733
|
+
if attributes.key?(:advanced_syntax)
|
734
|
+
self.advanced_syntax = attributes[:advanced_syntax]
|
735
|
+
end
|
736
|
+
|
737
|
+
if attributes.key?(:optional_words)
|
738
|
+
if (value = attributes[:optional_words]).is_a?(Array)
|
739
|
+
self.optional_words = value
|
740
|
+
end
|
741
|
+
end
|
742
|
+
|
743
|
+
if attributes.key?(:disable_exact_on_attributes)
|
744
|
+
if (value = attributes[:disable_exact_on_attributes]).is_a?(Array)
|
745
|
+
self.disable_exact_on_attributes = value
|
746
|
+
end
|
747
|
+
end
|
748
|
+
|
749
|
+
if attributes.key?(:exact_on_single_word_query)
|
750
|
+
self.exact_on_single_word_query = attributes[:exact_on_single_word_query]
|
751
|
+
end
|
752
|
+
|
753
|
+
if attributes.key?(:alternatives_as_exact)
|
754
|
+
if (value = attributes[:alternatives_as_exact]).is_a?(Array)
|
755
|
+
self.alternatives_as_exact = value
|
756
|
+
end
|
757
|
+
end
|
758
|
+
|
759
|
+
if attributes.key?(:advanced_syntax_features)
|
760
|
+
if (value = attributes[:advanced_syntax_features]).is_a?(Array)
|
761
|
+
self.advanced_syntax_features = value
|
762
|
+
end
|
763
|
+
end
|
764
|
+
|
765
|
+
if attributes.key?(:distinct)
|
766
|
+
self.distinct = attributes[:distinct]
|
767
|
+
end
|
768
|
+
|
769
|
+
if attributes.key?(:replace_synonyms_in_highlight)
|
770
|
+
self.replace_synonyms_in_highlight = attributes[:replace_synonyms_in_highlight]
|
771
|
+
end
|
772
|
+
|
773
|
+
if attributes.key?(:min_proximity)
|
774
|
+
self.min_proximity = attributes[:min_proximity]
|
775
|
+
end
|
776
|
+
|
777
|
+
if attributes.key?(:response_fields)
|
778
|
+
if (value = attributes[:response_fields]).is_a?(Array)
|
779
|
+
self.response_fields = value
|
780
|
+
end
|
781
|
+
end
|
782
|
+
|
783
|
+
if attributes.key?(:max_facet_hits)
|
784
|
+
self.max_facet_hits = attributes[:max_facet_hits]
|
785
|
+
end
|
786
|
+
|
787
|
+
if attributes.key?(:max_values_per_facet)
|
788
|
+
self.max_values_per_facet = attributes[:max_values_per_facet]
|
789
|
+
end
|
790
|
+
|
791
|
+
if attributes.key?(:sort_facet_values_by)
|
792
|
+
self.sort_facet_values_by = attributes[:sort_facet_values_by]
|
793
|
+
end
|
794
|
+
|
795
|
+
if attributes.key?(:attribute_criteria_computed_by_min_proximity)
|
796
|
+
self.attribute_criteria_computed_by_min_proximity = attributes[:attribute_criteria_computed_by_min_proximity]
|
797
|
+
end
|
798
|
+
|
799
|
+
if attributes.key?(:rendering_content)
|
800
|
+
self.rendering_content = attributes[:rendering_content]
|
801
|
+
end
|
802
|
+
|
803
|
+
if attributes.key?(:enable_re_ranking)
|
804
|
+
self.enable_re_ranking = attributes[:enable_re_ranking]
|
805
|
+
end
|
806
|
+
|
807
|
+
if attributes.key?(:re_ranking_apply_filter)
|
808
|
+
self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
|
809
|
+
end
|
810
|
+
|
811
|
+
if attributes.key?(:query)
|
812
|
+
self.query = attributes[:query]
|
813
|
+
end
|
814
|
+
|
815
|
+
if attributes.key?(:automatic_facet_filters)
|
816
|
+
self.automatic_facet_filters = attributes[:automatic_facet_filters]
|
817
|
+
end
|
818
|
+
|
819
|
+
if attributes.key?(:automatic_optional_facet_filters)
|
820
|
+
self.automatic_optional_facet_filters = attributes[:automatic_optional_facet_filters]
|
821
|
+
end
|
822
|
+
end
|
823
|
+
|
824
|
+
# Custom attribute writer method with validation
|
825
|
+
# @param [Object] length Value to be assigned
|
826
|
+
def length=(length)
|
827
|
+
if length.nil?
|
828
|
+
raise ArgumentError, 'length cannot be nil'
|
829
|
+
end
|
830
|
+
|
831
|
+
if length > 1000
|
832
|
+
raise ArgumentError, 'invalid value for "length", must be smaller than or equal to 1000.'
|
833
|
+
end
|
834
|
+
|
835
|
+
if length < 1
|
836
|
+
raise ArgumentError, 'invalid value for "length", must be greater than or equal to 1.'
|
837
|
+
end
|
838
|
+
|
839
|
+
@length = length
|
840
|
+
end
|
841
|
+
|
842
|
+
# Custom attribute writer method with validation
|
843
|
+
# @param [Object] minimum_around_radius Value to be assigned
|
844
|
+
def minimum_around_radius=(minimum_around_radius)
|
845
|
+
if minimum_around_radius.nil?
|
846
|
+
raise ArgumentError, 'minimum_around_radius cannot be nil'
|
847
|
+
end
|
848
|
+
|
849
|
+
if minimum_around_radius < 1
|
850
|
+
raise ArgumentError, 'invalid value for "minimum_around_radius", must be greater than or equal to 1.'
|
851
|
+
end
|
852
|
+
|
853
|
+
@minimum_around_radius = minimum_around_radius
|
854
|
+
end
|
855
|
+
|
856
|
+
# Custom attribute writer method with validation
|
857
|
+
# @param [Object] hits_per_page Value to be assigned
|
858
|
+
def hits_per_page=(hits_per_page)
|
859
|
+
if hits_per_page.nil?
|
860
|
+
raise ArgumentError, 'hits_per_page cannot be nil'
|
861
|
+
end
|
862
|
+
|
863
|
+
if hits_per_page > 1000
|
864
|
+
raise ArgumentError, 'invalid value for "hits_per_page", must be smaller than or equal to 1000.'
|
865
|
+
end
|
866
|
+
|
867
|
+
if hits_per_page < 1
|
868
|
+
raise ArgumentError, 'invalid value for "hits_per_page", must be greater than or equal to 1.'
|
869
|
+
end
|
870
|
+
|
871
|
+
@hits_per_page = hits_per_page
|
872
|
+
end
|
873
|
+
|
874
|
+
# Custom attribute writer method with validation
|
875
|
+
# @param [Object] min_proximity Value to be assigned
|
876
|
+
def min_proximity=(min_proximity)
|
877
|
+
if min_proximity.nil?
|
878
|
+
raise ArgumentError, 'min_proximity cannot be nil'
|
879
|
+
end
|
880
|
+
|
881
|
+
if min_proximity > 7
|
882
|
+
raise ArgumentError, 'invalid value for "min_proximity", must be smaller than or equal to 7.'
|
883
|
+
end
|
884
|
+
|
885
|
+
if min_proximity < 1
|
886
|
+
raise ArgumentError, 'invalid value for "min_proximity", must be greater than or equal to 1.'
|
887
|
+
end
|
888
|
+
|
889
|
+
@min_proximity = min_proximity
|
890
|
+
end
|
891
|
+
|
892
|
+
# Custom attribute writer method with validation
|
893
|
+
# @param [Object] max_facet_hits Value to be assigned
|
894
|
+
def max_facet_hits=(max_facet_hits)
|
895
|
+
if max_facet_hits.nil?
|
896
|
+
raise ArgumentError, 'max_facet_hits cannot be nil'
|
897
|
+
end
|
898
|
+
|
899
|
+
if max_facet_hits > 100
|
900
|
+
raise ArgumentError, 'invalid value for "max_facet_hits", must be smaller than or equal to 100.'
|
901
|
+
end
|
902
|
+
|
903
|
+
@max_facet_hits = max_facet_hits
|
904
|
+
end
|
905
|
+
|
906
|
+
# Checks equality by comparing each attribute.
|
907
|
+
# @param [Object] Object to be compared
|
908
|
+
def ==(other)
|
909
|
+
return true if equal?(other)
|
910
|
+
|
911
|
+
self.class == other.class &&
|
912
|
+
similar_query == other.similar_query &&
|
913
|
+
filters == other.filters &&
|
914
|
+
facet_filters == other.facet_filters &&
|
915
|
+
optional_filters == other.optional_filters &&
|
916
|
+
numeric_filters == other.numeric_filters &&
|
917
|
+
tag_filters == other.tag_filters &&
|
918
|
+
sum_or_filters_scores == other.sum_or_filters_scores &&
|
919
|
+
restrict_searchable_attributes == other.restrict_searchable_attributes &&
|
920
|
+
facets == other.facets &&
|
921
|
+
faceting_after_distinct == other.faceting_after_distinct &&
|
922
|
+
page == other.page &&
|
923
|
+
offset == other.offset &&
|
924
|
+
length == other.length &&
|
925
|
+
around_lat_lng == other.around_lat_lng &&
|
926
|
+
around_lat_lng_via_ip == other.around_lat_lng_via_ip &&
|
927
|
+
around_radius == other.around_radius &&
|
928
|
+
around_precision == other.around_precision &&
|
929
|
+
minimum_around_radius == other.minimum_around_radius &&
|
930
|
+
inside_bounding_box == other.inside_bounding_box &&
|
931
|
+
inside_polygon == other.inside_polygon &&
|
932
|
+
natural_languages == other.natural_languages &&
|
933
|
+
rule_contexts == other.rule_contexts &&
|
934
|
+
personalization_impact == other.personalization_impact &&
|
935
|
+
user_token == other.user_token &&
|
936
|
+
get_ranking_info == other.get_ranking_info &&
|
937
|
+
explain == other.explain &&
|
938
|
+
synonyms == other.synonyms &&
|
939
|
+
click_analytics == other.click_analytics &&
|
940
|
+
analytics == other.analytics &&
|
941
|
+
analytics_tags == other.analytics_tags &&
|
942
|
+
percentile_computation == other.percentile_computation &&
|
943
|
+
enable_ab_test == other.enable_ab_test &&
|
944
|
+
attributes_for_faceting == other.attributes_for_faceting &&
|
945
|
+
attributes_to_retrieve == other.attributes_to_retrieve &&
|
946
|
+
ranking == other.ranking &&
|
947
|
+
custom_ranking == other.custom_ranking &&
|
948
|
+
relevancy_strictness == other.relevancy_strictness &&
|
949
|
+
attributes_to_highlight == other.attributes_to_highlight &&
|
950
|
+
attributes_to_snippet == other.attributes_to_snippet &&
|
951
|
+
highlight_pre_tag == other.highlight_pre_tag &&
|
952
|
+
highlight_post_tag == other.highlight_post_tag &&
|
953
|
+
snippet_ellipsis_text == other.snippet_ellipsis_text &&
|
954
|
+
restrict_highlight_and_snippet_arrays == other.restrict_highlight_and_snippet_arrays &&
|
955
|
+
hits_per_page == other.hits_per_page &&
|
956
|
+
min_word_sizefor1_typo == other.min_word_sizefor1_typo &&
|
957
|
+
min_word_sizefor2_typos == other.min_word_sizefor2_typos &&
|
958
|
+
typo_tolerance == other.typo_tolerance &&
|
959
|
+
allow_typos_on_numeric_tokens == other.allow_typos_on_numeric_tokens &&
|
960
|
+
disable_typo_tolerance_on_attributes == other.disable_typo_tolerance_on_attributes &&
|
961
|
+
ignore_plurals == other.ignore_plurals &&
|
962
|
+
remove_stop_words == other.remove_stop_words &&
|
963
|
+
keep_diacritics_on_characters == other.keep_diacritics_on_characters &&
|
964
|
+
query_languages == other.query_languages &&
|
965
|
+
decompound_query == other.decompound_query &&
|
966
|
+
enable_rules == other.enable_rules &&
|
967
|
+
enable_personalization == other.enable_personalization &&
|
968
|
+
query_type == other.query_type &&
|
969
|
+
remove_words_if_no_results == other.remove_words_if_no_results &&
|
970
|
+
mode == other.mode &&
|
971
|
+
semantic_search == other.semantic_search &&
|
972
|
+
advanced_syntax == other.advanced_syntax &&
|
973
|
+
optional_words == other.optional_words &&
|
974
|
+
disable_exact_on_attributes == other.disable_exact_on_attributes &&
|
975
|
+
exact_on_single_word_query == other.exact_on_single_word_query &&
|
976
|
+
alternatives_as_exact == other.alternatives_as_exact &&
|
977
|
+
advanced_syntax_features == other.advanced_syntax_features &&
|
978
|
+
distinct == other.distinct &&
|
979
|
+
replace_synonyms_in_highlight == other.replace_synonyms_in_highlight &&
|
980
|
+
min_proximity == other.min_proximity &&
|
981
|
+
response_fields == other.response_fields &&
|
982
|
+
max_facet_hits == other.max_facet_hits &&
|
983
|
+
max_values_per_facet == other.max_values_per_facet &&
|
984
|
+
sort_facet_values_by == other.sort_facet_values_by &&
|
985
|
+
attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
|
986
|
+
rendering_content == other.rendering_content &&
|
987
|
+
enable_re_ranking == other.enable_re_ranking &&
|
988
|
+
re_ranking_apply_filter == other.re_ranking_apply_filter &&
|
989
|
+
query == other.query &&
|
990
|
+
automatic_facet_filters == other.automatic_facet_filters &&
|
991
|
+
automatic_optional_facet_filters == other.automatic_optional_facet_filters
|
992
|
+
end
|
993
|
+
|
994
|
+
# @see the `==` method
|
995
|
+
# @param [Object] Object to be compared
|
996
|
+
def eql?(other)
|
997
|
+
self == other
|
998
|
+
end
|
999
|
+
|
1000
|
+
# Calculates hash code according to all attributes.
|
1001
|
+
# @return [Integer] Hash code
|
1002
|
+
def hash
|
1003
|
+
[similar_query, filters, facet_filters, optional_filters, numeric_filters, tag_filters, sum_or_filters_scores, restrict_searchable_attributes, facets,
|
1004
|
+
faceting_after_distinct, page, offset, length, around_lat_lng, around_lat_lng_via_ip, around_radius, around_precision, minimum_around_radius, inside_bounding_box, inside_polygon, natural_languages, rule_contexts, personalization_impact, user_token, get_ranking_info, explain, synonyms, click_analytics, analytics, analytics_tags, percentile_computation, enable_ab_test, attributes_for_faceting, attributes_to_retrieve, ranking, custom_ranking, relevancy_strictness, attributes_to_highlight, attributes_to_snippet, highlight_pre_tag, highlight_post_tag, snippet_ellipsis_text, restrict_highlight_and_snippet_arrays, hits_per_page, min_word_sizefor1_typo, min_word_sizefor2_typos, typo_tolerance, allow_typos_on_numeric_tokens, disable_typo_tolerance_on_attributes, ignore_plurals, remove_stop_words, keep_diacritics_on_characters, query_languages, decompound_query, enable_rules, enable_personalization, query_type, remove_words_if_no_results, mode, semantic_search, advanced_syntax, optional_words, disable_exact_on_attributes, exact_on_single_word_query, alternatives_as_exact, advanced_syntax_features, distinct, replace_synonyms_in_highlight, min_proximity, response_fields, max_facet_hits, max_values_per_facet, sort_facet_values_by, attribute_criteria_computed_by_min_proximity, rendering_content, enable_re_ranking, re_ranking_apply_filter, query, automatic_facet_filters, automatic_optional_facet_filters].hash
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
# Builds the object from hash
|
1008
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
1009
|
+
# @return [Object] Returns the model itself
|
1010
|
+
def self.build_from_hash(attributes)
|
1011
|
+
return nil unless attributes.is_a?(Hash)
|
1012
|
+
|
1013
|
+
attributes = attributes.transform_keys(&:to_sym)
|
1014
|
+
transformed_hash = {}
|
1015
|
+
types_mapping.each_pair do |key, type|
|
1016
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
1017
|
+
transformed_hash[key.to_s] = nil
|
1018
|
+
elsif type =~ /\AArray<(.*)>/i
|
1019
|
+
# check to ensure the input is an array given that the attribute
|
1020
|
+
# is documented as an array but the input is not
|
1021
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
1022
|
+
transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
1023
|
+
end
|
1024
|
+
elsif !attributes[attribute_map[key]].nil?
|
1025
|
+
transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
|
1026
|
+
end
|
1027
|
+
end
|
1028
|
+
new(transformed_hash)
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
# Deserializes the data based on type
|
1032
|
+
# @param string type Data type
|
1033
|
+
# @param string value Value to be deserialized
|
1034
|
+
# @return [Object] Deserialized data
|
1035
|
+
def self._deserialize(type, value)
|
1036
|
+
case type.to_sym
|
1037
|
+
when :Time
|
1038
|
+
Time.parse(value)
|
1039
|
+
when :Date
|
1040
|
+
Date.parse(value)
|
1041
|
+
when :String
|
1042
|
+
value.to_s
|
1043
|
+
when :Integer
|
1044
|
+
value.to_i
|
1045
|
+
when :Float
|
1046
|
+
value.to_f
|
1047
|
+
when :Boolean
|
1048
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
1049
|
+
true
|
1050
|
+
else
|
1051
|
+
false
|
1052
|
+
end
|
1053
|
+
when :Object
|
1054
|
+
# generic object (usually a Hash), return directly
|
1055
|
+
value
|
1056
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
1057
|
+
inner_type = Regexp.last_match[:inner_type]
|
1058
|
+
value.map { |v| _deserialize(inner_type, v) }
|
1059
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
1060
|
+
k_type = Regexp.last_match[:k_type]
|
1061
|
+
v_type = Regexp.last_match[:v_type]
|
1062
|
+
{}.tap do |hash|
|
1063
|
+
value.each do |k, v|
|
1064
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
1065
|
+
end
|
1066
|
+
end
|
1067
|
+
else # model
|
1068
|
+
# models (e.g. Pet) or oneOf
|
1069
|
+
klass = Algolia::Search.const_get(type)
|
1070
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
1071
|
+
end
|
1072
|
+
end
|
1073
|
+
|
1074
|
+
# Returns the string representation of the object
|
1075
|
+
# @return [String] String presentation of the object
|
1076
|
+
def to_s
|
1077
|
+
to_hash.to_s
|
1078
|
+
end
|
1079
|
+
|
1080
|
+
# to_body is an alias to to_hash (backward compatibility)
|
1081
|
+
# @return [Hash] Returns the object in the form of hash
|
1082
|
+
def to_body
|
1083
|
+
to_hash
|
1084
|
+
end
|
1085
|
+
|
1086
|
+
# Returns the object in the form of hash
|
1087
|
+
# @return [Hash] Returns the object in the form of hash
|
1088
|
+
def to_hash
|
1089
|
+
hash = {}
|
1090
|
+
self.class.attribute_map.each_pair do |attr, param|
|
1091
|
+
value = send(attr)
|
1092
|
+
if value.nil?
|
1093
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
1094
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
1095
|
+
end
|
1096
|
+
|
1097
|
+
hash[param] = _to_hash(value)
|
1098
|
+
end
|
1099
|
+
hash
|
1100
|
+
end
|
1101
|
+
|
1102
|
+
# Outputs non-array value in the form of hash
|
1103
|
+
# For object, use to_hash. Otherwise, just return the value
|
1104
|
+
# @param [Object] value Any valid value
|
1105
|
+
# @return [Hash] Returns the value in the form of hash
|
1106
|
+
def _to_hash(value)
|
1107
|
+
if value.is_a?(Array)
|
1108
|
+
value.compact.map { |v| _to_hash(v) }
|
1109
|
+
elsif value.is_a?(Hash)
|
1110
|
+
{}.tap do |hash|
|
1111
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
1112
|
+
end
|
1113
|
+
elsif value.respond_to? :to_hash
|
1114
|
+
value.to_hash
|
1115
|
+
else
|
1116
|
+
value
|
1117
|
+
end
|
1118
|
+
end
|
1119
|
+
end
|
1120
|
+
end
|
1121
|
+
end
|