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 Jaco <jd...@gmail.com> on 2009/10/22 18:05:59 UTC

Nested phrases with proximity in Solr

Hello,

As far as I've been able to dig up, there is no way to use nested phrases in
Solr, let alone with proximity. For instance ""a b" c d"~10. I've seen a
special Surround Query Parser in Lucene that appears to support this.

Am I missing something? Any clues anybody?

Thanks in advance, bye,

Jaco.

Re: Nested phrases with proximity in Solr

Posted by AHMET ARSLAN <io...@yahoo.com>.
> As far as I've been able to dig up, there is no way to use
> nested phrases in
> Solr, let alone with proximity. For instance ""a b" c
> d"~10. I've seen a
> special Surround Query Parser in Lucene that appears to
> support this.
> 
> Am I missing something? Any clues anybody?

I had a need for nested proximity search but in out-of-the-box Solr there is no such thing. It can be done SpanQuery family, if you were constructing your queries programmatically.

As you said Paul Elschot's Surround QueryParser can handle nested proximity searches. 
Xml-Query-Parser can also do it but its input must be a xml.
Qsol can do Paragraph/Sentence Proximity Searching.

Here [1] you can find a excellent blog about query parsers. 

My favourite is Surround. I integrated it in Solr and used it.
Your example can be done with it : (a w b) 10w (c OR d)
w is ordered, while n is unordered operator. 
But it has two disadvantages:
1-) It does not use an analyzer to analyze query terms.
2-) There is no default operator.

Hope this helps.

[1]http://www.lucidimagination.com/blog/2009/02/22/exploring-query-parsers/#more-180