You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sailesh <sa...@gmail.com> on 2011/01/11 07:42:35 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-tp2232931p2232931.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


Re: Searching Multivalued fileds

Posted by Erick Erickson <er...@gmail.com>.
You need to create (and it's pretty easy) your own analysis chain that
returns a larger position increment gap, which is intended for this
very situation using the proximity (or SpanNear) as Jokin suggested.

Best
Erick

On Tue, Jan 11, 2011 at 1:24 AM, Jokin Cuadrado <jo...@gmail.com> wrote:

> you should use a proximity search, so the matching words are near:
> q=Itemname:("item movie"~2)
> I don't remember if you need also to customize your indexing analyser
> so diferent values are far enough for your needs or if that it's
> already done.
>
>
> On Tue, Jan 11, 2011 at 9:39 AM, Sailesh <sa...@gmail.com> wrote:
> >
> > I want no fields to be returned, as they belong to different fields but
> > their fieldnames are same.
> > --
> > View this message in context:
> http://lucene.472066.n3.nabble.com/Searching-Multivalued-fileds-tp2233114p2233220.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
> >
>
>
>
> --
> Jokin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Searching Multivalued fileds

Posted by Jokin Cuadrado <jo...@gmail.com>.
you should use a proximity search, so the matching words are near:
q=Itemname:("item movie"~2)
I don't remember if you need also to customize your indexing analyser
so diferent values are far enough for your needs or if that it's
already done.


On Tue, Jan 11, 2011 at 9:39 AM, Sailesh <sa...@gmail.com> wrote:
>
> I want no fields to be returned, as they belong to different fields but
> their fieldnames are same.
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Searching-Multivalued-fileds-tp2233114p2233220.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
>



--
Jokin

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Searching Multivalued fileds

Posted by Sailesh <sa...@gmail.com>.
I want no fields to be returned, as they belong to different fields but
their fieldnames are same.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Searching-Multivalued-fileds-tp2233114p2233220.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


Re: Searching Multivalued fileds

Posted by harsh srivastava <ha...@gmail.com>.
Hi Sailesh,

As per my understanding, (+ITEMNAME:item +ITEMNAME:movie) will search for a
document containing item and movie terms and return the DOC 1.

What you want to get?

-HarshCode



On Tue, Jan 11, 2011 at 12:12 PM, Sailesh <sa...@gmail.com> 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?
>
>
> Thanks
> Sailesh
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Searching-Multivalued-fileds-tp2232931p2232931.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
>
>