Skip to content
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

API Examples for Sub Bindings #5

Open
greenwoodma opened this issue Apr 26, 2019 · 1 comment
Open

API Examples for Sub Bindings #5

greenwoodma opened this issue Apr 26, 2019 · 1 comment

Comments

@greenwoodma
Copy link
Contributor

When building UIs on top of Mimir it would be useful to get access to the sub bindings within a hit. There appears to be an API for this, but I'm not sure if it works or how to use it. A simple documented example of how this works would be exceptionally useful.

@greenwoodma
Copy link
Contributor Author

It turns out that generally speaking the sub-binding information works as you would expect given the existing (minimal) javadoc for the related methods. There are a few issues that need thinking about/expanding/fixing

  1. there was a bug in the OrQuery which resulted in null entries in the sub-binding array. This has been fixed in commit 82ad62c
  2. the OVER and IN query types don't currently support sub-bindings. These query types were added later than the other types and it appears support for sub bindings was missed out.
  3. With OVER and IN queries should the right hand part of the query be included in the sub-bindings? It's not technically part of the hit and could even be outside the span of the final result, but is important in understanding how the result was achieved. For example {Sentence} OVER ({Person} OR {Location}) is difficult to interpret if you don't have access to the sub-bindings of the right hand side to know if a {Person} or a {Location} triggered the match. My feeling is that they should be included.
  4. An AnnotationQuery currently results in a TermQuery sub-binding that is only for access to the low level annotation index (i.e. it doesn't include feature information etc.) which is more of an implementation detail than a query result. Should we simplify this so that we drop the low level sub-binding?

Once those questions are answered and implemented, a simple API example will trivially fall out of the bottom.

greenwoodma added a commit that referenced this issue May 14, 2019
…ex. In both cases the bindings for both the left and right of the query are contained in the sub-bindings match even though that may result in bindings which fall outside of the range of the final hit as they nevertheless contributed to the match. See #5 for more details
greenwoodma added a commit that referenced this issue May 14, 2019
…lude the main filter binding not just its sub-bindings. See #5 for more details
greenwoodma added a commit that referenced this issue May 15, 2019
…are leaf nodes; they contain a term query but this is an internal implementation detail which shouln't be exposed. See ##5 for more context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant