mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Java API: BoostingQueryBuilder does not build the query correctly, closes #1141.
This commit is contained in:
parent
ed6a6e31d3
commit
91e050f885
@ -31,6 +31,17 @@ import java.io.IOException;
|
||||
*/
|
||||
public abstract class BaseQueryBuilder implements QueryBuilder {
|
||||
|
||||
@Override public String toString() {
|
||||
try {
|
||||
XContentBuilder builder = XContentFactory.safeJsonBuilder();
|
||||
builder.prettyPrint();
|
||||
toXContent(builder, EMPTY_PARAMS);
|
||||
return builder.string();
|
||||
} catch (Exception e) {
|
||||
throw new QueryBuilderException("Failed to build query", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public BytesStream buildAsUnsafeBytes() throws QueryBuilderException {
|
||||
return buildAsUnsafeBytes(XContentType.JSON);
|
||||
}
|
||||
|
@ -90,5 +90,6 @@ public class BoostingQueryBuilder extends BaseQueryBuilder {
|
||||
if (boost != -1) {
|
||||
builder.field("boost", boost);
|
||||
}
|
||||
builder.endObject();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user