The community member believes they have encountered a potential bug in their code, where a postprocessor error occurs when a vector search yields 0 results. They have attached their code and the full stack trace. Other community members have responded, agreeing that the reranker should handle zero nodes, and one community member has indicated they can fix the issue. A pull request has been created on GitHub to address the problem.
Potential bug? Postprocessor error when vector search yields 0 results
Exception: IndexError: list index out of range
I think there's a decent chance this is a bug. I'm fairly certain this happens because I just moved to a new Vector Database that has no data in it, but the index itself has been created.
My code was working fine and my tests were passing, but when I cleared my DB this error occurred. I believe its happening because the vector search yields no results and then the postprocessor (SentenceTransformerRerank) has nothing to rerank. I would guess that even when the results are zero, the reranker shouldn't run or just returns nothing.
I've attached my code and full stack-trace in the thread.
Let me know if I need to move this somewhere else. Happy to do so, but given my lack of experience I thought there was a chance I was using the class wrong so I didn't want to post right away as a bug