performance of contextquery with many (~1000) contexts?
Rob Audenaerde <[email protected]> Fri, 10 Jan 2025 17:35:43 +0100
| Newsgroups | gmane.comp.jakarta.lucene.user |
|---|---|
| Message-ID | <CAPz8bx12dRvvbhrNP-r+vUrO_Hd8aqT_XKcZDaFwzCy0oW5GZw@mail.gmail.com> |
Hi all, I'm trying to build a (elastic) suggester that uses context in completionqueries to implement authorization for these suggestions. Basically, I only want suggestions from the contexts where the user has rights. (not sure if this is the best way, suggestions (no pun intended) welcome) What I observe is that if the number of contexts in the query increases, retrieving the suggestions becomes very slow. Typically a user can have up to 1000 access groups (yes it's complex, yes it should be reduced). In a previous project, we used plain Lucene to build a OR query for these access groups and that was still fast. I tried to follow the Elastic source and at some point it leads to code that generates a ContextQuery. So, that leads me to wonder why using these contexts in CompletionQuery makes it so slow. Do you have any hits? Thanks! -Rob