Hi Varun,

I can't think of a way to do it without writing new analysis filters.

But I think you could do what you want with two filters (this is untested):

1. An index-time filter that outputs a single token consisting of all of the 
input tokens, sorted in a consistent way, e.g.:

   "mobile with GPS" -> "GPS mobile with"
   "samsung android" -> "android samsung"

2. A query-time filter that outputs one token per input term combination, 
sorted in the same consistent way as the index-time filter, e.g.:

   "samsung andriod GPS"
         ->     "samsung","android","GPS",
                "android samsung","GPS samsung","android GPS"
                "android GPS samsung"

Steve

> -----Original Message-----
> From: Varun Gupta [mailto:varun.vgu...@gmail.com]
> Sent: Tuesday, October 26, 2010 9:08 AM
> To: solr-user@lucene.apache.org
> Subject: How do I this in Solr?
> 
> Hi,
> 
> I have lot of small documents (each containing 1 to 15 words) indexed in
> Solr. For the search query, I want the search results to contain only
> those
> documents that satisfy this criteria "All of the words of the search
> result
> document are present in the search query"
> 
> For example:
> If I have the following documents indexed: "nokia n95", "GPS", "android",
> "samsung", "samsung andriod", "nokia andriod", "mobile with GPS"
> 
> If I search with the text "samsung andriod GPS", search results should
> only
> conain "samsung", "GPS", "andriod" and "samsung andriod".
> 
> Is there a way to do this in Solr.
> 
> --
> Thanks
> Varun Gupta

Reply via email to