alpakka icon indicating copy to clipboard operation
alpakka copied to clipboard

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

Open zlangbert opened this issue 7 years ago • 5 comments

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.

zlangbert avatar Nov 17 '17 18:11 zlangbert

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.

ennru avatar Jan 22 '18 20:01 ennru

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

mbknor avatar Feb 13 '18 16:02 mbknor

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.

yasha-dev1 avatar Apr 09 '20 10:04 yasha-dev1

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.

jmerljak avatar Jul 09 '20 21:07 jmerljak

The sort order is now supported with #2654.

ennru avatar Jul 19 '21 12:07 ennru