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 Jihyun Suh <jh...@gmail.com> on 2012/06/01 18:08:16 UTC

solr, how can I make search query with fixed slop(distance)

I want to search data within fixed slop in Solr.

For example, I make search query 'title:+solr +user ~2' for search some
data which have 'solr' and 'user' within 2 slops. But it's not working in
Solr. I get some parameter, defType=edismax, pf, qs, ps. It's not change
the search result, but order.

If I use Phrase Query just like 'title:"solr user"~2', it can't get the
result just like "... users for solr ..." which have not keywords in order.

How Can I do? Help me.

Re: solr, how can I make search query with fixed slop(distance)

Posted by Jack Krupansky <ja...@basetechnology.com>.
Take a look at the Surround Query Parser that lets you do span queries:
http://wiki.apache.org/solr/SurroundQueryParser

   solr  2w user

But, they are very simple, maybe too simple. OTOH, you may be able to 
combine them with "nested queries".

The Lucid Imagination LucidWorks Enterprise product has support for span 
queries:
http://lucidworks.lucidimagination.com/display/lweug/Proximity+Operations

  title:  solr before:2 user

But that won't help you if you are using only Solr.

-- Jack Krupansky

-----Original Message----- 
From: Jihyun Suh
Sent: Friday, June 01, 2012 12:08 PM
To: solr-user-faq@lucene.apache.org ; solr-user@lucene.apache.org
Subject: solr, how can I make search query with fixed slop(distance)

I want to search data within fixed slop in Solr.

For example, I make search query 'title:+solr +user ~2' for search some
data which have 'solr' and 'user' within 2 slops. But it's not working in
Solr. I get some parameter, defType=edismax, pf, qs, ps. It's not change
the search result, but order.

If I use Phrase Query just like 'title:"solr user"~2', it can't get the
result just like "... users for solr ..." which have not keywords in order.

How Can I do? Help me.