The query works when removing both or one of the operands. That also means that both operands individually still work. Only the combination using “and” does not work anymore and returns 0 results. We are sure there are results for the given dates and search terms in the db.
What we tried:
Nothing which we tried seemed to be a reasonable cause for the problem as the operators individually still work.
However we noticed we had some duplicate Docs and the TextChunks then were referencing two Docs. So we deleted all duplicate Docs now. No results.
We also noticed we had some TextChunks that referenced Docs that dont exist anymore, so the Upload_time in this query was null. We create the Docs and added the upload time. Again - no effect.
We do not get any errors so at this point we cannot do any further debugging.
so we tried duplicating the Document collection, because that is the collection that stores the date. However after doing that, we noticed that the query with AND does work on the Document collection itself, only not when resolving the Reference from TextChunk to Document.
So obviously rebuilding the index for the Document collection does not solve the issue.
Do you have any idea what we could do to resolve this? Delete and create the references again? Or would the be a way to build all indexes again? A bit clueless here.
Hey @DudaNogueira, jumping in here as another one of the devs working on the same project as @klt.
I believe we have another issue here than the one you are referencing, because we did ensure that each TextChunk is only ever linked to a single Document. So a TextChunk that has a reference with upload_time >= X while simultaneously having a reference with upload_time <= Y should actually only be true if X <= upload_time <= Y on that single linked Document. Now we did also ensure that we have object in our database that do match this query, but we do not get any results.