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
Can you confirm it's not created by looking at the Generated Schema on the dashboard of your dev deployment?
It’s generated but it doesn’t work or show up in indexes
Correction
It doesn’t show up in generated
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
I have tried using it and get zero results with simple text queries



Can you switch to the generated tab on this Schema screen and see if it's there?

not there

missing here too, sorry i orginally saw the saved
Checking with some folks internally
It's listed there under Indexes down below

the generated section doesn't show indexes currently. The fact that it's not showing results is definitely concerning though!
ok, so when will it work
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?
Convex Dashboard
Manage your Convex apps
its just dev
I'm testing convex to see if we use it for three new projects
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
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
@Rey I have a theory - can you name your search query the same thing as the field name?
buy , Buy , b
and get nothing
what should i change?
just to be clear
change "search_text" to "text" in the schema and query
ok
still same issue
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?
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
let's have a separate thread for pagination unless it's related to search
ok
i didn't see a new thread? assuming things worked out.
ill add that thresd lateer
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
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
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