lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Lucene Hierarchial Taxonomy Search
Date Thu, 19 Dec 2013 12:16:01 GMT
If you're not doing faceted search, why index CategoryPaths?  That
just adds unused bloat (BinaryDV field) to your index.

To achieve the same thing as DrillDownQuery without that bloat, use
PathHierarchyTokenizer, which for book_category/novel/comedy would
index /book_category, /book_category/novel,
/book_category/novel/comedy.

But, to apply different scores, maybe you could use something like
Solr's trick for hierarchical faceting (
http://wiki.apache.org/solr/HierarchicalFaceting ), where you prefix
each path component with its depth.  Then your query becomes multiple
TermQuery clauses, each with its own boost.


Mike McCandless

http://blog.mikemccandless.com


On Wed, Dec 18, 2013 at 4:07 AM, Nino_87 <nino__87@hotmail.it> wrote:
> 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
>

---------------------------------------------------------------------
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