Signed-off-by: Emma Indal <emma.indahl@gmail.com>
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Emma Indal
2021-05-24 09:49:44 +02:00
committed by Eric Peterson
parent b6a633ca31
commit 720fd2f360
5 changed files with 31 additions and 27 deletions
@@ -116,14 +116,12 @@ export class LunrSearchEngine implements SearchEngine {
Object.keys(this.lunrIndices).forEach(type => {
try {
results.push(
...this.lunrIndices[type]
.search(lunrQueryString)
.map(result => {
return {
result: result,
type: type,
};
})
...this.lunrIndices[type].search(lunrQueryString).map(result => {
return {
result: result,
type: type,
};
}),
);
} catch (err) {
// if a field does not exist on a index, we can see that as a no-match
@@ -141,14 +139,12 @@ export class LunrSearchEngine implements SearchEngine {
.forEach(type => {
try {
results.push(
...this.lunrIndices[type]
.search(lunrQueryString)
.map(result => {
return {
result: result,
type: type,
};
})
...this.lunrIndices[type].search(lunrQueryString).map(result => {
return {
result: result,
type: type,
};
}),
);
} catch (err) {
// if a field does not exist on a index, we can see that as a no-match