Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f71fcd6

Browse files
committedJan 30, 2025
improvement: shorten package filter.
1 parent 4a9175d commit f71fcd6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎assets/js/search-page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ async function remoteSearch (value, queryType, searchNodes) {
7272
filterNodes = searchNodes.slice(0, 1)
7373
}
7474

75-
const filters = filterNodes.map(node => `package:=${node.name}-${node.version}`).join(' || ')
75+
const filters = filterNodes.map(node => `${node.name}-${node.version}`).join(',')
7676

7777
const params = new URLSearchParams()
7878
params.set('q', value)
7979
params.set('query_by', 'title,doc')
80-
params.set('filter_by', filters)
80+
params.set('filter_by', `package:=[${filters}]`)
8181

8282
const response = await fetch(`https://search.hexdocs.pm/?${params.toString()}`)
8383
const payload = await response.json()

‎formatters/html/dist/html-XTJIJCYG.js renamed to ‎formatters/html/dist/html-3VPR65AO.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.