lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nino_87 <nino_...@hotmail.it>
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
DrillDownQuery(searchParams.indexingParams);
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).
 
E.g.: 
if(queryCategoryPath.compareTo(bookCategoryPath)==0){
    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: http://lucene.472066.n3.nabble.com/Lucene-Hierarchial-Taxonomy-Search-tp4107100p4107226.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message