bitemyapp / bloodhound

Haskell Elasticsearch client and query DSL
bitemyapp.com
BSD 3-Clause "New" or "Revised" License
424 stars 118 forks source link

Is there a way to specify ?routing= query peram on searches? #303

Open robwithhair opened 1 month ago

robwithhair commented 1 month ago

Firstly, thanks for all your hard work on this librarly, it is very useful and usually quite easy to use.

I have been reading the code line by line to try and figure this one out but no luck thus far. If there is a way to do it then I think the documentation could do with an example?

Basically I'm trying to specify the routing value for a query of indexed documents that have had the routing value sent at index time.

Does the Bloodhound library support routing values on queries at all or is there something I'm missing? I've been trying to figure out how URL query strings are created but I'm not getting very far.

Any help or advice on if the feature is supported or not would be much appreciated?

blackheaven commented 1 month ago

Hello,

Thanks for your feedback.

As you have found out, there's no function which allows it directly.

However, you can have a look at Requests, which gives a BHRequest which has a Endpoint, you would be able to append any query params.

Let my know if it works for your use case.

blackheaven commented 1 month ago

(sorry, I have miss-clicked)