Scoped search returning incorrect results in some cases
I've discovered an issue where scoped search can sometimes return extraneous results which do not match any of the filters. I've tried to simplify my findings in the following example, although fair warning, I have not tested this specific example and so there may be something else at play.
Let's suppose I have a database with 2 documents that have the following metadata tags:
doc 1: lab=Facility1, sample=X001
doc 2: lab=Facility2, sample=X002
The following queries work:
__0_metadata_value=Facility1
(returns 1 result)
__0_metadata_value=Facility3
(returns 0 results)
The following queries will return unexpected results:
__0_metadata__metadata_type__name=lab&__0_metadata_value=Facility1&__0_match_all=true&__1_metadata__metadata_type__name=sample&__1_metadata_value=XXXX&__1_match_all=true&__operator_0_1=AND_10&__result=10
(returns 1 result, as if scope 1 does not exist)
__0_metadata__metadata_type__name=lab&__0_metadata_value=Facility3&__0_match_all=true&__1_metadata__metadata_type__name=sample&__1_metadata_value=XXXX&__1_match_all=true&__operator_0_1=AND_10&__result=10
(returns 2 results, as if no filtering is being performed)
In general, it looks as if scope 1 is being completely ignored, and if there are two scopes, and the scopes are being joined together with an AND operator, and if scope 0 matches 0 results, no filtering is applied at all.