-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntervalsSourceProvider and IntervalFilter Plugins #49519
Conversation
Allow custom IntervalsSourceProviders and IntervalFilters via search plugins.
Unrelated test disabled in this PR, waiting for #49490. |
Pinging @elastic/es-search (:Search/Search) |
@romseygeek while discussing, please take things like #49595 into consideration. Some use cases require very specific matching rules and requirements that will not / should not be part of elasticsearch itself. In my case, one of the major issues I have is with the wildcard expansion limits that have put in place with no way to override even though it is possible. |
Thanks for opening this @mattweber When we first introduced intervals we went back and forth a bit over whether or not to make them pluggable. The main argument against is that the various interval algorithms require that all intervals produced by a source are minimal, and it's not obvious how to enforce this with pluggable sources - so it would be very easy to write a source that doesn't minimize its intervals, and then end up with broken behaviour when it's combined with a filter or a conjunction of some kind. We think this still holds, and that we should instead be adding support for things like fuzziness or increased multiterm expansions into core. For IntervalFilters, can you explain what you need to do that isn't covered by scripting filters? |
Thanks @romseygeek. Is that really something you should worry about as long as the expected behavior is documented? If someone does something crazy in a plugin, it really isn't something you would need to support. It would be on that plugin author to fix it. Same applies for all current plugin integration points (a custom query / score function that returns negative scores, an analysis plugin that doesn't advance properly, etc). There are a couple reasons why I would like to see these pluggable:
For pluggable interval filters, I don't have an immediate use for one but I imagine it would be more along the lines the 2nd point above. Ie. Something new popping up in lucene and needing to use it before you can get it into core. The Sorry for being a pain. |
I agree that users can write the query they want in plugins but in this case you're already inside a query where we'd like to ensure that some basic assumptions are met. The most important one is the minimal interval semantic that can be difficult to understand and more importantly difficult to prove that it works correctly with your logic. If you really want to implement new sources you could simply duplicate the entire |
Wow, yes, that |
On the larger point - I wonder if it's worth exposing a limited form of provider, for example one that enforces that intervals only cover a single position? That way we don't get the problems with minimization but still allow people to do things with payloads or multiterm expansions that we don't want to support in core. |
It's hard to think of plugins without real use-case. I see that we mention payloads but this would require much more work than just an interval source since we don't expose payloads at indexing time. This is also something that we want to add in Lucene so I don't see why we wouldn't expose a solution for this in core if we support it in Lucene. |
Thanks @jimczi @romseygeek, forking the intervals query itself is an option I had thought about but was hoping we could get real plugin support. I completely understand your reservations and push back. Please feel free to close this if you don't see any path forward to supporting plugins. |
I'm going to close this for now, but thanks for opening it and starting the discussion @mattweber |
Allow custom IntervalsSourceProviders and IntervalFilters via search plugins.
//cc @romseygeek @jimczi