Skip to content

Conversation

@andywebb1975
Copy link
Contributor

@andywebb1975 andywebb1975 commented Oct 22, 2025

https://issues.apache.org/jira/browse/SOLR-17959

Description

We were surprised by edismax's behaviour for pure-stopword queries, having expected that these would return zero results. Its 'If a query consists of all stopwords, such as "to be or not to be", then all words are required.' behaviour is the opposite to what we want as we're using query-time stopwords to prevent particular query terms matching, but there's no way to disable the behaviour other than using dismax instead, which has other impacts.

Solution

This PR adds an alwaysStopwords option that disables the default behaviour, enabling stopwords to be always ignored.

Tests

I've added tests for the default and new behaviours.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@andywebb1975 andywebb1975 force-pushed the SOLR-17959-alwaysStopwords branch from ddca4b6 to a6893d0 Compare October 25, 2025 14:02
@andywebb1975 andywebb1975 merged commit 9809766 into apache:main Oct 25, 2025
4 checks passed
@andywebb1975 andywebb1975 deleted the SOLR-17959-alwaysStopwords branch October 25, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:search documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant