You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by Sailesh <sa...@gmail.com> on 2011/01/11 08:55:32 UTC

Searching Multivalued fileds

My index contains multivalued filed like and i use whitespaceAnalyzer
DOC 1 : ITEMNAME: item 2 name
           ITEMNAME: movie tickets
           ITEMNAME: item 1 name
so when search for (+ITEMNAME:item +ITEMNAME:movie), it should not match any
document
since there is no field which has both item and move, but it returns me the
above doc.

Can any one please suggest how to handle this situation?


Thanks
Sailesh 
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Searching-Multivalued-fileds-tp2233101p2233101.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Searching Multivalued fileds

Posted by Grant Ingersoll <gs...@apache.org>.
Are you using Solr or Lucene?

On Jan 11, 2011, at 7:07 AM, Sailesh wrote:

> 
> but we don't know about the position increment,
> in some cases it can be more and less in some.
> -- 
> View this message in context: http://lucene.472066.n3.nabble.com/Searching-Multivalued-fileds-tp2233101p2233913.html
> Sent from the Lucene - General mailing list archive at Nabble.com.

--------------------------
Grant Ingersoll
http://www.lucidimagination.com


Re: Searching Multivalued fileds

Posted by Sailesh <sa...@gmail.com>.
but we don't know about the position increment,
in some cases it can be more and less in some.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Searching-Multivalued-fileds-tp2233101p2233913.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Searching Multivalued fileds

Posted by Grant Ingersoll <gs...@apache.org>.
On Jan 11, 2011, at 2:55 AM, Sailesh wrote:

> 
> My index contains multivalued filed like and i use whitespaceAnalyzer
> DOC 1 : ITEMNAME: item 2 name
>           ITEMNAME: movie tickets
>           ITEMNAME: item 1 name
> so when search for (+ITEMNAME:item +ITEMNAME:movie), it should not match any
> document
> since there is no field which has both item and move, but it returns me the
> above doc.
> 
> Can any one please suggest how to handle this situation?
> 

Multivalued fields just get concatenated underneath the hood into a single field, in this case itemname, with the position gap specified by the position increment.  If you didn't want them to match, you could use a phrase query with a slop value less than the position increment.

-Grant


--------------------------
Grant Ingersoll
http://www.lucidimagination.com