Henry_2
(Henry Jeong)
June 27, 2013, 9:37am
1
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 .
spinscale
(Alexander Reelsen)
June 27, 2013, 10:16am
2
Hey,
you have to configure your mapping in order to support boosting. See
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 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 .
Henry_2
(Henry Jeong)
June 28, 2013, 3:08am
3
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 .