Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status Code Coverage Maven Central

Solr Extensions



Simple query handler that will transform scores to percentages to determine how sure solr is with it's response.

This may be useful if you want to do something like banner searching. You have bunch of banners in the index and you want to show relevant banner for search term on search page.




Add softmax-version.jar to your solr lib directory.

Add this snippet to your solrconfig.xml

<requestHandler name="/softmax" class="com.ppolivka.solr.extensions.softmax.SoftmaxSearchHandler">
    <str name="queryField">title</str>
    <str name="bias">1.0</str>
    <str name="threshold">0.0</str>
    <str name="results">10</str>
    <str name="sampleSize">10</str>

All the parameters are not required, they can be added as part of the solr query. Parameters

  • queryFiled - fields where to search, dismax qf syntax (can be more fields comma separeted), by default title
  • bias - used as bias * score, bigger values (like 10) will make softmax more sure with results, by default its 1.0
  • threshold - what percentage must be associated with the results to be included in the results, by default 0.0
  • results - how many results to return, by default 10
  • sampleSize - from how many results compute the response, by default 10
    • this is bit tricky, for example if I want one result with 90% accuracy I will set results as 1 but sampleSize as 50 so softmax has data to compute percentages


Build by maven.

mvn clean package // for build
mvn clean test // for testing
You can’t perform that action at this time.