This is a weird problem that I will try to explain in my own way.
I construct my search query by including all possible indexed fields and
using the wildcard if the user hasn’t provided data for a field. Eg if
the indexed fields are “surname”, “first_name” and “second_name” and the
user has only provided data in the surname and first_name fields the
query would be:
“surname:Smith AND first_name:John AND second_name:*”
This seems to work fine unless I use a single character ‘a’ exclusively
in any, some or all of the fields. So say I enter an ‘a’ in surname with
the query being:
“surname:a AND first_name:* AND second_name:*”
I get a result containing every record from my data set. If for example
I use any other character (or multiple characters) in the surname field
“surname:b AND first_name:* AND second_name:*”
I get no results, which I assume is correct because I have no people in
my data set with a surname of “b”.
This same problem applies to any of the indexed fields. Here’s some more
“surname:a AND first_name:a AND second_name:a” gives every record
“surname:a AND first_name:a AND second_name:*” gives every record
“surname:a AND first_name:b AND second_name:*” gives no records which I
“surname:a” gives no records which I expect
Any idea’s what might be going on here?