Re: Question about near query order

2011-10-23 Thread Erick Erickson
Just to chime in here... You will get different results
for "A B"~2 and "B A"~2. In the simple two-term case,
changing the order requires an extra move(s). There's
a very good explanation of this in Lucene In Action II.

Best
Erick

On Thu, Oct 20, 2011 at 3:35 PM, Jason, Kim  wrote:
> Which one is better performance of setting inOrder=false in solrconfig.xml
> and quering with "A B"~1 AND "B A"~1 if performance differences?
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Question-about-near-query-order-tp3427312p3437701.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: Question about near query order

2011-10-20 Thread Jason, Kim
Which one is better performance of setting inOrder=false in solrconfig.xml
and quering with "A B"~1 AND "B A"~1 if performance differences?

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Question-about-near-query-order-tp3427312p3437701.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Question about near query order

2011-10-18 Thread Jason, Kim
Thanks a ton iorixxx.

Jason.


--
View this message in context: 
http://lucene.472066.n3.nabble.com/Question-about-near-query-order-tp3427312p3432922.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Question about near query order

2011-10-18 Thread Ahmet Arslan
> Is it possible only defType=lucnee in your second
> suggestion?
> I'm using ComplexPhraseQueryParser.
> So my defType is "complexphrase".

Oh, then life is easy. Just setting the inOrder parameter to false in 
solrconfig.xml should do the trick.


false





Re: Question about near query order

2011-10-18 Thread Jason, Kim
Thank you for your kind reply.

Is it possible only defType=lucnee in your second suggestion?
I'm using ComplexPhraseQueryParser.
So my defType is "complexphrase".



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Question-about-near-query-order-tp3427312p3431465.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Question about near query order

2011-10-18 Thread Ahmet Arslan

> "analyze term"~2
> "term analyze"~2 
> 
> In my case, two queries return different result set.
> Isn't that in your case?

Hmm you are right, I tested with a trunk instance using lucene query parser. 
Results sets were different. If I am not wrong they were same at some version.

I can suggest you two different solutions :

One is to use SurroundQueryParser where you have explicit control over ordered 
versus unordered. But it has its own limitations. See below:

http://wiki.apache.org/solr/SurroundQueryParser

Second one : There is an example in lucene in action book about how to override 
QueryParser and replace PhraseQuery with SpanNearQuery. SpanNearQuery also has 
a Boolean parameter inOrder, You can use that example code. If you pass false 
to its constructor you will obtain unordered phrase query. But this second 
option assumes that you are using lucene query parser. defType=lucene


Re: Question about near query order

2011-10-17 Thread Jason, Kim
"analyze term"~2
"term analyze"~2 

In my case, two queries return different result set.
Isn't that in your case?

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Question-about-near-query-order-tp3427312p3429916.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Question about near query order

2011-10-17 Thread Ahmet Arslan
> I have some near query like "analyze term"~2.
> That is matched in that order.
> But I want to search regardless of order.
> So far, I just queried "analyze term"~2 OR "term
> analyze"~2.
> Is there a better way than what i did?

I think, PhraseQuery should be unordered with slop values grater than 0.
(but it is ordered with slope value of 0)
The following two queries should return same result set:

"analyze term"~2 
"term analyze"~2

Isn't that the case for you?