Relevance scoring your search results with the HST Query
Typically, customers like it when a title matches some query, that this item gets scored higher than a match for the query only in the documents body.
Now, without going into the subtle details of Lucene scoring, by default all text in a Hippo Document is indexed with equal weight (assuming you do not configure this in indexing_configuration.xml). This means, that a word in the property 'title' is equally important as a word in the 'body'. Now, short documents containing the query term in their body get higher ranked then long document containing the query term in the title (see http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/search/Similarity.html at norm(t,d)).
This is what customers don't like. Easy fix, is to not only search in 'all-text', but OR this with a search in the 'title'. This results in *much* higher scores for the title (tests showed really well results for me).
How To?
Where you had something like :
Filter filter = hstQuery.createFilter();
filter.addContains(".", query);
hstQuery.setFilter(filter);
change this into
Filter filter = hstQuery.createFilter();
hstQuery.setFilter(filter);
Filter titleFilter = hstQuery.createFilter();
titleFilter.addContains("@demosite:title", query);
Filter fullTextFilter = hstQuery.createFilter();
fullTextFilter.addContains(".", query);
filter.addOrFilter(titleFilter);
filter.addOrFilter(fullTextFilter);
Of course adding an extra property that is also more important. like 'summary' is straighforward I assume.
Note this blog did not describe Lucene index or query time boosting. That is something completely different. With query time boosting, you can for example say that some specific word in the query is more important, for example : if my search is [ ard^10 is great ] , than the word 'ard' is boosted a factor ten in scoring.