# ES 2.0 and boosting a specific types field

**URL:** <https://discuss.elastic.co/t/es-2-0-and-boosting-a-specific-types-field/67739>\
**Category:** Elasticsearch\
**Created:** [December 1, 2016, 10:24am UTC](https://discuss.elastic.co/t/es-2-0-and-boosting-a-specific-types-field/67739 "2016-12-01T10:24:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linus\_Pettersson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/linus_pettersson/32/1107_2.png) [@Linus\_Pettersson](https://discuss.elastic.co/u/Linus_Pettersson)\
**Post date:** [December 1, 2016, 10:24am UTC](https://discuss.elastic.co/t/es-2-0-and-boosting-a-specific-types-field/67739/1 "2016-12-01T10:24:57Z")

</div>

Hi!

I'm trying to upgrade from ES 1.7 to 2.4, however I have some questions.

Previously I could boost specific fields from specific types when using a multi\_match, like this:

```auto
      multi_match:
        {
          query: @query,
          fields: ["*.original^4", "*.stemmed", "*.partial", "tag.name.original^30", "tag.name.lowercased^30",
                   "department.title", "department_title", "colleague.full_name"],
          cutoff_frequency: 0.001
        }

```

Here I have a bunch of fields that have .original, .stemmed and .partial versions indexed. However, if I get a match on `tag.name.original` it should be boosted (tags are very important). In 2.0 the feature to use `type.field` was removed so I can't do it like this anymore.

Is there an alternative approach I can take to get the same functionality?

The only thing I can think of is to index the tag name again, with another name that includes the type in its name, like `tag_name.original` etc. and use that for the boosting.

Is that the way to go with this?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 1, 2016, 1:11pm UTC](https://discuss.elastic.co/t/es-2-0-and-boosting-a-specific-types-field/67739/2 "2016-12-01T13:11:16Z")

</div>

> [@Linus\_Pettersson](#):
>
> Is there an alternative approach I can take to get the same functionality?

Somewhat more verbosely:

```
DELETE test
POST test/doc
{
	"foo":"bar"
}
POST test/doc2
{
	"foo":"bar"
}
GET test/_search
{
   "query": {
	  "bool": {
		 "boost": 10,
		 "should": [
			{
			   "bool": {
				  "boost": 10,
				  "must": [
					 {
						"term": {
						   "_type": "doc"
						}
					 },
					 {
						"match": {
						   "foo": "bar"
						}
					 }
				  ]
			   }
			},
			{
			   "bool": {
				  "boost": 1,
				  "must": [
					 {
						"term": {
						   "_type": "doc2"
						}
					 },
					 {
						"match": {
						   "foo": "bar"
						}
					 }
				  ]
			   }
			}
		 ]
	  }
   }
}

```

---

<div class="post-metadata">

**Author:** ![Linus\_Pettersson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/linus_pettersson/32/1107_2.png) [@Linus\_Pettersson](https://discuss.elastic.co/u/Linus_Pettersson)\
**Post date:** [December 1, 2016, 3:14pm UTC](https://discuss.elastic.co/t/es-2-0-and-boosting-a-specific-types-field/67739/3 "2016-12-01T15:14:04Z")

</div>

Yuck, that's verbose... I guess I'll just index the field again with a different name and use that. Thanks!

---

<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:** [December 29, 2016, 3:14pm UTC](https://discuss.elastic.co/t/es-2-0-and-boosting-a-specific-types-field/67739/4 "2016-12-29T15:14:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
