Provide a facility to access Lucene query explanations
Description
Hibernate search should provide a facility where it is possible access the Lucene explanation for a Hit object. I've attached a patch that allows it to do this.
I've implemented this only at the FullTextQueryImpl level such that it does not appear in the public API as it seems rather Lucene specific to include in the FullTextQuery interface.
Using this patch it is possible to access the explanation for a document by casting FullTextQuery to its implementation class.
It is also necessary to be able to discover the internal Lucene document id for a document in order to be able to request an Explanation object. I've added this to the projection constants and modified DocumentExtractor to utilise it.
Attachments
1
Activity
Show:
Emmanuel BernardJuly 17, 2008 at 2:17 AM
Add fullTextQuery.explain(int); and fullTextQuery.setProjection(FullTextQuery.EXPLANATION)
The second shoud be used only if small amount of data is retrieved.
Hibernate search should provide a facility where it is possible access the Lucene explanation for a Hit object. I've attached a patch that allows it to do this.
I've implemented this only at the FullTextQueryImpl level such that it does not appear in the public API as it seems rather Lucene specific to include in the FullTextQuery interface.
Using this patch it is possible to access the explanation for a document by casting FullTextQuery to its implementation class.
It is also necessary to be able to discover the internal Lucene document id for a document in order to be able to request an Explanation object. I've added this to the projection constants and modified DocumentExtractor to utilise it.