cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Default SOLR Search Boost in Share

neilecker
Confirmed Champ
Confirmed Champ

Any idea how I can boost the query score for a specific property in the default Share search?  I'd like to make a match in a document name score higher in the search results than a match in the document title.

I thought I could do it by editing the solrconfig.xml but it doesn't appear to do anything (I tried just reloading the config and also doing a complete re-index).  Below is a section of the solrconfig.xml for the workspace store with the default qf commented out and my modified qf below that where I've increased the boost for name and reduced it for title.

/opt/alfresco/solr4/workspace-SpacesStore/conf/solrconfig.xml

<requestHandler name="/browse" class="solr.SearchHandler">

...

       <!-- Query settings -->

       <str name="defType">edismax</str>

       <!--<str name="qf">

          text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4

          title^10.0 description^5.0 keywords^5.0 author^2.0 resourcename^1.0

       </str>-->

       <str name="qf">

          text^0.5 features^1.0 name^5.0 sku^1.5 id^10.0 manu^1.1 cat^1.4

          title^1.0 description^2.0 keywords^5.0 author^2.0 resourcename^1.0

       </str>

...

</requestHandler>

My test consisted of creating one file with the word "Test" in the name and another with the word "Test" in the title.  Regardless of how I change the solrconfig.xml the document with "Test" in the title field would always come up first when doing a search in Share for "Test" which leads me to believe that this is the not the correct location to try and change this.

Thanks,

Neil

1 REPLY 1

neilecker
Confirmed Champ
Confirmed Champ

Just to add, another option I've looked at is to override search.get.config.xml which can be used to include additional properties to use in the simple search (the default content is shown below):

<search>

   <default-operator>AND</default-operator>

   <default-query-template>%(cm:name cm:title cm:description ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT TAG)</default-query-template>

</search>

I thought that I could maybe use the boost operator in the default-query-template like the following but that prevents any simple search from succeeding.  Anyone have any idea if the relevance scores can be affected by making a change to this template?

<default-query-template>%(cm:name^2.0 cm:title cm:description ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT TAG)</default-query-template>

Thanks,

Neil