Closed IskandarAlex2 closed 9 months ago
Hey Buddy,
I think you have two cases/questions:
Hope that I helped :)
Oh I guess that slipped from my eyes, I'll try that then I will tell how it goes. And secondly, there's really no way to make vscode recognize the import as valid? It annoys me a bit
@Baroshem so I decided to use useAlgoliaSearch
because the useAlgoliaFacetedSearch
is only for getting the Facets. However, I am having trouble applying the Facet filter as the Algolia official documentation shows, it still lists other object that does not have specified facet
const { result, search } = useAlgoliaSearch("PUBLIC_BLOGS_REGISTRY");
let hits: any[];
onBeforeMount(async () => {
await search({ query: "", facetFilters: [["tags:happy"]] });
hits = result.value.hits;
console.table(result.value.hits);
})
Regarding first question. I dont think there is. Unless maybe there is some tsconfig that I am not aware off.
Regarding second. Have you tried using request options of search method as explained here https://algolia.nuxtjs.org/getting-started/usage/#usealgoliasearch
so after some messing around trying to find a solution, I finally understand how it works so now it works. Just gonna close this with my code so other people won't be as confused as me
const { result, search } = useAlgoliaSearch("INDEX_NAME");
await search({ query: input_string, requestOptions: {facetFilters: ["tags:happy"]} });
console.table(result.value.hits);
This really needs to be added to the docs somewhere. Took me a while to hunt this down.
@JMKelley added in 42ba62813d35f2b3583fb77c964e181f05523eb3 :)
I am trying to make a blog instantsearch page where you can use the search bar to search by title or use facet (Filter) by tags. However, I could not find any facet being mentioned on the documentation page and my VSCode is not helpful because IntelliSense kept saying it could not resolve the module while Nuxt runs perfectly fine with no errors.![image](https://github.com/nuxt-modules/algolia/assets/65650645/9350e88e-946e-4fe0-a343-4fe21b51a7d0)