algolia 2.3.3 → 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 -89
- 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 +523 -218
- 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 -88
- 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
data/upgrade_guide.md
DELETED
@@ -1,603 +0,0 @@
|
|
1
|
-
# Upgrading to v2 of the Ruby API client
|
2
|
-
|
3
|
-
## Gem
|
4
|
-
First, you'll have to include the new version in your Gemfile. To do so, change the following:
|
5
|
-
|
6
|
-
```diff
|
7
|
-
- gem 'algoliasearch'
|
8
|
-
+ gem 'algolia', git: 'https://github.com/algolia/algoliasearch-client-ruby.git', tag: 'v2.0.0-beta.1'
|
9
|
-
```
|
10
|
-
|
11
|
-
Then, you'll need to change your current `require` statements:
|
12
|
-
|
13
|
-
```diff
|
14
|
-
- require 'algoliasearch'
|
15
|
-
+ require 'algolia'
|
16
|
-
```
|
17
|
-
|
18
|
-
## Class names
|
19
|
-
All classes have been namespaced. The mostly used classes are now as follows:
|
20
|
-
|
21
|
-
- `Algolia::Client` -> `Algolia::Search::Client`
|
22
|
-
- `Algolia::Index` -> `Algolia::Search::Index`
|
23
|
-
- `Algolia::AccountClient` -> `Algolia::Account::Client`
|
24
|
-
- `Algolia::Analytics` -> `Algolia::Analytics::Client`
|
25
|
-
- `Algolia::Insights` -> `Algolia::Insights::Client`
|
26
|
-
|
27
|
-
## Initialize the client and index
|
28
|
-
There's a slight change in how you initialize the client. The index initialization didn't change.
|
29
|
-
```ruby
|
30
|
-
# Before
|
31
|
-
client = Algolia::Client.new(
|
32
|
-
application_id: 'APP_ID',
|
33
|
-
api_key: 'API_KEY'
|
34
|
-
)
|
35
|
-
index = client.init_index('index_name')
|
36
|
-
|
37
|
-
# After
|
38
|
-
client = Algolia::Search::Client.create('APP_ID', 'API_KEY')
|
39
|
-
index = client.init_index('index_name')
|
40
|
-
# or
|
41
|
-
search_config = Algolia::Search::Config.new(application_id: app_id, api_key: api_key)
|
42
|
-
client = Algolia::Search::Client.create_with_config(search_config)
|
43
|
-
index = client.init_index('index_name')
|
44
|
-
```
|
45
|
-
|
46
|
-
By default the keys of the response hashes are symbols. If you wish to change that for strings, use the following configuration
|
47
|
-
```ruby
|
48
|
-
search_config = Algolia::Search::Config.new(application_id: app_id, api_key: api_key, symbolize_keys: false)
|
49
|
-
client = Algolia::Search::Client.create_with_config(search_config)
|
50
|
-
```
|
51
|
-
|
52
|
-
## Search parameters and request options
|
53
|
-
The search parameters and request options are still optional, but they are combined into a single hash instead of two.
|
54
|
-
For example:
|
55
|
-
```ruby
|
56
|
-
# Before
|
57
|
-
request_opts = { 'X-Algolia-UserToken': 'user123' }
|
58
|
-
search_params = { hitsPerPage: 50 }
|
59
|
-
|
60
|
-
index.search('query', search_params, request_opts)
|
61
|
-
|
62
|
-
# After
|
63
|
-
opts = {
|
64
|
-
headers: { 'X-Algolia-UserToken': 'user123' },
|
65
|
-
hitsPerPage: 50
|
66
|
-
}
|
67
|
-
index.search('query', opts)
|
68
|
-
```
|
69
|
-
|
70
|
-
## Methods
|
71
|
-
|
72
|
-
### `Client`
|
73
|
-
|
74
|
-
#### `set_extra_header`
|
75
|
-
The `set_extra_header` method has been moved from the Client to the `Algolia::BaseConfig` class. You have to define your extra headers on Client instantiation.
|
76
|
-
```ruby
|
77
|
-
# Before
|
78
|
-
client.set_extra_header('admin', 'admin-key')
|
79
|
-
|
80
|
-
# After
|
81
|
-
# `Algolia::Search::Config` inherits from `Algolia::BaseConfig`
|
82
|
-
config = Algolia::Search::Config.new(app_id: 'APP_ID', api_key: 'API_KEY')
|
83
|
-
config.set_extra_header('admin', 'admin-key')
|
84
|
-
|
85
|
-
client = Algolia::Search::Client.create_with_config(config)
|
86
|
-
```
|
87
|
-
|
88
|
-
#### `multiple_queries`
|
89
|
-
The `strategy` parameter is no longer a string, but a key in the `requestOptions`.
|
90
|
-
```ruby
|
91
|
-
queries = [
|
92
|
-
{ indexName: 'index_name1', params: { query: 'query', hitsPerPage: 2 } },
|
93
|
-
{ indexName: 'index_name2', params: { query: 'another_query', hitsPerPage: 5 } }
|
94
|
-
]
|
95
|
-
|
96
|
-
# Before
|
97
|
-
client.multiple_queries(queries, 'stopIfEnoughMatches')
|
98
|
-
|
99
|
-
# After
|
100
|
-
client.multiple_queries(queries, { strategy: 'stopIfEnoughMatches' })
|
101
|
-
```
|
102
|
-
|
103
|
-
#### `copy_settings`
|
104
|
-
No change.
|
105
|
-
|
106
|
-
#### `list_indexes`
|
107
|
-
No change.
|
108
|
-
|
109
|
-
#### `copy_index`
|
110
|
-
No change.
|
111
|
-
|
112
|
-
#### `move_index`
|
113
|
-
No change.
|
114
|
-
|
115
|
-
#### `generate_secured_api_key`
|
116
|
-
This method is moved to the `Algolia::Search::Client` class.
|
117
|
-
```ruby
|
118
|
-
# Before
|
119
|
-
secured_api_key = Algolia.generate_secured_api_key('api_key', {
|
120
|
-
validUntil: now - (10 * 60)
|
121
|
-
})
|
122
|
-
|
123
|
-
# After
|
124
|
-
secured_api_key = Algolia::Search::Client.generate_secured_api_key('api_key', {
|
125
|
-
validUntil: now - (10 * 60)
|
126
|
-
})
|
127
|
-
```
|
128
|
-
|
129
|
-
#### `add_api_key`
|
130
|
-
`acl` is still the first parameter. The other parameters have been moved to the `requestOptions`.
|
131
|
-
|
132
|
-
```ruby
|
133
|
-
# Before
|
134
|
-
client.add_api_key({ acl: ['search'], description: 'A description', indexes: ['index']})
|
135
|
-
|
136
|
-
# After
|
137
|
-
client.add_api_key(['search'], {
|
138
|
-
description: 'A description',
|
139
|
-
indexes: ['index']
|
140
|
-
})
|
141
|
-
```
|
142
|
-
|
143
|
-
#### `update_api_key`
|
144
|
-
This method is moved to the `Algolia::Search::Client` class.
|
145
|
-
```ruby
|
146
|
-
# Before
|
147
|
-
Algolia.update_api_key('api_key', { maxHitsPerQuery: 42 })
|
148
|
-
|
149
|
-
# After
|
150
|
-
client.update_api_key('api_key', { maxHitsPerQuery: 42 })
|
151
|
-
```
|
152
|
-
|
153
|
-
#### `delete_api_key`
|
154
|
-
No change.
|
155
|
-
|
156
|
-
#### `restore_api_key`
|
157
|
-
No change.
|
158
|
-
|
159
|
-
#### `get_api_key`
|
160
|
-
No change.
|
161
|
-
|
162
|
-
#### `list_api_keys`
|
163
|
-
No change.
|
164
|
-
|
165
|
-
#### `get_secured_api_key_remaining_validity`
|
166
|
-
This method is moved to the `Algolia::Search::Client` class.
|
167
|
-
```ruby
|
168
|
-
# Before
|
169
|
-
Algolia.get_secured_api_key_remaining_validity('api_key')
|
170
|
-
|
171
|
-
# After
|
172
|
-
Algolia::Search::Client.get_secured_api_key_remaining_validity('api_key')
|
173
|
-
```
|
174
|
-
|
175
|
-
#### `copy_synonyms`
|
176
|
-
No change.
|
177
|
-
|
178
|
-
#### `assign_user_id`
|
179
|
-
No change.
|
180
|
-
|
181
|
-
#### `assign_user_ids`
|
182
|
-
Newly added method to add multiple userIDs to a cluster.
|
183
|
-
```ruby
|
184
|
-
user_ids = ['1','2','3']
|
185
|
-
|
186
|
-
# Before
|
187
|
-
user_ids.each { |id| client.assign_user_id(id, 'my-cluster')}
|
188
|
-
|
189
|
-
# After
|
190
|
-
client.assign_user_ids(user_ids, 'my-cluster')
|
191
|
-
```
|
192
|
-
|
193
|
-
#### `get_top_user_id`
|
194
|
-
No change.
|
195
|
-
|
196
|
-
#### `get_user_id`
|
197
|
-
No change.
|
198
|
-
|
199
|
-
#### `list_clusters`
|
200
|
-
No change.
|
201
|
-
|
202
|
-
#### `list_user_ids`
|
203
|
-
The `page` and `hitsPerPage` parameters are now part of the `requestOptions`.
|
204
|
-
```ruby
|
205
|
-
# Before
|
206
|
-
page = 0
|
207
|
-
hits_per_page = 20
|
208
|
-
client.list_user_ids(page, hits_per_page)
|
209
|
-
|
210
|
-
# After
|
211
|
-
client.list_user_ids({ hitPerPage: 20, page: 0 })
|
212
|
-
```
|
213
|
-
|
214
|
-
#### `remove_user_id`
|
215
|
-
No change.
|
216
|
-
|
217
|
-
#### `search_user_ids`
|
218
|
-
The `clusterName`, `page` and `hitsPerPage` parameters are now part of the `requestOptions`.
|
219
|
-
```ruby
|
220
|
-
# Before
|
221
|
-
page = 0
|
222
|
-
hits_per_page = 12
|
223
|
-
client.search_user_ids('query', 'my-cluster', page, hits_per_page)
|
224
|
-
|
225
|
-
# After
|
226
|
-
client.search_user_ids('query', {clusterName: 'my-cluster', hitPerPage: 12, page: 0 })
|
227
|
-
```
|
228
|
-
|
229
|
-
#### `pending_mappings`
|
230
|
-
New method to check the status of your clusters' migration or user creation.
|
231
|
-
```ruby
|
232
|
-
client.pending_mappings?({ retrieveMappings: true })
|
233
|
-
```
|
234
|
-
|
235
|
-
#### `get_logs`
|
236
|
-
The `offset`, `length`, and `type` parameters are now part of the `requestOptions`.
|
237
|
-
```ruby
|
238
|
-
# Before
|
239
|
-
offset = 5
|
240
|
-
length = 100
|
241
|
-
puts client.get_logs(offset, length, 'all')
|
242
|
-
|
243
|
-
# After
|
244
|
-
client.get_logs({ offset: 5, length: 10, type: 'all' })
|
245
|
-
```
|
246
|
-
|
247
|
-
#### `copy_rules`
|
248
|
-
No change.
|
249
|
-
|
250
|
-
### `Index`
|
251
|
-
#### `search`
|
252
|
-
`searchParameters` and `requestOptions` are a single parameter now.
|
253
|
-
|
254
|
-
```ruby
|
255
|
-
# Before
|
256
|
-
request_opts = { 'X-Algolia-UserToken': 'user123' }
|
257
|
-
search_params = { hitsPerPage: 50 }
|
258
|
-
|
259
|
-
index.search('query', search_params, request_opts)
|
260
|
-
|
261
|
-
# After
|
262
|
-
opts = {
|
263
|
-
headers: { 'X-Algolia-UserToken': 'user123' },
|
264
|
-
hitsPerPage: 50
|
265
|
-
}
|
266
|
-
index.search('query', opts)
|
267
|
-
```
|
268
|
-
|
269
|
-
#### `search_for_facet_values`
|
270
|
-
`searchParameters` and `requestOptions` are a single parameter now.
|
271
|
-
```ruby
|
272
|
-
# Before
|
273
|
-
request_opts = { 'X-Algolia-UserToken': 'user123' }
|
274
|
-
search_params = { hitsPerPage: 50 }
|
275
|
-
|
276
|
-
index.search_for_facet_values('category', 'phone', search_params, request_opts)
|
277
|
-
|
278
|
-
# After
|
279
|
-
opts = {
|
280
|
-
headers: { 'X-Algolia-UserToken': 'user123' },
|
281
|
-
hitsPerPage: 50
|
282
|
-
}
|
283
|
-
index.search_for_facet_values('category', 'phone', opts)
|
284
|
-
```
|
285
|
-
|
286
|
-
#### `find_object`
|
287
|
-
The method takes a lambda, proc or block as the first argument (anything that responds to `call`), and the `requestOptions` as the second
|
288
|
-
```ruby
|
289
|
-
# Before
|
290
|
-
index.find_object({query: 'query', paginate: true}) { |hit| hit[:title].include?('algolia') }
|
291
|
-
|
292
|
-
# After
|
293
|
-
index.find_object(-> (hit) { hit[:title].include?('algolia') }, { query: 'query', paginate: true })
|
294
|
-
```
|
295
|
-
|
296
|
-
#### `get_object_position`
|
297
|
-
The classname has changed, not the method itself.
|
298
|
-
```ruby
|
299
|
-
# Before
|
300
|
-
position = Algolia::Index.get_object_position(results, 'object')
|
301
|
-
|
302
|
-
# After
|
303
|
-
position = Algolia::Search::Index.get_object_position(results, 'object')
|
304
|
-
```
|
305
|
-
|
306
|
-
#### `add_object` and `add_objects`
|
307
|
-
These methods have been removed in favor of `save_object` and `save_objects`.
|
308
|
-
|
309
|
-
#### `save_object` and `save_objects`
|
310
|
-
No change.
|
311
|
-
|
312
|
-
#### `partial_update_object`
|
313
|
-
The `objectID` parameter is removed. `create_if_not_exists` is now part of the `requestOptions` parameter.
|
314
|
-
|
315
|
-
```ruby
|
316
|
-
obj = { objectID: '1234', prop: 'value' }
|
317
|
-
|
318
|
-
# Before
|
319
|
-
create_if_not_exists = true
|
320
|
-
index.partial_update_object(obj, obj[:objectID], create_if_not_exists)
|
321
|
-
|
322
|
-
# After
|
323
|
-
index.partial_update_object(obj, { createIfNotExists: true })
|
324
|
-
```
|
325
|
-
|
326
|
-
#### `partial_update_objects`
|
327
|
-
The `create_if_not_exists` parameter is now part of the `requestOptions` parameter.
|
328
|
-
|
329
|
-
```ruby
|
330
|
-
# Before
|
331
|
-
create_if_not_exists = true
|
332
|
-
index.partial_update_objects(objects, create_if_not_exists)
|
333
|
-
|
334
|
-
# After
|
335
|
-
index.partial_update_objects(objects, { createIfNotExists: true })
|
336
|
-
```
|
337
|
-
|
338
|
-
#### `delete_object` and `delete_objects`
|
339
|
-
No change.
|
340
|
-
|
341
|
-
#### `replace_all_objects`
|
342
|
-
No change.
|
343
|
-
|
344
|
-
#### `delete_by`
|
345
|
-
No change.
|
346
|
-
|
347
|
-
#### `clear_index`
|
348
|
-
Renamed to `clear_objects`.
|
349
|
-
```ruby
|
350
|
-
# Before
|
351
|
-
index.clear_index
|
352
|
-
|
353
|
-
# After
|
354
|
-
index.clear_objects
|
355
|
-
```
|
356
|
-
|
357
|
-
#### `get_object` and `get_objects`
|
358
|
-
The `attributesToRetrieve` parameter is now part of the `requestOptions`.
|
359
|
-
```ruby
|
360
|
-
# Before
|
361
|
-
index.get_object('1234', ['title'])
|
362
|
-
index.get_objects([1,2,3], ['title'])
|
363
|
-
|
364
|
-
# After
|
365
|
-
index.get_object('1234', { attributesToRetrieve: ['title'] })
|
366
|
-
index.get_objects([1,2,3], { attributesToRetrieve: ['title'] })
|
367
|
-
```
|
368
|
-
|
369
|
-
#### `multiple_get_objects`
|
370
|
-
No change.
|
371
|
-
|
372
|
-
#### `batch`
|
373
|
-
No change.
|
374
|
-
|
375
|
-
#### `get_settings`
|
376
|
-
No change.
|
377
|
-
|
378
|
-
#### `set_settings`
|
379
|
-
No change.
|
380
|
-
|
381
|
-
#### `delete_index`
|
382
|
-
Instead of calling the `delete_index` method on the client, you should call the `delete` method directly on the index object.
|
383
|
-
|
384
|
-
```ruby
|
385
|
-
# Before
|
386
|
-
client.delete_index('foo')
|
387
|
-
|
388
|
-
# After
|
389
|
-
index.delete
|
390
|
-
```
|
391
|
-
|
392
|
-
#### `browse`
|
393
|
-
Renamed to `browse_objects`.
|
394
|
-
```ruby
|
395
|
-
# Before
|
396
|
-
request_opts = { 'X-Algolia-UserToken': 'user123' }
|
397
|
-
index.browse({ query: 'query'}, nil, request_opts) do |hit|
|
398
|
-
puts hit
|
399
|
-
end
|
400
|
-
|
401
|
-
# After
|
402
|
-
opts = {
|
403
|
-
query: 'query',
|
404
|
-
headers: { 'X-Algolia-UserToken': 'user123' }
|
405
|
-
}
|
406
|
-
index.browse_objects(opts) do |hit|
|
407
|
-
puts hit
|
408
|
-
end
|
409
|
-
```
|
410
|
-
|
411
|
-
#### `index.exists?`
|
412
|
-
No change.
|
413
|
-
|
414
|
-
#### `save_synonym`
|
415
|
-
The `objectID` parameter has been removed, and should be part of the synonym hash.
|
416
|
-
```ruby
|
417
|
-
# Before
|
418
|
-
forward_to_replicas = true
|
419
|
-
index.save_synonym('one', { objectID: 'one', type: 'synonym', synonyms: %w(one two) }, forward_to_replicas)
|
420
|
-
|
421
|
-
# After
|
422
|
-
index.save_synonym({ objectID: 'one', type: 'synonym', synonyms: %w(one two) }, { forwardToReplicas: true})
|
423
|
-
```
|
424
|
-
|
425
|
-
#### `batch_synonyms`
|
426
|
-
Renamed to `save_synonyms`. `forwardToReplicas` and `replaceExistingSynonyms` parmameters are now part of `requestOptions`.
|
427
|
-
```ruby
|
428
|
-
# Before
|
429
|
-
forward_to_replicas = true
|
430
|
-
replace_existing_synonyms = true
|
431
|
-
index.batch_synonyms(synonyms, forward_to_replicas, replace_existing_synonyms)
|
432
|
-
# After
|
433
|
-
index.save_synonyms(synonyms, { forwardToReplicas: true, replaceExistingSynonyms: true })
|
434
|
-
```
|
435
|
-
|
436
|
-
#### `delete_synonym`
|
437
|
-
No change.
|
438
|
-
|
439
|
-
#### `clear_synonyms`
|
440
|
-
No change.
|
441
|
-
|
442
|
-
#### `get_synonym`
|
443
|
-
No change.
|
444
|
-
|
445
|
-
#### `search_synonyms`
|
446
|
-
No change.
|
447
|
-
|
448
|
-
#### `replace_all_synonyms`
|
449
|
-
No change.
|
450
|
-
|
451
|
-
#### `export_synonyms`
|
452
|
-
Renamed to `browse_synonyms`.
|
453
|
-
```ruby
|
454
|
-
# Before
|
455
|
-
synonyms = index.export_synonyms
|
456
|
-
|
457
|
-
# After
|
458
|
-
synonyms = index.browse_synonyms
|
459
|
-
```
|
460
|
-
|
461
|
-
#### `save_rule`
|
462
|
-
The `objectID` parameter has been removed, and should be part of the Rule object.
|
463
|
-
```ruby
|
464
|
-
# Before
|
465
|
-
index.save_rule('unique-id', {
|
466
|
-
objectID: 'unique-id',
|
467
|
-
condition: { anchoring: 'is', pattern: 'pattern' },
|
468
|
-
consequence: {
|
469
|
-
params: {
|
470
|
-
query: {
|
471
|
-
edits: [
|
472
|
-
{ type: 'remove', delete: 'pattern' }
|
473
|
-
]
|
474
|
-
}
|
475
|
-
}
|
476
|
-
}
|
477
|
-
})
|
478
|
-
|
479
|
-
# After
|
480
|
-
index.save_rule({
|
481
|
-
objectID: 'unique-id',
|
482
|
-
condition: { anchoring: 'is', pattern: 'pattern' },
|
483
|
-
consequence: {
|
484
|
-
params: {
|
485
|
-
query: {
|
486
|
-
edits: [
|
487
|
-
{ type: 'remove', delete: 'pattern' }
|
488
|
-
]
|
489
|
-
}
|
490
|
-
}
|
491
|
-
}
|
492
|
-
})
|
493
|
-
```
|
494
|
-
|
495
|
-
#### `batch_rules`
|
496
|
-
Renamed to `save_rules`. The `forwardToReplicas` and `clearExistingRules` parameters should now be part of the `requestOptions`.
|
497
|
-
```ruby
|
498
|
-
# Before
|
499
|
-
forward_to_replicas = true
|
500
|
-
clear_existing_rules = true
|
501
|
-
index.batch_rules(rules, forward_to_replicas, clear_existing_rules)
|
502
|
-
|
503
|
-
# After
|
504
|
-
index.save_rules(rules, { forwardToReplicas: true, clearExistingRules: true })
|
505
|
-
```
|
506
|
-
|
507
|
-
#### `get_rule`
|
508
|
-
No change.
|
509
|
-
|
510
|
-
#### `delete_rule`
|
511
|
-
The `forwardToReplicas` parameter is now part of the `requestOptions`.
|
512
|
-
```ruby
|
513
|
-
# Before
|
514
|
-
forward_to_replicas = true
|
515
|
-
index.delete_rule('rule-id', forward_to_replicas)
|
516
|
-
|
517
|
-
# After
|
518
|
-
index.delete_rule('rule-id', { forwardToReplicas: true })
|
519
|
-
```
|
520
|
-
|
521
|
-
#### `clear_rules`
|
522
|
-
The `forwardToReplicas` parameter is now part of the `requestOptions`.
|
523
|
-
```ruby
|
524
|
-
# Before
|
525
|
-
forward_to_replicas = true
|
526
|
-
index.clear_rules(forward_to_replicas)
|
527
|
-
|
528
|
-
# After
|
529
|
-
index.clear_rules({ forwardToReplicas: true })
|
530
|
-
```
|
531
|
-
|
532
|
-
#### `search_rules`
|
533
|
-
No change.
|
534
|
-
|
535
|
-
#### `replace_all_rules`
|
536
|
-
No change.
|
537
|
-
|
538
|
-
#### `export_rules`
|
539
|
-
Renamed to `browse_rules`.
|
540
|
-
|
541
|
-
### `AnalyticsClient`
|
542
|
-
#### `add_ab_test`
|
543
|
-
No change.
|
544
|
-
|
545
|
-
#### `get_ab_test`
|
546
|
-
No change.
|
547
|
-
|
548
|
-
#### `get_ab_tests`
|
549
|
-
No change.
|
550
|
-
|
551
|
-
#### `stop_ab_test`
|
552
|
-
No change.
|
553
|
-
|
554
|
-
#### `delete_ab_test`
|
555
|
-
No change.
|
556
|
-
|
557
|
-
### `InsightsClient`
|
558
|
-
#### `clicked_object_ids_after_search`
|
559
|
-
No change.
|
560
|
-
|
561
|
-
#### `clicked_object_ids`
|
562
|
-
No change.
|
563
|
-
|
564
|
-
#### `clicked_filters`
|
565
|
-
No change.
|
566
|
-
|
567
|
-
#### `converted_object_ids_after_search`
|
568
|
-
No change.
|
569
|
-
|
570
|
-
#### `converted_object_ids`
|
571
|
-
No change.
|
572
|
-
|
573
|
-
#### `converted_filters`
|
574
|
-
No change.
|
575
|
-
|
576
|
-
#### `viewed_object_ids`
|
577
|
-
No change.
|
578
|
-
|
579
|
-
#### `viewed_filters`
|
580
|
-
No change.
|
581
|
-
|
582
|
-
### `RecommendationClient`
|
583
|
-
#### `set_personalization_strategy`
|
584
|
-
This new method is available on the `Algolia::Recommendation::Client` class.
|
585
|
-
|
586
|
-
#### `set_personalization_strategy`
|
587
|
-
This new method is available on the `Algolia::Recommendation::Client` class.
|
588
|
-
|
589
|
-
## Configuring timeouts
|
590
|
-
You can configure timeouts by passing a custom `Algolia::Search::Config` object to the constructor of your client.
|
591
|
-
```ruby
|
592
|
-
# Before
|
593
|
-
client = Algolia::Client.new({
|
594
|
-
application_id: 'app_id',
|
595
|
-
api_key: 'api_key',
|
596
|
-
connect_timeout: 2,
|
597
|
-
receive_timeout: 10,
|
598
|
-
})
|
599
|
-
|
600
|
-
# After
|
601
|
-
search_config = Algolia::Search::Config.new(application_id: 'app_id', api_key: 'api_key', read_timeout: 10, connect_timeout: 2)
|
602
|
-
client = Algolia::Search::Client.create_with_config(search_config)
|
603
|
-
```
|
File without changes
|
File without changes
|