lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <emir.arnauto...@sematext.com>
Subject Re: mm is not working if you have same term multiple times in query
Date Fri, 22 Sep 2017 12:55:47 GMT
Hi Aman,
You have wrong expectations: Edismax does respect mm, it’s just that it is met. If you take
a look at parsed query, it’ll be something like:
+(((name:lock) (name:lock))~2)
And from dismax perspective it found both terms. It will not start searching for the next
term after first is found or look at term frequency. You can use phrase query to make sure
that lock is close to lock or use function query to make sure tf requirement is met.
Not sure what is your usecase.

HTH,
Emir

> On 22 Sep 2017, at 12:52, Aman Deep Singh <amandeep.cool99@gmail.com> wrote:
> 
> Hi,
> I'm using Solr 6.6.0 i have set mm as 100% but when i have the repeated
> search term then mm param is not honoured
> 
> I have 2 docs in index
> Doc1-
> name=lock
> Doc 2-
> name=lock lock
> 
> Now when i'm quering the solr with query
> *http://localhost:8983/solr/test2/select?defType=dismax&qf=name&indent=on&mm=100%25&q=lock%20lock&wt=json
> <http://localhost:8983/solr/test2/select?defType=dismax&qf=name&indent=on&mm=100%25&q=lock%20lock&wt=json>*
> then it is returning both results but it should return only Doc 2 as no of
> frequency is 2 in query while doc1 has frequency of 1 (lock term frequency).
> Any Idea what to do ,to avoid getting doc 1 in resultset as i don't want
> user to get the Doc1.
> Schema
> <field name="name" type="text_word_delimiter" indexed="true" stored="true"/>
> <fieldType name="text_word_delimiter" class="solr.TextField"
> autoGeneratePhraseQueries="false" positionIncrementGap="100"> <analyzer type
> ="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class=
> "solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <
> tokenizer class="solr.StandardTokenizerFactory"/> <filter class=
> "solr.ManagedSynonymFilterFactory" managed="synonyms_gdn"/> <filter class=
> "solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>
> 
> Their is no synonym is added also.
> 
> Thanks,
> Aman Deep Singh


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