Mapping with explicit analyzer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mapping with explicit analyzer

Shairon Toledo
Hi,

So, we are basically searching by file name like "foo bar.pdf" but neither "bar" nor "pdf" are searchable even using pattern tokenizer(\W+). I've reduced our mapping for debugging purpose. For the follow scenario, it uses static mapping with custom default analyzer, everything works fine.


However when used explicit analyzer(_analyzer/path) in the query seems that tokenizer and filters weren't applied. 


It was tested on ES 0.19.3

Is there anything wrong in the mapping?

Thank you,





Shairon Toledo
http://hashcode.me
Reply | Threaded
Open this post in threaded view
|

Re: Mapping with explicit analyzer

kimchy
Administrator
Heya, sorry for the late reply. The configuration of the index you are sending is wrong, you should specify the mappings under "mappings" section, not "mapping" (we should do better job in error reporting here..., I will fix it..). Once you change that, things should wok.

As a side note, when things like that don't work, you should first validate that the mappings you have are the ones you think you have by using the get mapping API. And, using the analyze API as well.

On Fri, May 11, 2012 at 4:21 PM, Shairon Toledo <[hidden email]> wrote:
Hi,

So, we are basically searching by file name like "foo bar.pdf" but neither "bar" nor "pdf" are searchable even using pattern tokenizer(\W+). I've reduced our mapping for debugging purpose. For the follow scenario, it uses static mapping with custom default analyzer, everything works fine.


However when used explicit analyzer(_analyzer/path) in the query seems that tokenizer and filters weren't applied. 


It was tested on ES 0.19.3

Is there anything wrong in the mapping?

Thank you,





Shairon Toledo
http://hashcode.me

Reply | Threaded
Open this post in threaded view
|

Re: Mapping with explicit analyzer

Shairon Toledo
Hi, 
Indeed, it works. "Mappings" is semantically correct, I had to try it before.

Thank you 

On Tue, May 15, 2012 at 4:53 PM, Shay Banon <[hidden email]> wrote:
Heya, sorry for the late reply. The configuration of the index you are sending is wrong, you should specify the mappings under "mappings" section, not "mapping" (we should do better job in error reporting here..., I will fix it..). Once you change that, things should wok.

As a side note, when things like that don't work, you should first validate that the mappings you have are the ones you think you have by using the get mapping API. And, using the analyze API as well.


On Fri, May 11, 2012 at 4:21 PM, Shairon Toledo <[hidden email]> wrote:
Hi,

So, we are basically searching by file name like "foo bar.pdf" but neither "bar" nor "pdf" are searchable even using pattern tokenizer(\W+). I've reduced our mapping for debugging purpose. For the follow scenario, it uses static mapping with custom default analyzer, everything works fine.


However when used explicit analyzer(_analyzer/path) in the query seems that tokenizer and filters weren't applied. 


It was tested on ES 0.19.3

Is there anything wrong in the mapping?

Thank you,





Shairon Toledo
http://hashcode.me




--











Shairon Toledo
http://hashcode.me