Order of applying filter and withSearchIndex in queries

Hello, I have a question about writing queries, there is this section in the docs(https://docs.convex.dev/search/text-search#other-filtering) talking about how filtering works with search queries, my question is that should we apply the withSearchIndex first and then the filter like written in the docs or it doesn't matter. My guess is that it doesn't matter because this is the builder pattern but it also depends on your implementation so I'm asking just to be sure. Thanks.
Full Text Search | Convex Developer Hub
Run search queries over your Convex documents
No description
2 Replies
Michal Srb
Michal Srb8mo ago
I think a different order won't work, and you will get TypeScript errors if you try it. You can always try things out to see whether they do what you expect.
yassine safraoui
yassine safraouiOP8mo ago
okay thanks.

Did you find this page helpful?