karmi/tire — Issue #143: Why do I need a wildcard for what should be an exact match?
Author: redCashion
Created: 2011-11-06 16:20:15+00:00
State: open

I have a class with a field mapped like this:

Tire.index(HandResults.index_name) do
create mappings: {
show: {
properties: {
id: {type: 'string', analyzer: 'keyword'},
p_id: {type: 'string', analyzer: 'keyword'},
...

If I take a look at the data after performing a bulk import, I can see an example of the field I'm interested in:

.."st"=>1, "p_id"=>"PST_nuns", ..

If I query on the field though, I need to use the wildcard to get any results:

>> HandResults.search("p_id:PST_nuns*").results.count
=> 10
>> HandResults.search("p_id:PST_nuns").results.count
=> 0

Is there a reason for this?

Thanks!

=> 0