Would it be possible to change (or may be better add) the "indices"
signature
SearchRequest#indices(String... indices)
?
It would allow for more easy API I think. Right now I have to write
something like the following:
SearchSourceBuilder sb = ...
Requests.searchRequest()
.indices(new String[]{indexName}) // <- and this can be simplified
.types(myType)
.searchType(SearchType.QUERY_AND_FETCH)
.timeout(TimeValue.timeValueSeconds(timeoutInSeconds))
.source(sb)
Would it be possible to change (or may be better add) the "indices" signature
SearchRequest#indices(String... indices)
?
It would allow for more easy API I think. Right now I have to write something like the following:
SearchSourceBuilder sb = ...
Requests.searchRequest()
.indices(new String{indexName}) // <- and this can be simplified
.types(myType)
.searchType(SearchType.QUERY_AND_FETCH)
.timeout(TimeValue.timeValueSeconds(timeoutInSeconds))
.source(sb)
The problem I see with this API is that it requires a client instance. When
I was using SearchSourceBuilder I did not have to have an instance of client
but still I was able to write a code that construct the query which was very
useful for business logic unit tests. Or is there a way how to get instance
of SearchRequestBuilder and pass it client instance at a later time? (its
constructor tells me that there is not).
In other words SearchRequestBuilder API seems to be a little more elegant
but testing it is more heavyweight then SearchSourceBuilder.
Would it be possible to change (or may be better add) the "indices"
signature
SearchRequest#indices(String... indices)
?
It would allow for more easy API I think. Right now I have to write
something like the following:
SearchSourceBuilder sb = ...
Requests.searchRequest()
.indices(new String{indexName}) // <- and this can be simplified
.types(myType)
.searchType(SearchType.QUERY_AND_FETCH)
.timeout(TimeValue.timeValueSeconds(timeoutInSeconds))
.source(sb)
On Friday, July 8, 2011 at 2:52 PM, Lukáš Vlček wrote:
The problem I see with this API is that it requires a client instance. When I was using SearchSourceBuilder I did not have to have an instance of client but still I was able to write a code that construct the query which was very useful for business logic unit tests. Or is there a way how to get instance of SearchRequestBuilder and pass it client instance at a later time? (its constructor tells me that there is not).
In other words SearchRequestBuilder API seems to be a little more elegant but testing it is more heavyweight then SearchSourceBuilder.
Would it be possible to change (or may be better add) the "indices" signature
SearchRequest#indices(String... indices)
?
It would allow for more easy API I think. Right now I have to write something like the following:
SearchSourceBuilder sb = ...
Requests.searchRequest()
.indices(new String{indexName}) // <- and this can be simplified
.types(myType)
.searchType(SearchType.QUERY_AND_FETCH)
.timeout(TimeValue.timeValueSeconds(timeoutInSeconds))
.source(sb)
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.