It's not clear to me how I can boost a specific field on the query
using the Java API. Basically, I'd like to do a query string search
across all fields and boost one of the fields so that if the search
string is found in that field, those documents will be ranked higher.
You can define boost at index time for field, when you search on the _all field, if there is a match for that field content, it will be boosted.
You can use the query_string and provide the list of fields you wish to search on, each with different boost levels (QueryStringBuilder#field(String field, float boost).
A note, that I keep repeating and its in the docs, not sure why people keep missing it. The REST API is built on top of the Java API. There is no way to have something exposed in REST that is not exposed (in some way) using the Java API.
On Thursday, March 24, 2011 at 10:53 PM, Mike Brocious wrote:
It's not clear to me how I can boost a specific field on the query
using the Java API. Basically, I'd like to do a query string search
across all fields and boost one of the fields so that if the search
string is found in that field, those documents will be ranked higher.
Thanks, Shay. Appreciate your patience with us as we come up to speed
on ES.
I found the boost reference in the REST API...it simply wasn't clear
to me how to do the same thing in the Java API. I looked at the
QueryStringBuilder, but just missed the field(String, float) method.
You can define boost at index time for field, when you search on the _all field, if there is a match for that field content, it will be boosted.
You can use the query_string and provide the list of fields you wish to search on, each with different boost levels (QueryStringBuilder#field(String field, float boost).
A note, that I keep repeating and its in the docs, not sure why people keep missing it. The REST API is built on top of the Java API. There is no way to have something exposed in REST that is not exposed (in some way) using the Java API.
On Thursday, March 24, 2011 at 10:53 PM, Mike Brocious wrote:
It's not clear to me how I can boost a specific field on the query
using the Java API. Basically, I'd like to do a query string search
across all fields and boost one of the fields so that if the search
string is found in that field, those documents will be ranked higher.
No problem, thats what the mailing list is for
On Friday, March 25, 2011 at 2:38 AM, Mike Brocious wrote:
Thanks, Shay. Appreciate your patience with us as we come up to speed
on ES.
I found the boost reference in the REST API...it simply wasn't clear
to me how to do the same thing in the Java API. I looked at the
QueryStringBuilder, but just missed the field(String, float) method.
You can define boost at index time for field, when you search on the _all field, if there is a match for that field content, it will be boosted.
You can use the query_string and provide the list of fields you wish to search on, each with different boost levels (QueryStringBuilder#field(String field, float boost).
A note, that I keep repeating and its in the docs, not sure why people keep missing it. The REST API is built on top of the Java API. There is no way to have something exposed in REST that is not exposed (in some way) using the Java API.
On Thursday, March 24, 2011 at 10:53 PM, Mike Brocious wrote:
It's not clear to me how I can boost a specific field on the query
using the Java API. Basically, I'd like to do a query string search
across all fields and boost one of the fields so that if the search
string is found in that field, those documents will be ranked higher.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.