1

We applied boosting and phrase boosting as below:

    https://localhost:8983/solr/app_index/select?bq=(Title:"userinput")^20+
    +(Desc:"userinput")^10&pf=(Title:"userinput")^20+(Desc:"userinput")^10
   &q=(bodycontent_t:(userinput))&defType=edismax&tie=0.01

Above query is working fine in below cases:

User Input: Solr Query

User Input: Query Analysis

However, if we type 3 or more terms as below, its not bringing the expected results as mentioned below:

Expected result is that exact match at first following by partial phrases

User input: Solr Query Analysis

Expected Results in below order:

Solr query analysis is the best practice

solr query is good for analysis

query analysis in solr is good

solr is key player in search world

query your requirements

analysis always gives better results

Got some useful links about Shingle filter which may suits this requirement.

http://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-5.3.pdf#page=112&zoom=auto,-187,475

Is Shingles suits the above requirement? If Yes, please guide how to apply boosting for the shingles or any better way to achieve exact phrase at first then by partial phrases with boosting?

Please guide here. Appreciate your help.

Thamizh
  • 29
  • 6

1 Answers1

0

You can try below field type for your field.

<fieldType name="string_test" class="solr.TextField" sortMissingLast="true" omitNorms="true"> 
    <analyzer type="index">         
        <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ShingleFilterFactory" minShingleSize="2" maxShingleSize="4"
         outputUnigrams="true" outputUnigramsIfNoShingles="true">
    </analyzer>  
    <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
</fieldType> 

Please see the analysis page for the text "Solr Analysis Page".

analysis page

Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47
  • Thanks much Abhijit. Is there any way to apply boosting for the Shingles? For Ex: The exact phrase match should have top boosting following by partial phrase. something like below: Solr Query Analysis^20 solr query^15 Query Analysis^10 Solr ^5.. – Thamizh Nov 02 '21 at 19:50
  • yes. you can try something like defType=edismax&q=Solr Query Analysis&bq=field:value^2.0 – Abhijit Bashetti Nov 03 '21 at 03:40
  • Thanks Abhijit..Will try and let you know.. – Thamizh Nov 17 '21 at 07:55