# Boost field does not work

**URL:** <https://discuss.elastic.co/t/boost-field-does-not-work/18145>\
**Category:** Elasticsearch\
**Created:** [June 17, 2014, 4:35am UTC](https://discuss.elastic.co/t/boost-field-does-not-work/18145 "2014-06-17T04:35:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felix\_Xu](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@Felix\_Xu](https://discuss.elastic.co/u/Felix_Xu)\
**Post date:** [June 17, 2014, 4:35am UTC](https://discuss.elastic.co/t/boost-field-does-not-work/18145/1 "2014-06-17T04:35:23Z")

</div>

Hi Guys,  
I have two types in a index, one is used for indexing topics and another  
one is used for indexing comments.  
Here is the sample mapping:

_Topic_:

curl -XPUT [http://localhost:9200/bbs/topic/\_mapping](http://localhost:9200/bbs/topic/_mapping) -d'  
{  
"topic": {  
"\_timestamp": {  
"enabled": true  
},  
"properties": {  
"title": {  
"type": "string",  
"store": true,  
"term\_vector": "with\_positions\_offsets",  
"indexAnalyzer": "ik",  
"searchAnalyzer": "ik",  
"include\_in\_all": true,  
_"boost": 8_  
},  
"content": {  
"type": "string",  
"store": true,  
"term\_vector": "with\_positions\_offsets",  
"indexAnalyzer": "ik",  
"searchAnalyzer": "ik",  
"include\_in\_all": true,  
_"boost": 4_  
}  
}  
}

_Comment_:

curl -XPUT [http://localhost:9200/bbs/comment/\_mapping](http://localhost:9200/bbs/comment/_mapping) -d'  
{  
"comment": {  
"\_timestamp": {  
"enabled": true  
},  
"properties": {  
"title": {  
"type": "string",  
"store": true,  
"term\_vector": "with\_positions\_offsets",  
"indexAnalyzer": "ik",  
"searchAnalyzer": "ik",  
"include\_in\_all": true,  
_"boost": 0_  
},  
"content": {  
"type": "string",  
"store": true,  
"term\_vector": "with\_positions\_offsets",  
"indexAnalyzer": "ik",  
"searchAnalyzer": "ik",  
"include\_in\_all": true,  
_"boost": 4_  
}  
}  
}

I want to search theses two types(title,content of Topic and only content  
of Comment) at the same time, however, I do not want to match the "title"  
field of comments, since the title is the same with its corresponding  
topic, matching the title field of a comment does not make any sense.  
I have tried to set the boost value of Comment's title field to zero but it  
seems does not work..  
I think a simple solution is to set the "title" of Comment with  
"not\_analyzed", but I also want to highlight the matching words in the  
title, so it's better to also index the title field but let it have little  
effects on scoring..  
Could someone please give me some hints? Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a635b0ca-d669-49c1-9263-1e5a682e63f9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a635b0ca-d669-49c1-9263-1e5a682e63f9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:21am UTC](https://discuss.elastic.co/t/boost-field-does-not-work/18145/2 "2017-07-06T01:21:58Z")

</div>


