# Advice about mapping

**URL:** https://discuss.elastic.co/t/advice-about-mapping/8235
**Category:** Elasticsearch
**Created:** [June 27, 2012, 12:21am UTC](https://discuss.elastic.co/t/advice-about-mapping/8235 "2012-06-27T00:21:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [June 27, 2012, 12:21am UTC](https://discuss.elastic.co/t/advice-about-mapping/8235/1 "2012-06-27T00:21:47Z")

</div>

Hi everyone. I'm relatively new to ElasticSearch (and Lucene in general),  
but picking it up fairly quickly. It's a lovely piece of software!

I was curious if I could get some advice about mapping "best practices" for  
general search. I am searching an index of product names for matching or  
similar products. The mapping that I have on the index is fairly basic:

> <https://gist.github.com/polyfractal/bce8e9ce47a96a24e693>

Effectively, I'm doing basic tokenization and then either phrase matching  
or matching term nGrams. I am boosting full phrase matches because that  
seems to give the best relevance when people know exactly what they are  
searching for, while the low-weighted nGrams help for non-match phrases.

Is there anything that I'm doing sub-optimally or something I should add?  
Is it silly to have all three nGrams - front, back and middle? This  
search is exclusively for products, so there are a lot of strange queries  
("3C 2200mAh Nanotech"). Unfortunately, a lot of those small terms ("3C")  
are very important so I have to make sure they aren't filtered out.

Thanks! Any help would be greatly appreciated!  
-Zach

---

<div class="post-metadata">

### Author: ![Runar\_Myklebust\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/runar_myklebust_2/32/2047_2.png) [@Runar\_Myklebust\_2](https://discuss.elastic.co/u/Runar_Myklebust_2)
#### Post date: [June 29, 2012, 12:35pm UTC](https://discuss.elastic.co/t/advice-about-mapping/8235/2 "2012-06-29T12:35:23Z")

</div>

I think - based on the assumption that the [comparerc.com](http://comparerc.com) site based on  
this, that you should lowercase index and search. No hits for e.g "wheel"  
🙂

## greetings

Runar Myklebust

Enonic AS

An Open Source Company [www.enonic.com/download](http://www.enonic.com/download)

On Wed, Jun 27, 2012 at 2:21 AM, Zachary Tong [zacharyjtong@gmail.com](mailto:zacharyjtong@gmail.com)wrote:

> Hi everyone. I'm relatively new to Elasticsearch (and Lucene in general),  
> but picking it up fairly quickly. It's a lovely piece of software!
> 
> I was curious if I could get some advice about mapping "best practices"  
> for general search. I am searching an index of product names for matching  
> or similar products. The mapping that I have on the index is fairly basic:
> 
> [ElasticSearch Mapping · GitHub](https://gist.github.com/bce8e9ce47a96a24e693)
> 
> Effectively, I'm doing basic tokenization and then either phrase matching  
> or matching term nGrams. I am boosting full phrase matches because that  
> seems to give the best relevance when people know exactly what they are  
> searching for, while the low-weighted nGrams help for non-match phrases.
> 
> Is there anything that I'm doing sub-optimally or something I should add?  
> Is it silly to have all three nGrams - front, back and middle? This  
> search is exclusively for products, so there are a lot of strange queries  
> ("3C 2200mAh Nanotech"). Unfortunately, a lot of those small terms ("3C")  
> are very important so I have to make sure they aren't filtered out.
> 
> Thanks! Any help would be greatly appreciated!  
> -Zach

---

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [June 30, 2012, 12:31pm UTC](https://discuss.elastic.co/t/advice-about-mapping/8235/3 "2012-06-30T12:31:27Z")

</div>

Hehe, that is indeed my site. How'd you find it?

In any case, my analyzers _are_ lowercasing. If you look at the mapping  
I'm performing ["standard", "lowercase", "asciifolding"] on all the  
indexed product names.

I'm also retrieving search results for "wheel"...what browser are you  
using? It may just be a problem with my javascript, unrelated to  
Elasticsearch.

-Zach

On Friday, June 29, 2012 8:35:23 AM UTC-4, Runar Myklebust wrote:

> I think - based on the assumption that the [comparerc.com](http://comparerc.com) site based on  
> this, that you should lowercase index and search. No hits for e.g "wheel"  
> 🙂
> 
> ## greetings
> 
> Runar Myklebust
> 
> Enonic AS
> 
> An Open Source Company [www.enonic.com/download](http://www.enonic.com/download)
> 
> On Wed, Jun 27, 2012 at 2:21 AM, Zachary Tong [zacharyjtong@gmail.com](mailto:zacharyjtong@gmail.com)wrote:
> 
> > Hi everyone. I'm relatively new to Elasticsearch (and Lucene in  
> > general), but picking it up fairly quickly. It's a lovely piece of  
> > software!
> > 
> > I was curious if I could get some advice about mapping "best practices"  
> > for general search. I am searching an index of product names for matching  
> > or similar products. The mapping that I have on the index is fairly basic:
> > 
> > [ElasticSearch Mapping · GitHub](https://gist.github.com/bce8e9ce47a96a24e693)
> > 
> > Effectively, I'm doing basic tokenization and then either phrase matching  
> > or matching term nGrams. I am boosting full phrase matches because that  
> > seems to give the best relevance when people know exactly what they are  
> > searching for, while the low-weighted nGrams help for non-match phrases.
> > 
> > Is there anything that I'm doing sub-optimally or something I should add?  
> > Is it silly to have all three nGrams - front, back and middle? This  
> > search is exclusively for products, so there are a lot of strange queries  
> > ("3C 2200mAh Nanotech"). Unfortunately, a lot of those small terms ("3C")  
> > are very important so I have to make sure they aren't filtered out.
> > 
> > Thanks! Any help would be greatly appreciated!  
> > -Zach

---

<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:21am UTC](https://discuss.elastic.co/t/advice-about-mapping/8235/4 "2017-07-06T03:21:56Z")

</div>


