@@ -120,12 +120,16 @@ defmodule Algolia do
120120 def search ( client , index , query , opts \\ [ ] ) do
121121 { req_opts , opts } = pop_request_opts ( opts )
122122
123- path = Paths . search ( index , query , opts )
123+ body =
124+ opts
125+ |> Map . new ( )
126+ |> Map . put ( :query , query )
124127
125128 with { :ok , % { } = data } <-
126129 send_request ( client , :read , % {
127- method: :get ,
128- path: path ,
130+ method: :post ,
131+ path: Paths . search ( index ) ,
132+ body: body ,
129133 options: req_opts
130134 } ) do
131135 :telemetry . execute (
@@ -207,10 +211,13 @@ defmodule Algolia do
207211 def browse ( client , index , opts \\ [ ] ) do
208212 { req_opts , opts } = pop_request_opts ( opts )
209213
210- path = Paths . browse ( index , opts )
211-
212214 with { :ok , % { } = data } <-
213- send_request ( client , :read , % { method: :get , path: path , options: req_opts } ) do
215+ send_request ( client , :read , % {
216+ method: :post ,
217+ path: Paths . browse ( index ) ,
218+ body: Map . new ( opts ) ,
219+ options: req_opts
220+ } ) do
214221 :telemetry . execute (
215222 [ :algolia , :browse , :result ] ,
216223 % { hits: data [ "nbHits" ] , processing_time: data [ "processingTimeMS" ] } ,
0 commit comments