Skip to content

Fix hyphenated keyword searches in /search - #182

Merged
jdaigneau5 merged 2 commits into
devfrom
af/175-keyword-prefix-analysis
Oct 14, 2026
Merged

jdaigneau5 merged 2 commits into
devfrom
af/175-keyword-prefix-analysis

Conversation

@afoote-mitre

@afoote-mitre afoote-mitre commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #175. Default keyword searches such as use-after-free, cross-site, CVE-2021-44228, CWE-79, and log4j-core could return zero results because their prefix terms were not analyzed the same way as indexed description text.

Why These Changes Were Needed

Change Primary files Reason
Enable analyze_wildcard for default keyword prefix queries utils/searchQueryBuilder.js Allows the configured text analyzer to tokenize punctuation-containing prefixes consistently with indexed text. With the standard analyzer, use-after-free requires use and after plus a free* prefix instead of seeking one nonexistent hyphenated token.
Protect keyword construction and scope behavior utils/searchQueryBuilder.test.js, controllers/searchController.test.js, routes/search.integration.test.js Adds regression coverage for hyphenated vocabulary, CVE/CWE IDs, existing punctuation handling, all three scopes, and the unchanged exact-phrase path. Existing escaping checks remain in place.
Clarify keyword matching behavior README.md, routes/swagger.js, generated api-docs/openapi.json Explains analyzed prefix matching versus ordered phrase matching, and distinguishes IDs mentioned in descriptions from the dedicated cveIds and cweId filters.

@jdaigneau5
jdaigneau5 merged commit db494e8 into dev Oct 14, 2026
1 check passed
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.

2 participants