jenna
jenna2y ago

Hey Started using Convex over the

Hey! Started using Convex over the weekend and I'm running into some issues with using search indexing. Looks like it's still doing exact matches even though I did the following. Am I missing something? Thanks! export default defineSchema({ tableName: defineTable({ first: s.string(), }).searchIndex("search_first", { searchField: "first", })
4 Replies
jenna
jennaOP2y ago
[CONVEX Q(queryVotersByFirst.js:default)] [LOG] 'searching with query' 'j' logging.ts:26 [CONVEX Q(queryVotersByFirst.js:default)] [LOG] 'returned voters:' [] logging.ts:26 [CONVEX Q(queryVotersByFirst.js:default)] [LOG] 'searching with query' 'je' logging.ts:26 [CONVEX Q(queryVotersByFirst.js:default)] [LOG] 'returned voters:' [] logging.ts:26 [CONVEX Q(queryVotersByFirst.js:default)] [LOG] 'searching with query' 'jen' logging.ts:26 [CONVEX Q(queryVotersByFirst.js:default)] [LOG] 'returned voters:' [ { _creationTime: 1681061543058.9084, _id: Id('voters', 'wzIYB0aVHXDMZUxY9IVMAA'), address: '...}]
sujayakar
sujayakar2y ago
hey @jenna, welcome! nope, you're not missing anything, search currently only supports exact matches for the keywords in your query. we're currently working on prefix and fuzzy/typo tolerant search and hope to have it out soon. is that what you're expecting? more details here: https://docs.convex.dev/text_search#coming-soon
Full Text Search | Convex Developer Hub
Run search queries over your Convex documents
jenna
jennaOP2y ago
ooooh got it, thanks. I think I misunderstood this line of the docs
Unlike normal document queries, search queries look within a string field to find the keywords. This can be used to build search features within your app like searching for messages that contain certain words.
Yeah, prefix search and searching across multiple fields would be rad!
sujayakar
sujayakar2y ago
cool, that's good feedback about the docs! will make a note, and we'll let you know when we launch prefix search and multiple fields support.

Did you find this page helpful?