(query: string)
| 187 | } |
| 188 | |
| 189 | public searchWithQuery(query: string): Promise<SearchResultItem[] | undefined> { |
| 190 | return this.client |
| 191 | .search([ |
| 192 | { |
| 193 | indexName: this.config.algolia.indexName, |
| 194 | params: { |
| 195 | query: query, |
| 196 | maxValuesPerFacet: MAX_VALUE_PER_FACET, |
| 197 | attributesToRetrieve: [ |
| 198 | 'hierarchy.lvl0', |
| 199 | 'hierarchy.lvl1', |
| 200 | 'hierarchy.lvl2', |
| 201 | 'hierarchy.lvl3', |
| 202 | 'hierarchy.lvl4', |
| 203 | 'hierarchy.lvl5', |
| 204 | 'hierarchy.lvl6', |
| 205 | 'content', |
| 206 | 'type', |
| 207 | 'url', |
| 208 | ], |
| 209 | hitsPerPage: 20, |
| 210 | snippetEllipsisText: '…', |
| 211 | highlightPreTag: '<ɵ>', |
| 212 | highlightPostTag: '</ɵ>', |
| 213 | attributesToHighlight: [], |
| 214 | attributesToSnippet: [ |
| 215 | 'hierarchy.lvl1:10', |
| 216 | 'hierarchy.lvl2:10', |
| 217 | 'hierarchy.lvl3:10', |
| 218 | 'hierarchy.lvl4:10', |
| 219 | 'hierarchy.lvl5:10', |
| 220 | 'hierarchy.lvl6:10', |
| 221 | 'content:10', |
| 222 | ], |
| 223 | }, |
| 224 | type: 'default', |
| 225 | }, |
| 226 | ]) |
| 227 | .then((response: SearchResponses<unknown>) => { |
| 228 | return this.parseResult(response); |
| 229 | }); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | function matched(snippet: SnippetResult | undefined): boolean { |
no test coverage detected