Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to less aggressive EnglishMinimalStemFilterFactory #1591

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions solr/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<tokenizer class="solr.ICUTokenizerFactory" />
<filter class="solr.KeywordRepeatFilterFactory" />
<filter class="solr.ICUFoldingFilterFactory" />
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.EnglishMinimalStemFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
</fieldType>
Expand All @@ -155,7 +155,7 @@
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.ICUFoldingFilterFactory" />
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.EnglishMinimalStemFilterFactory"/>
<filter class="solr.FlattenGraphFilterFactory"/> <!-- required on index analyzers after graph filters -->
<filter class="solr.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
Expand All @@ -167,7 +167,7 @@
<filter class="solr.ICUFoldingFilterFactory" />
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.EnglishMinimalStemFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
</fieldType>
Expand Down
12 changes: 12 additions & 0 deletions spec/features/search_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@
end
end

describe 'stemming is appropriate and not overly aggressive' do
it 'does not stem "eugenics" to "eugen" in a search' do
visit search_catalog_path q: 'eugenics', search_field: 'all_fields'
expect(page).to have_no_css '.index_title', text: /Interlochen Center for The Arts records/
end

it 'stems "walks" to "walk" in a search' do
visit search_catalog_path q: 'walks', search_field: 'all_fields'
expect(page).to have_css '.index_title', text: /Series III: Correspondence, 1894-1992/
end
end

context 'when two terms match two docs but proximity differs (pf test)' do
it 'counts the doc where the terms are in close proximity as more relevant' do
visit search_catalog_path q: 'splendiferous escapades', search_field: 'all_fields'
Expand Down