Skip to content

Commit

Permalink
Add explicit search query option with no wildcards.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Aug 8, 2023
1 parent 1c1d69c commit 65fe1f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Search/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ const FUZZY_RANGE_TAG = 'FUZZY_RANGE_TAG';
*/

const BASE_SEARCH = new URLSearchParams();
BASE_SEARCH.append('q', `*${REPLACE_TAG}~${FUZZY_RANGE_TAG} OR ${REPLACE_TAG}*~${FUZZY_RANGE_TAG} OR ${REPLACE_TAG}~${FUZZY_RANGE_TAG}`); // add query replacement tag and enable fuzzy search with ~ and wildcards
BASE_SEARCH.append(
'q',
`${REPLACE_TAG} OR *${REPLACE_TAG}~${FUZZY_RANGE_TAG} OR ${REPLACE_TAG}*~${FUZZY_RANGE_TAG} OR ${REPLACE_TAG}~${FUZZY_RANGE_TAG}`
); // add query replacement tag and enable fuzzy search with ~ and wildcards
BASE_SEARCH.append('fq', 'documentKind:ModuleDefinition'); // search for ModuleDefinition documents
BASE_SEARCH.append('rows', '10'); // request 10 results
BASE_SEARCH.append('hl', 'true'); // enable highlight
Expand Down

0 comments on commit 65fe1f1

Please sign in to comment.