flexsearch
flexsearch copied to clipboard
Question about query with multiple words in multiple fields
Consider this index definition:
const databaseIndex = new Document({
preset: 'match',
tokenize: 'full',
language: 'it',
resolution: 1,
charset: 'latin:advanced',
document: {
id: 'id',
index: ['id', 'brand', 'name'],
},
});
I add the items to the document like this:
rawProductsList.forEach((element) => {
databaseIndex.add(element);
});
Consider a simple set of objects like this:
| id | brand | name | ||
|---|---|---|---|---|
| 0 | oreo | biscuit | ||
| 1 | barilla | biscuit | ||
When i search for 'oreo' or 'biscuit' I get the correct results, but what I want to achieve is that a query oreo biscuit gives me the object with id 1, but in my configuration it doesn't return anything.
How can I do it? Thanks.