The mm parameter, as I understand it, doesn't really play with phrase.
So you're looking for the phrase
"this amazing sample query", "amazing" must be in the phrase.

and phrase slop reorders things, counting the reordering as "slop", so
the approach would not
do what you want anyway, i.e.
"this amazing query"
would match
"this query is amazing"
if ps were >= 2 (or maybe three, I always have to draw the picture again).

I don't even think the mm parameter applies at all to the pf clause,
it's just used to boost
relevance.

You may be able to use the SurroundQueryParser, which is available in 4.0 see:
http://wiki.apache.org/solr/SurroundQueryParser
but note its limitations.

Best
Erick

On Wed, Sep 19, 2012 at 12:52 PM, Jose Aguilar
<jagui...@searchtechnologies.com> wrote:
> Hi all,
>
> We have a problem when using minimum match and a phrase query, and maybe 
> someone here has seen this and could give us a hand.
>
> We need to make a query where several terms need to be in order, but in the 
> query there might be some other terms in between them. So for example the 
> queries:
>
> "this amazing query"
>
> And
>
> "this amazing sample query"
>
> Should match:
>
> "this amazing query"
>
> But not:
>
> "this query is amazing"
>
> The way we approached the problem was to create a phrase query and add the 
> minimum match parameter (50% in this case), our reasoning was that with the 
> "mm" parameter it wouldn't need to match all the terms in the query. But it 
> doesn't seem to work (maybe we are doing something wrong). So something like:
>
> http://localhost:8080/SolrContext/select?q=this+amazing+sample+query&qf=MY_FIELD&pf=MY_FIELD&ps=5&debugQuery=true&defType=edismax&mm=50%<http://localhost:8080/SolrContext/select?q=physician&qf=LISTING_NAME_NGRAM&pf=LISTING_NAME_NGRAM&ps=5&debugQuery=true&defType=edismax&mm=4%3C80%25>
>
> Doesn't return any results. If we change the query to "this amazing query", 
> the exact phrase, it does match.
>
> Is this the right approach for this problem? Any pointers would be helpful.
>
> Thanks,
>
> Jose.
>

Reply via email to