# Search by multiple fields with different boost

**URL:** <https://discuss.elastic.co/t/search-by-multiple-fields-with-different-boost/6073>\
**Category:** Elasticsearch\
**Created:** [December 6, 2011, 3:57am UTC](https://discuss.elastic.co/t/search-by-multiple-fields-with-different-boost/6073 "2011-12-06T03:57:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene\_Strokin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eugene_strokin/32/1238_2.png) [@Eugene\_Strokin](https://discuss.elastic.co/u/Eugene_Strokin)\
**Post date:** [December 6, 2011, 3:57am UTC](https://discuss.elastic.co/t/search-by-multiple-fields-with-different-boost/6073/1 "2011-12-06T03:57:38Z")

</div>

Hello,  
I'm stack with simple problem, and I'm asking for a suggestion:  
I have documents indexed which have number of fields, but I need to  
make a simple term search by 3 of them. I need fieldA be the most  
important field, and fieldB and fieldC less.  
So I've mapped them with specific boost parameter:

"fieldA":{"type":"string"}  
"fieldB":{"type":"string", "analyzer":"string\_lowercase", boost:0.8},  
"fieldC":{"type":"string", "analyzer":"string\_lowercase", boost:0.5},

As you see, I have custom analyzer for fields B and C, which doesn't  
tokenize the values during indexing. I need it like this for another  
types of searches.  
So, should I just create a copy of those fields without the custom  
analyzer (and if so, does ES has something like Solr copyField?), or  
there is some better way to do this?

Thank you,  
Eugene S.

---

<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:** [December 7, 2011, 3:35pm UTC](https://discuss.elastic.co/t/search-by-multiple-fields-with-different-boost/6073/2 "2011-12-07T15:35:51Z")

</div>

You should use multi field mapping:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/multi-field-type.html).

On Tue, Dec 6, 2011 at 5:57 AM, Eugene Strokin [eugene@strokin.info](mailto:eugene@strokin.info) wrote:

> Hello,  
> I'm stack with simple problem, and I'm asking for a suggestion:  
> I have documents indexed which have number of fields, but I need to  
> make a simple term search by 3 of them. I need fieldA be the most  
> important field, and fieldB and fieldC less.  
> So I've mapped them with specific boost parameter:
> 
> "fieldA":{"type":"string"}  
> "fieldB":{"type":"string", "analyzer":"string\_lowercase", boost:0.8},  
> "fieldC":{"type":"string", "analyzer":"string\_lowercase", boost:0.5},
> 
> As you see, I have custom analyzer for fields B and C, which doesn't  
> tokenize the values during indexing. I need it like this for another  
> types of searches.  
> So, should I just create a copy of those fields without the custom  
> analyzer (and if so, does ES has something like Solr copyField?), or  
> there is some better way to do this?
> 
> Thank you,  
> Eugene S.

---

<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:46am UTC](https://discuss.elastic.co/t/search-by-multiple-fields-with-different-boost/6073/3 "2017-07-06T03:46:12Z")

</div>


