akka / alpakka

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
https://doc.akka.io/libraries/alpakka/current/
Other
1.26k stars 643 forks source link

Elasticsearch: No way to specify a source filter or other search options #591

Open zlangbert opened 7 years ago

zlangbert commented 7 years ago

In elasticsearch as part of a search request you can optionally specify a source filter. This allows you to limit the data returned in the _source field of the response items. Because of the way alpakka builds the request, the user can only specify a query, and no other search options. It would be great to allow the user to specify a source filter.

In addition to source there are several other options that can be specified as siblings to the query, a solution for this could be flexible enough to allow specifying those as well.

ennru commented 6 years ago

Yes, there are lot of other useful parameters. One possibility could be to add some optional string that is added directly to the request entity in ElasticsearchSourceLogic.sendScrollScanRequest.

mbknor commented 6 years ago

This is probably fixed in master: https://github.com/akka/alpakka/commit/97f7e46fe41340e147115bb2680eb270150ac609#diff-a05dc5ecaacea54fb635b007c4260294R37

yasha-dev1 commented 4 years ago

It seems that the new change is only supporting "_source" filter. I am trying to use "size", "from" and "sort" but it is not working while the "_source" works. Am I missing something here or the issue hasn't been completely solved? Thank you in advance for your response.

jmerljak commented 4 years ago

IIUC "from" and "size" are irrelevant as messages are retrieved by scroll scan (see docs). Results can be limited by Akka Stream take operator.

However, "sort" would be nice.

ennru commented 3 years ago

The sort order is now supported with #2654.