You can take a look at how
this demo does it. It uses Instantsearch, which automatically takes care of this for you when sending over the requests. Otherwise, check a request sent over using the network tab in your browser, to see how exactly it's structured