Skip to content

Change default search operator to OR in LuceneSearcher - #704

Open
oyessb wants to merge 1 commit into
mainfrom
change-default-search-operator
Open

oyessb wants to merge 1 commit into
mainfrom
change-default-search-operator

Conversation

@oyessb

@oyessb oyessb commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

The default operator in LuceneSearcher is now OR, allowing queries to match documents with any of the terms. Added unit test SearchUsesOrAsDefaultOperator to verify this behavior.

The default operator in LuceneSearcher is now OR, allowing queries to match documents with any of the terms. Added unit test SearchUsesOrAsDefaultOperator to verify this behavior.
@sonarqubecloud

Copy link
Copy Markdown

@oyessb oyessb linked an issue Sep 17, 2026 that may be closed by this pull request
);
searchResult.Description = doc.Get(SearchConstants.SEARCH_FIELD_DESCRIPTION);
searchResult.SortCode = doc.Get(SearchConstants.SEARCH_FIELD_SORTCODE);
if (DateTime.TryParse(doc.Get(SearchConstants.SEARCH_FIELD_UPDATED), out updated))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the warnings from SonarQube be fixed

@oyessb oyessb linked an issue Sep 18, 2026 that may be closed by this pull request
// The second term should not exist, so with OR the result should still be 3.
// With AND this would become 0, so this test guards the default operator behavior.
TestSearcher("sv", "region thistextdoesnotexist", 3);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, so this should also be true?
TestSearcher("sv", "region AND thistextdoesnotexist", 0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop words (PxWebApi) Change default lucene search operator

3 participants