Skip to content

Commit

Permalink
fix(answers): deprecate findAnswers (algolia/algoliasearch-helper-js#919
Browse files Browse the repository at this point in the history
)

While this method still works, it's not used in InstantSearch and it no longer has any difference from a regular search, and therefore no longer needs its own function.
  • Loading branch information
Haroenv committed Nov 14, 2022
1 parent 575e9a1 commit f20d1b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/algoliasearch-helper/index.d.ts
Expand Up @@ -147,6 +147,7 @@ declare namespace algoliasearchHelper {
* @param {string[]} options.attributesForPrediction - Attributes to use for predictions. If empty, `searchableAttributes` is used instead.
* @param {string[]} options.queryLanguages - The languages in the query. Currently only supports ['en'].
* @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.
* @deprecated answers is deprecated and will be replaced with new initiatives
*/
findAnswers<TObject>(options: {
attributesForPrediction: string[];
Expand Down
2 changes: 2 additions & 0 deletions packages/algoliasearch-helper/src/algoliasearch.helper.js
Expand Up @@ -260,8 +260,10 @@ AlgoliaSearchHelper.prototype.searchOnce = function(options, cb) {
* @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.
*
* @return {promise} the answer results
* @deprecated answers is deprecated and will be replaced with new initiatives
*/
AlgoliaSearchHelper.prototype.findAnswers = function(options) {
console.warn('[algoliasearch-helper] answers is no longer supported');
var state = this.state;
var derivedHelper = this.derivedHelpers[0];
if (!derivedHelper) {
Expand Down

0 comments on commit f20d1b8

Please sign in to comment.