Is it possible a boost at indexing time

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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

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

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 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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

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.
For more options, visit https://groups.google.com/groups/opt_out.