• Blog
  • Search Tutorial. How do I. Solr Relevancy

Search Tutorial. How do I. Solr Relevancy

  • 2:39:44 PM
  • Tuesday, October 12, 2021

How can I change field boosts

  1. Open C:\Bitnami\solr-8.3.0-0\apache-solr\server\solr\mpp_index\conf\solrconfig.xml
  2. Find /dp_select SearchHandler
  3. Specify boosts on fields in parameters such as qf param
    For example:
    part_number_search^1 universal_product_codes^0.7  vendor_part_numbers^0.7 cross_reference_parts^0.7  manufacturer_search^0.5 attr_search^0.5 description_search^0.4 vendor_descriptions^0.3  short_description^0.3 product_name^0.3 attributes^0.1 long_description^0.1 description_hl^0.01
  4. copy your changes to dp_suggest handler

How can I apply changes of solrconfig.xml

  1. Navigate to the SOLR admin page :
  2. Go to Core admin, mpp_index, press reload Solr Config Apply Changes

Query and Analysis Debugging

  1. Go to your index, Query Query Analysis Debugging
  2. Specify dp_select query handler
  3. Check the debugQuery checkbox Debug Query On You can see how the query parser parsed your query (which includes the analysis phase). This sets the query parameter "debugQuery=on", and results in the return of an extra list named "debug" containing the parsed query.

How can I change the score of a document based on the value of a field (say, "hits_boost" or "velocity_boost")

Change FunctionQuery in the boost param

div(sum(hits_boost,velocity_boost,ga_product_boost,ga_category_boost), 4)

For example:
Use a FunctionQuery as part of your query.

How can I boost results that have a field that matches a specific value.

The bq parameter specifies an additional, optional, query clause that will be added to the user’s main query to influence the score. For example, if you wanted to add a relevancy boost for manufacturer=Mark's and is_on_clearance=true documents:
For example:


        manufacturer:Mark's^2
        is_on_clearance:true^2