Skip to content

Commit

Permalink
Use solr's BooleanSimilarity when matching on text fields
Browse files Browse the repository at this point in the history
We're not interested in ranking based on field length or tf/idf of
the search term, we only want to know if the term is in the field
  • Loading branch information
alastair committed Jan 12, 2023
1 parent 68ec320 commit 662e8f1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions utils/search/solr9.0.0/cores/freesound/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
<!-- The TrimFilter removes any leading or trailing whitespace -->
<filter class="solr.TrimFilterFactory" />
</analyzer>
<!-- BooleanSimilarity simply gives a field a score of 1 if the search term appears in it, rather than
performing any ranking -->
<similarity class="solr.BooleanSimilarityFactory"/>
</fieldType>
<fieldType name="freesound_text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
Expand All @@ -178,6 +181,9 @@
<filter class="solr.SnowballPorterFilterFactory" language="English"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<!-- BooleanSimilarity simply gives a field a score of 1 if the search term appears in it, rather than
performing any ranking -->
<similarity class="solr.BooleanSimilarityFactory"/>
</fieldType>


Expand Down

0 comments on commit 662e8f1

Please sign in to comment.