Hello, I read in the docs that:
query: (string) The instant-search query string, all words of the query are interpreted as prefixes (for example "John Mc" will match "John Mccamey" and "Johnathan Mccamey"). _If no query parameter is set, retrieves all objects_
However, when I search like this:
index.search(undefined, searchCallback, {facets: '*', page: pageNum});
It will search for the literal word 'undefined'
. Same for 'null'
.
Digging a bit on the code, I found that algoliasearch.js, line ~1206, does:
var params = 'query=' + encodeURIComponent(query);
(please mind I'm using v2.9.1).
Now, I didn't go to the spec, but it seems that encodeURIComponent(undefined)
returns the string 'undefined'
, at least in the latest Chrome. This results in searching my Algolia index for that word, instead of retrieving all the results, as I intended to.
Is there a special syntax for retrieving all the results or is it a bug?