@@ -43,7 +43,7 @@ async function search (value) {
43
43
// We cannot match on atoms :foo because that would be considered
44
44
// a filter. So we escape all colons not preceded by a word.
45
45
const fixedValue = value . replaceAll ( / ( \B | \\ ) : / g, '\\:' )
46
- const results = searchResultsToDecoratedSearchNodes ( index . search ( fixedValue ) )
46
+ const results = searchResultsToDecoratedSearchItems ( index . search ( fixedValue ) )
47
47
renderResults ( { value, results } )
48
48
} catch ( error ) {
49
49
renderResults ( { value, errorMessage : error . message } )
@@ -145,8 +145,8 @@ function createIndex () {
145
145
this . use ( docTokenSplitter )
146
146
this . use ( docTrimmer )
147
147
148
- searchData . items . forEach ( searchNode => {
149
- this . add ( searchNode )
148
+ searchData . items . forEach ( searchItem => {
149
+ this . add ( searchItem )
150
150
} )
151
151
} )
152
152
}
@@ -233,29 +233,29 @@ function docTrimmerFunction (token) {
233
233
} )
234
234
}
235
235
236
- function searchResultsToDecoratedSearchNodes ( results ) {
236
+ function searchResultsToDecoratedSearchItems ( results ) {
237
237
return results
238
238
// If the docs are regenerated without changing its version,
239
239
// a reference may have been doc'ed false in the code but
240
240
// still available in the cached index, so we skip it here.
241
- . filter ( result => getSearchNodeByRef ( result . ref ) )
241
+ . filter ( result => getSearchItemByRef ( result . ref ) )
242
242
. map ( result => {
243
- const searchNode = getSearchNodeByRef ( result . ref )
243
+ const searchItem = getSearchItemByRef ( result . ref )
244
244
const metadata = result . matchData . metadata
245
245
return {
246
- ...searchNode ,
246
+ ...searchItem ,
247
247
metadata,
248
- excerpts : getExcerpts ( searchNode , metadata )
248
+ excerpts : getExcerpts ( searchItem , metadata )
249
249
}
250
250
} )
251
251
}
252
252
253
- function getSearchNodeByRef ( ref ) {
254
- return searchData . items . find ( searchNode => searchNode . ref === ref ) || null
253
+ function getSearchItemByRef ( ref ) {
254
+ return searchData . items . find ( searchItem => searchItem . ref === ref ) || null
255
255
}
256
256
257
- function getExcerpts ( searchNode , metadata ) {
258
- const { doc } = searchNode
257
+ function getExcerpts ( searchItem , metadata ) {
258
+ const { doc } = searchItem
259
259
const searchTerms = Object . keys ( metadata )
260
260
261
261
const excerpts =
0 commit comments