Forum: Ferret Using single character 'a' as a search term

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A13fff21c0237a4abb5d06b64d4a6501?d=identicon&s=25 James Newport (jamnew)
on 2008-09-23 09:39
Hi all,

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
such as:

"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?
This topic is locked and can not be replied to.