mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
This commit is contained in:
parent
ef94824a16
commit
8c7c74aed8
1 changed files with 3 additions and 2 deletions
|
@ -344,12 +344,13 @@ export class DocumentSearchClient extends AbstractSearchClient {
|
|||
}
|
||||
|
||||
private termsToHits(source: string, terms: string[]): SourceHit[] {
|
||||
if (terms.length === 0) {
|
||||
const filteredTerms = terms.filter(t => t.trim().length > 0);
|
||||
if (filteredTerms.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const lineMapper = new LineMapper(source);
|
||||
const regex = new RegExp(`(${terms.join('|')})`, 'g');
|
||||
const regex = new RegExp(`(${filteredTerms.join('|')})`, 'g');
|
||||
let match;
|
||||
const hits: SourceHit[] = [];
|
||||
do {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue