Strange mapping behaviour


(Paul Loy) #1

this adds index i1 and i3

index i1 has mappings website and website2

index i3 has mapping website

All mappings have index_analyzer of ascii_ngram

Mapping i1:website has a search_analyzer of ascii_std
Mappings i1:website2 and i3:website have a search_analyzer of ascii_ngram

So I would expect searches against i1:website2 to return the same values as
i3:website and that they be different to i1:website. What I actually see is
that i1:website2 behaves the same as i1:website. It looks like the second
mapping is not being honored.

https://gist.github.com/961540 shows the cluster state which shows that the
mappings appear correct, but the search is not working as exprected. This is
in version 0.16.0.

Thanks,

--

Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy


(Shay Banon) #2

Heya,

First, the definition of the i1/website2 mapping definition is wrong, since you do not specify website2 in the put mapping API (you define website).

Even then, there will be a "collision" for the uri field. And, even though you define teh type when searching, it is not used (this can be a feature enhancement) when choosing an analyzer. The analyzer is chosen based on the first mapping found for the uri field.
On Sunday, May 8, 2011 at 9:04 PM, Paul Loy wrote:

https://gist.github.com/961537

this adds index i1 and i3

index i1 has mappings website and website2

index i3 has mapping website

All mappings have index_analyzer of ascii_ngram

Mapping i1:website has a search_analyzer of ascii_std
Mappings i1:website2 and i3:website have a search_analyzer of ascii_ngram

So I would expect searches against i1:website2 to return the same values as i3:website and that they be different to i1:website. What I actually see is that i1:website2 behaves the same as i1:website. It looks like the second mapping is not being honored.

https://gist.github.com/961540 shows the cluster state which shows that the mappings appear correct, but the search is not working as exprected. This is in version 0.16.0.

Thanks,

--

Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy


(system) #3