You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found the query use the last prefix when it has more than a word. So I did some research and found that algolia support queryType to set the prefix of the query. I tried set the queryType to prefixAll but it seems not working. Does docusaurus-lunr-search support to set the query type?
/** * Returns the `source` method to be passed to autocomplete.js. It will query * the Algolia index and call the callbacks with the formatted hits. * @function getAutocompleteSource * @param {function} transformData An optional function to transform the hits * @param {function} queryHook An optional function to transform the query * @returns {function} Method to be passed as the `source` option of * autocomplete */getAutocompleteSource(transformData,queryHook){return(query,callback)=>{if(queryHook){// eslint-disable-next-line no-param-reassignquery=queryHook(query)||query;}this.client.search(query,{queryType: 'prefixAll',}).then((hits)=>{if(this.queryDataCallback&&typeofthis.queryDataCallback==='function'){this.queryDataCallback(hits);}if(transformData){hits=transformData(hits)||hits;}callback(DocSearch.formatHits(hits));});};}
The text was updated successfully, but these errors were encountered:
I found the query use the last prefix when it has more than a word. So I did some research and found that
algolia
supportqueryType
to set the prefix of the query. I tried set thequeryType
toprefixAll
but it seems not working. Doesdocusaurus-lunr-search
support to set the query type?See this document: algolia API Reference / API Parameters / Query Type
The text was updated successfully, but these errors were encountered: