Skip to content

Conversation

@jayaddison
Copy link
Contributor

Feature or Bugfix

  • Bugfix

Purpose

  • Make the tests/js/searchtools.js test file more representative of the search index format used by the Sphinx client-side JS code.

Detail

  • Ranking of search results relies on scoring, and Sphinx exact-match queries on terms (arbitrary words) are intended to score 5, while partial-matches score 2 per term (ref).
  • Multi-word searches such as datetime timedelta are supported by Sphinx; internally the JavaScript on the page tokenizes these into multi-term queries (['datetim', 'timedelta']).
  • The search index itself only contains single-word terms.
  • Each term in the index is mapped to a list of documents where the term is found, and these document-ids are zero-indexed (0, 1, 2, ...).
  • 🐛 The tests/js/searchtools.js file has an incorrect representation of the terms entry in the index, instead mapping a search term to a single document-id.

Relates

@jayaddison
Copy link
Contributor Author

My mistake; single-document terms are indexed as flat integer values, as noted by @wlach here. Apologies for the review-ping noise.

@jayaddison jayaddison closed this Mar 2, 2024
@jayaddison jayaddison deleted the issue-12028/search-test-fixture-correction branch March 2, 2024 00:35
@jayaddison jayaddison removed the request for review from picnixz March 2, 2024 01:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test suite: search: test fixture does not accurately represent the JS search index format

1 participant