When working with more advanced queries (QueryCombination), it seems that the filter property is only being applied at the final results level, instead of sub-query level as the type definitions would suggest. There's no mention of this restriction on filter in the docs either.
For example, the following query wouldn't do any filtering at all:
myIndex.search({
combineWith: 'OR',
queries: [{
queries: ["term1"],
filter: (doc) => doc.type === 'foo',
}, {
queries: ["term2"],
filter: (doc) => doc.type === 'bar',
}],
});
When working with more advanced queries (QueryCombination), it seems that the
filterproperty is only being applied at the final results level, instead of sub-query level as the type definitions would suggest. There's no mention of this restriction onfilterin the docs either.For example, the following query wouldn't do any filtering at all: