You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Nicholas Ding <ni...@gmail.com> on 2012/08/24 15:15:03 UTC

Query expansion by taxonomy

Hello,

I want do query expansion on Solr, I have a taxonomy index like this.

<field name="category" type="string" indexed="true" stored="true" />
<field name="keyword" type="string" indexed="true" stored="true" />
<field name="syonym" type="string" indexed="true" multiValued="true" />

Is that possible to do one search to get a list contains searched keywords
and their siblings under same category?

For example, search for "Ford" whose category is "Car Dealer", the results
is not limited to "Ford", but also "Honda", "BMW", "Benz" under same
category "Car Dealer".

Thanks
Nicholas

Re: Query expansion by taxonomy

Posted by Jack Krupansky <ja...@basetechnology.com>.
The "More Like This" feature may give you what you want:
http://wiki.apache.org/solr/MoreLikeThis
http://wiki.apache.org/solr/MoreLikeThisHandler

The basic idea is that you do your query on your primary field(s), then you 
take term(s) from some secondary field (your category) and re-query and add 
those results to the response.

You can use the "component" to integrate the secondary results in the 
primary response, or use the "handler" to do a separate query to get 
segregated results.

-- Jack Krupansky

-----Original Message----- 
From: Nicholas Ding
Sent: Friday, August 24, 2012 9:15 AM
To: solr-user@lucene.apache.org
Subject: Query expansion by taxonomy

Hello,

I want do query expansion on Solr, I have a taxonomy index like this.

<field name="category" type="string" indexed="true" stored="true" />
<field name="keyword" type="string" indexed="true" stored="true" />
<field name="syonym" type="string" indexed="true" multiValued="true" />

Is that possible to do one search to get a list contains searched keywords
and their siblings under same category?

For example, search for "Ford" whose category is "Car Dealer", the results
is not limited to "Ford", but also "Honda", "BMW", "Benz" under same
category "Car Dealer".

Thanks
Nicholas