I have an index where one field is stored as array of strings. Those strings will contain multiple tokens. When I query that field by using a generated query, I get no results. An example of the behavior is as such.
const objs = [
{
myField: ['this is a car', 'this is also a car']
},
{
myField: ['boat']
}
];
const index = lunr(function () {
this.field('myField');
objs.forEach(function (doc) {
this.add(doc)
}, this);
});
index.search('+myField:car'); // 0 results
index.search('+myField:boat'); // 1 result
My understanding of the documentation is that the query will be executed against the result of .toString() of each element in an array, when an array is present. Given that understanding, I'd expect `index.search('+myField:string') to return 2 results.
Let me know if you need more information, or if I'm misunderstanding the docs.
I have an index where one field is stored as array of strings. Those strings will contain multiple tokens. When I query that field by using a generated query, I get no results. An example of the behavior is as such.
My understanding of the documentation is that the query will be executed against the result of
.toString()
of each element in an array, when an array is present. Given that understanding, I'd expect `index.search('+myField:string') to return 2 results.Let me know if you need more information, or if I'm misunderstanding the docs.