spring-data-elasticsearch icon indicating copy to clipboard operation
spring-data-elasticsearch copied to clipboard

Adjust this for buffer size please..

Open TheSuicidalPenguin opened this issue 2 years ago • 6 comments

Hi..

@ Override public <T> SearchHits<T> search(Query query, Class<T> clazz, IndexCoordinates index, RequestOptions requestOptions) { SearchRequest searchRequest = requestFactory.searchRequest(query, clazz, index); SearchResponse response = null; if(Objects.isNull(requestOptions)) { SearchResponse response = execute(client -> client.search(searchRequest, RequestOptions.DEFAULT)); } else { SearchResponse response = execute(client -> client.search(searchRequest, requestOptions)); }

Please just add the capability for RequestOptions to be configurable by user. This will anyways be deprecated later so what harm will it do? :(

TheSuicidalPenguin avatar Oct 13 '22 12:10 TheSuicidalPenguin

That would be an API change and thus would not be integrated into the 4.4 branch.

In the main branch (that will be 5.0) this part is already deprecated in favour of using the new Elasticsesarch client.

sothawo avatar Oct 13 '22 15:10 sothawo

okay but 5.0 won't be released for some time.. Is there a different elasticSearch client we could use to adjust the buffer size? I've read about this on different issues and could not wrap my mind around if it was fixed or just ignored.. What's so wrong about making it dynamic?

TheSuicidalPenguin avatar Oct 14 '22 08:10 TheSuicidalPenguin

Spring Data 2022.0.0 (and so Spring Data Elasticsearch 5.0.0) is planned for mid-November. The next releases for 4.4 won't be earlier - we just had one last Thursday.

I did not say that anything is wrong with adding new functionality, but we do not introduce API changes or new features on released versions. That means, that the current released branch (4.4.x) and the previous (4.3.x) will only be changed with bugfixes. Other changes go into the next releases. This could have been 4.5, but as there are big changes in that (Spring 6, Java 17, new Elasticsearch client), the next release will get a new major number and will be version 5.

As for setting custom options in the new client, there already is #2163

sothawo avatar Oct 15 '22 05:10 sothawo

So you mean the new release in mid November (spring data 5) will have the new client that provides us with the possibility of adjusting the transport options?

TheSuicidalPenguin avatar Oct 15 '22 09:10 TheSuicidalPenguin

Yes, the custom options are part of the underlying co.elastic.clients.transport.TransportOptions that is used by Spring Data Elasticsearch 5 for the imperative and reactive clients. I linked the relevant documentation and code in the comment for issue #2163

sothawo avatar Oct 15 '22 11:10 sothawo

Alright amazing! Thank you for your help :)

TheSuicidalPenguin avatar Oct 15 '22 12:10 TheSuicidalPenguin