lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mohammad Norouzi" <mnr...@gmail.com>
Subject Re: a query for a special AND?
Date Thu, 20 Sep 2007 05:15:00 GMT
Hi Paul,
would you tell me what is the difference between AND and + ?
I tried both but get different result
with AND I get 1777 documents and with + I get nearly 25000 ?


On 9/17/07, Paul Elschot <paul.elschot@xs4all.nl> wrote:
>
> On Monday 17 September 2007 11:40, Mohammad Norouzi wrote:
> > Hi
> > I have a problem in getting correct result from Lucene, consider we have
> an
> > index containing documents with fields "field1" and "field2" etc. now I
> want
> > to have documents in which their field1 are equal one by one and their
> > field2 with two different value
> >
> > to clarify consider I have this query:
> > field1:val*  (field2:"myValue1" XOR field2:"myValue2")
>
> Did you try this:
>
> +field1:val*  +field2:"myValue1" +field2:"myValue2"
>
> Regards,
> Paul Elschot
>
>
> >
> > now I want this result:
> > field1              field2
> > val1                myValue1
> > val1                myValue2
> > val2                myValue1
> > val2                myValue2
> >
> > this result is not acceptable:
> > val3              myValue1
> > or
> > val4             myValue1
> > val4             myValue3
> >
> > I put XOR as operator because this is not a typical OR, it's different,
> it
> > means documents that contains both myValue1 and myValue2 for the field
> > field2
> >
> > how to build a query to get such result?
> >
> > thanks in advance
> > --
> > Regards,
> > Mohammad
> > --------------------------
> > see my blog: http://brainable.blogspot.com/
> > another in Persian: http://fekre-motefavet.blogspot.com/
> > Sun Certified Java Programmer
> > ExpertsExchange Certified, Master:
> > http://www.experts-exchange.com/M_1938796.html
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Regards,
Mohammad
--------------------------
see my blog: http://brainable.blogspot.com/
another in Persian: http://fekre-motefavet.blogspot.com/
Sun Certified Java Programmer
ExpertsExchange Certified, Master:
http://www.experts-exchange.com/M_1938796.html

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message