MCPcopy Create free account
hub / github.com/angular/angular / searchWithQuery

Method searchWithQuery

adev/shared-docs/services/search.service.ts:189–230  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

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
233function matched(snippet: SnippetResult | undefined): boolean {

Callers 2

SearchClass · 0.95
constructorMethod · 0.80

Calls 3

parseResultMethod · 0.95
thenMethod · 0.65
searchMethod · 0.45

Tested by

no test coverage detected