# Is it possible a boost at indexing time

**URL:** <https://discuss.elastic.co/t/is-it-possible-a-boost-at-indexing-time/12559>\
**Category:** Elasticsearch\
**Created:** [June 27, 2013, 9:37am UTC](https://discuss.elastic.co/t/is-it-possible-a-boost-at-indexing-time/12559 "2013-06-27T09:37:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henry\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henry_2/32/3449_2.png) [@Henry\_2](https://discuss.elastic.co/u/Henry_2)\
**Post date:** [June 27, 2013, 9:37am UTC](https://discuss.elastic.co/t/is-it-possible-a-boost-at-indexing-time/12559/1 "2013-06-27T09:37:46Z")

</div>

Hi,

I want to boost at indexing time using java api.  
Is it possible?  
I didn't find it to java api.

Would you check the sample code?

=================  
IndexRequestBuilder requestBuilder;  
IndexResponse response;

# requestBuilder = client.prepareIndex("blog", "post"); XContentBuilder jsonBuilderDocument = jsonBuilder().startObject(); jsonBuilderDocument.field("docid", "1"); jsonBuilderDocument.field("title", "how can i boost at indexing time?"); jsonBuilderDocument.endObject(); response = requestBuilder.execute().actionGet();

This is a very simple but I don't know how boost add a document.

I'm sorry for my poor english.

Thanks,  
Henry.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 27, 2013, 10:16am UTC](https://discuss.elastic.co/t/is-it-possible-a-boost-at-indexing-time/12559/2 "2013-06-27T10:16:05Z")

</div>

Hey,

you have to configure your mapping in order to support boosting. See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Then you can simply specify a part of your document (a field called 'boost'  
maybe), which includes the index time boost.

Hope this helps,

--Alex

On Thu, Jun 27, 2013 at 11:37 AM, Henry [sophistlv@gmail.com](mailto:sophistlv@gmail.com) wrote:

> Hi,
> 
> I want to boost at indexing time using java api.  
> Is it possible?  
> I didn't find it to java api.
> 
> Would you check the sample code?
> 
> =================  
> IndexRequestBuilder requestBuilder;  
> IndexResponse response;
> 
> # requestBuilder = client.prepareIndex("blog", "post"); XContentBuilder jsonBuilderDocument = jsonBuilder().startObject(); jsonBuilderDocument.field("docid", "1"); jsonBuilderDocument.field("title", "how can i boost at indexing time?"); jsonBuilderDocument.endObject(); response = requestBuilder.execute().actionGet();
> 
> This is a very simple but I don't know how boost add a document.
> 
> I'm sorry for my poor english.
> 
> Thanks,  
> Henry.
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Henry\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henry_2/32/3449_2.png) [@Henry\_2](https://discuss.elastic.co/u/Henry_2)\
**Post date:** [June 28, 2013, 3:08am UTC](https://discuss.elastic.co/t/is-it-possible-a-boost-at-indexing-time/12559/3 "2013-06-28T03:08:54Z")

</div>

Hi,  
I found boost at indexing time using java api.

This is very simple. ^^;;

=================  
IndexRequestBuilder requestBuilder;  
IndexResponse response;

# requestBuilder = client.prepareIndex("blog", "post"); XContentBuilder jsonBuilderDocument = jsonBuilder().startObject(); jsonBuilderDocument.field("docid", "1"); jsonBuilderDocument.field("title", "how can i boost at indexing time?"); jsonBuilderDocument.field("\_boost", 2.0); jsonBuilderDocument.endObject(); response = requestBuilder.execute().actionGet();

You can see the boost field using explanation api.

Thanks,  
-Henry.

2013년 6월 27일 목요일 오후 6시 37분 46초 UTC+9, Henry 님의 말:

> Hi,
> 
> I want to boost at indexing time using java api.  
> Is it possible?  
> I didn't find it to java api.
> 
> Would you check the sample code?
> 
> =================  
> IndexRequestBuilder requestBuilder;  
> IndexResponse response;
> 
> # requestBuilder = client.prepareIndex("blog", "post"); XContentBuilder jsonBuilderDocument = jsonBuilder().startObject(); jsonBuilderDocument.field("docid", "1"); jsonBuilderDocument.field("title", "how can i boost at indexing time?"); jsonBuilderDocument.endObject(); response = requestBuilder.execute().actionGet();
> 
> This is a very simple but I don't know how boost add a document.
> 
> I'm sorry for my poor english.
> 
> Thanks,  
> Henry.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:29am UTC](https://discuss.elastic.co/t/is-it-possible-a-boost-at-indexing-time/12559/4 "2017-07-06T02:29:08Z")

</div>


