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 Ahson Iqbal <mi...@yahoo.com> on 2011/11/18 11:42:10 UTC

Multivalued Boolean Search

Hi

I have a multivalued field say "MulField" in my index that have values in a document like 

<str name="DocID">1</str>
<arr name="MulField">
    <str>Auto Mobiles</str>
    <str>Toyota Corolla</str>
</arr>

No let say I specified a search criteria as 

+MulField:Mobiles +MulField:Toyota 

now my question is it is possible that this document should not appear in the search results.

Regards
Ahsan

Re: Multivalued Boolean Search

Posted by Ahmet Arslan <io...@yahoo.com>.
> I have a multivalued field say "MulField" in my index that
> have values in a document like 
> 
> <str name="DocID">1</str>
> <arr name="MulField">
>     <str>Auto Mobiles</str>
>     <str>Toyota Corolla</str>
> </arr>
> 
> No let say I specified a search criteria as 
> 
> +MulField:Mobiles +MulField:Toyota 
> 
> now my question is it is possible that this document should
> not appear in the search results.


No. You should index separate two documents in your example. e.g. Normalize your data.

However there is one trick that you can use. Issuing a phrase query may satisfy your needs. e.g. q=MulField:"Mobiles Toyota"~99

Use a big positionIncrementGap value in your field definition.  

http://lucene.472066.n3.nabble.com/positionIncrementGap-in-schema-xml-td488338.html