You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain multi-term search queries will generate duplicate sets of search results.
This is due to how performObjectSearch is written, where the criteria for result inclusion is if the object term appears in the fullname and each of the otherTerms appears in the haystack. Since both fullname and haystack contain the name as a substring, a two-term search query that has terms that are both substrings of name will result in performObjectSearch outputting the same set of results for each term.
As there is no code to guard against duplication of results, the duplicate results show up in the final output.
How to Reproduce
Search 'builders changes' on the Sphinx docs. Duplicate results appear at the bottom of the page, see attached screenshot.
In general, inspecting the objects index to get an object name and decomposing a name into two terms will result in the same error.
Describe the bug
Certain multi-term search queries will generate duplicate sets of search results.
This is due to how
performObjectSearch
is written, where the criteria for result inclusion is if theobject
term appears in thefullname
and each of theotherTerms
appears in thehaystack
. Since bothfullname
andhaystack
contain thename
as a substring, a two-term search query that has terms that are both substrings ofname
will result inperformObjectSearch
outputting the same set of results for each term.As there is no code to guard against duplication of results, the duplicate results show up in the final output.
How to Reproduce
Search 'builders changes' on the Sphinx docs. Duplicate results appear at the bottom of the page, see attached screenshot.
In general, inspecting the
objects
index to get an object name and decomposing a name into two terms will result in the same error.Expected behavior
Each search result should appear only once.
Your project
https://github.com/sphinx-doc/sphinx
Screenshots
Searching 'builders changes':
Inspecting the
objects
index:The outputs from each of the object and terms search method calls:
OS
Mac
Python version
3.9
Sphinx version
4.4.0
Sphinx extensions
No response
Extra tools
No response
Additional context
Relevant previously closed issue: #3911
The text was updated successfully, but these errors were encountered: