Rey
Rey14mo ago

Search bug for stale indexes breaks results until new insert

I added a text search index but convex didn't create it. How do I force it to create it? I've run npx convex dev multiple times
34 Replies
Indy
Indy14mo ago
Can you confirm it's not created by looking at the Generated Schema on the dashboard of your dev deployment?
Rey
ReyOP14mo ago
It’s generated but it doesn’t work or show up in indexes Correction It doesn’t show up in generated
ian
ian14mo ago
generated doesn't currently show the indexes in the code section. Does it show up in auto-complete in typescript? Have you tried using it? the generated tab does list indexes below the code, I believe text search indexes should be there along with vector search & regular ones
Rey
ReyOP14mo ago
I have tried using it and get zero results with simple text queries
Rey
ReyOP14mo ago
No description
Rey
ReyOP14mo ago
No description
Rey
ReyOP14mo ago
No description
Indy
Indy14mo ago
Can you switch to the generated tab on this Schema screen and see if it's there?
Rey
ReyOP14mo ago
No description
Rey
ReyOP14mo ago
not there
Rey
ReyOP14mo ago
No description
Rey
ReyOP14mo ago
missing here too, sorry i orginally saw the saved
Indy
Indy14mo ago
Checking with some folks internally
ian
ian14mo ago
It's listed there under Indexes down below
No description
ian
ian14mo ago
the generated section doesn't show indexes currently. The fact that it's not showing results is definitely concerning though!
Rey
ReyOP14mo ago
ok, so when will it work
ian
ian14mo ago
Can you send your project slug so we can investigate what's going on? Does it work in prod but not dev or on a teammate's deployment?
Rey
ReyOP14mo ago
its just dev I'm testing convex to see if we use it for three new projects
ian
ian14mo ago
we're looking into it - hold tight Have you tried things like refreshing the browser, trying different search terms, etc? You have a search index in the backend, and it seems you're getting results for at least some queries @Rey if you open the dashboard in another tab, are you still logged in? I've duplicated your code into a new project and added similar dummy data and a function and I'm seeing results just fine. Trying to figure out what the difference with yours is
Rey
ReyOP14mo ago
I have been trying multiple things, some queries work and others don't I'm not sure if that's what should happen but I tried this
ian
ian14mo ago
@Rey I have a theory - can you name your search query the same thing as the field name?
Rey
ReyOP14mo ago
buy , Buy , b and get nothing what should i change? just to be clear
ian
ian14mo ago
change "search_text" to "text" in the schema and query
Rey
ReyOP14mo ago
ok still same issue
ian
ian14mo ago
ok I have a repro - this is a bug. Sam is on it. It seems to break around changing search index names, but it seems to be fixed when inserting another document that matches. out of curiosity - did you change the index name to "text_search" before or was that the original name?
Rey
ReyOP14mo ago
i think i accidentally pushed the example then i corrected it I was going through your docs I'm trying to get pagination to work but I'm getting some weird errors also
ian
ian14mo ago
let's have a separate thread for pagination unless it's related to search
Rey
ReyOP14mo ago
ok
ian
ian14mo ago
i didn't see a new thread? assuming things worked out.
Rey
ReyOP14mo ago
ill add that thresd lateer
ian
ian14mo ago
We've found the issue, writing tests for it, but may not deploy the fix until Monday to avoid Friday evening pushes. Thank you so much for reporting this @Rey - it ended up being a subtler issue than I thought. Sorry you ran into it. Happy to chat about the apps you're making and help think through architecture - hmu
Rey
ReyOP14mo ago
Thanks, yes I would like that. I have some concerns and need to make sure we can use convex. Let me know when we can schedule some time. @ian , would love to have that chat. We need to know if convex can handle aggregations like sum of millions of docs on a column. Our projects deal with a lot of accounting
ian
ian14mo ago
Sent you a DM. re: aggregations there was just a thread on this which has some useful context: https://discord.com/channels/1019350475847499849/1192973574231838731 The fix was just deployed so this should be good now @Rey reach out if you see anything else. Going to close this out

Did you find this page helpful?