Mapping with explicit analyzer


(Shairon Toledo) #1

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


(Shay Banon) #2

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 shairon.toledo@gmail.comwrote:

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.

https://gist.github.com/2654525

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

https://gist.github.com/2654604

It was tested on ES 0.19.3

Is there anything wrong in the mapping?

Thank you,

Shairon Toledo
http://hashcode.me


(Shairon Toledo) #3

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 kimchy@gmail.com 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 shairon.toledo@gmail.comwrote:

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.

https://gist.github.com/2654525

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

https://gist.github.com/2654604

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


(system) #4