Hi, welcome.
Quote:
1) "Hibernate search in action" mentions (quote): "In a query involving multiple words, the closer they are in a document, the higher the rank".
So I understand if I search for "big ben", then an item containing
- "BIG BEN is in London"
gets higher ranking than
- "It's a BIG day for my dear friend BEN"
However, I don't think such a feature is build into Lucene core (at least so they claim in the Lucene forum)...?
Is my information wrong about Lucene?
Or does Hibernate Search achieve this feature through additional coding?
No additional coding, it's in Lucene; see description of org.apache.lucene.search.PhraseQuery, especially on the setSlop(int) method.
When annotating a property in Hibernate Search, experiment with different values of Field(termVector), by the default positional information is not stored.
Quote:
2) More generally, can you configure Hibernate Search to print out any Lucene Query it runs?
(Similar to Hibernate Core feature of printing out any SQL queries it runs)
You make the Query yourself, or get a reference to the query via the queryBuilder service, you can then invoke "toString()" on it to get a good description.
You can also invoke "explain" on a org.hibernate.search.query after you've run it to have it explain how a specific score was calculated.
Code:
org.hibernate.search.FullTextQuery.explain(int)