# Mapping with explicit analyzer

**URL:** <https://discuss.elastic.co/t/mapping-with-explicit-analyzer/7662>\
**Category:** Elasticsearch\
**Created:** [May 11, 2012, 1:21pm UTC](https://discuss.elastic.co/t/mapping-with-explicit-analyzer/7662 "2012-05-11T13:21:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shairon\_Toledo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shairon_toledo/32/2490_2.png) [@Shairon\_Toledo](https://discuss.elastic.co/u/Shairon_Toledo)\
**Post date:** [May 11, 2012, 1:21pm UTC](https://discuss.elastic.co/t/mapping-with-explicit-analyzer/7662/1 "2012-05-11T13:21:23Z")

</div>

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/shairontoledo/2654525>

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

> <https://gist.github.com/shairontoledo/2654604>

It was tested on ES 0.19.3

Is there anything wrong in the mapping?

Thank you,

Shairon Toledo  
[http://hashcode.me](http://hashcode.me)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 15, 2012, 7:53pm UTC](https://discuss.elastic.co/t/mapping-with-explicit-analyzer/7662/2 "2012-05-15T19:53:31Z")

</div>

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.com](mailto:shairon.toledo@gmail.com)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.
> 
> [gist:2654525 · GitHub](https://gist.github.com/2654525)
> 
> However when used explicit analyzer(\_analyzer/path) in the query seems  
> that tokenizer and filters weren't applied.
> 
> [gist:2654604 · GitHub](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](http://hashcode.me)

---

<div class="post-metadata">

**Author:** ![Shairon\_Toledo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shairon_toledo/32/2490_2.png) [@Shairon\_Toledo](https://discuss.elastic.co/u/Shairon_Toledo)\
**Post date:** [May 15, 2012, 9:15pm UTC](https://discuss.elastic.co/t/mapping-with-explicit-analyzer/7662/3 "2012-05-15T21:15:02Z")

</div>

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](mailto: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.com](mailto:shairon.toledo@gmail.com)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.
> > 
> > [gist:2654525 · GitHub](https://gist.github.com/2654525)
> > 
> > However when used explicit analyzer(\_analyzer/path) in the query seems  
> > that tokenizer and filters weren't applied.
> > 
> > [gist:2654604 · GitHub](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](http://hashcode.me)

--

Shairon Toledo

> **[Microsoft Developer News | C++,C# & .NET Framework & More | CodeGuru](http://hashcode.me)**
>
> 您是否想要找关于幸运飞行艇 官方开奖历史记录 168飞艇全国统一开奖数据 还有幸运飞行艇官方开奖现场直播 幸运168飞艇全天精准稳定计划 这里都能一一提供。CodeGuru is where developers come to share ideas, articles, questions, answers, tips, tricks, comments, downloads, and more related to programming in areas including C++,...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:28am UTC](https://discuss.elastic.co/t/mapping-with-explicit-analyzer/7662/4 "2017-07-06T03:28:37Z")

</div>


