lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nino_87 <>
Subject Re: Lucene Hierarchial Taxonomy Search
Date Wed, 18 Dec 2013 09:07:40 GMT
Hi, thanks for the answer.
This could by a solution. But i have more than one hierarchic filed to query
and i want to use the CategoryPath indexed in taxonomy.
I'm using the DrillDown query:

DrillDownQuery luceneQuery = new
luceneQuery.add(new CategoryPath("book_category/novel/comedy,'/'));
luceneQuery.add(new CategoryPath("subject/sub1/sub2",'/'));

In this way the search return the books how match the two category paths and
their descendants.
To retrieve also the ancestors i can start the drilldown from a ancestor of
the requested categoryPath (retrieved from the taxonomy).

The problem is the same score for all the results.
I want to override the similarity/score function in order to calculate a
categoryPath lenght based score, comparing the query categoryPath with each
returned document CategoryPath (book_category).
    document.score = 1
}else if(queryCategoryPath.compareTo(bookCategoryPath)==1){
    document.score = 0.9
}else if(queryCategoryPath.compareTo(bookCategoryPath)==2){
    document.score = 0.8
} and so on.

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message