Intersect search results [Fix #131]
parent
b0e1d44d6e
commit
57cc2ea4a5
|
@ -1,5 +1,5 @@
|
||||||
import data from '../data'
|
import data from '../data'
|
||||||
import { getData, getSanitizedData, uniq } from '.'
|
import { getData, getSanitizedData, intersect } from '.'
|
||||||
|
|
||||||
var originalPool = {}
|
var originalPool = {}
|
||||||
var index = {}
|
var index = {}
|
||||||
|
@ -130,7 +130,7 @@ function search(value, { emojisToShowFilter, maxResults, include, exclude, custo
|
||||||
}).filter(a => a)
|
}).filter(a => a)
|
||||||
|
|
||||||
if (allResults.length > 1) {
|
if (allResults.length > 1) {
|
||||||
results = uniq(allResults)
|
results = intersect.apply(null, allResults)
|
||||||
} else if (allResults.length) {
|
} else if (allResults.length) {
|
||||||
results = allResults[0]
|
results = allResults[0]
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue