2016-11-07 86 views
2

我提出用玩笑和QueryBuilders的请求,但是当我做我的测试unitarists执行的查询是:与EXT属性elasticsearch查询

"Query": { 
    "Match_all": { 
    "Boost": 1.0 
    } 
} 

但是当我去了申请,并使用玩笑和exeucuto执行一个分机属性附接到它和ocorreo以下错误:

"Query": { 
    "Match_all": { 
    "Boost": 1.0 
    } 
} 
"Ext": {} 

}

回答

1

从引用:https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/search/SearchExtBuilder.java

Intermediate serializable representation of a search ext section. To be subclassed by plugins that support a custom section as part of a search request, which will be provided within the ext element. Any state needs to be serialized as part of the {@link Writeable#writeTo(StreamOutput)} method and read from the incoming stream, usually done adding a constructor that takes {@link StreamInput} as an argument.

Registration happens through {@link SearchPlugin#getSearchExts()}, which also needs a {@link NoContextParser} that's able to parse the incoming request from the REST layer into the proper {@link SearchExtBuilder} subclass.

{@link #getWriteableName()} must return the same name as the one used for the registration of the {@link SearchExtSpec}.

@see SearchExtSpec