elasticsearch-learning-to-rank icon indicating copy to clipboard operation
elasticsearch-learning-to-rank copied to clipboard

Using LTR together with the Go Typed-API Client?

Open rajivprab opened this issue 11 months ago • 0 comments

Are there any guidelines or suggestions around the best way to construct LTR queries using the Go Typed-API client? The client doesn't have support for keywords and structs like sltr. The only option I could think of was:

  1. Construct most of the query, without LTR, using the typed-api client
  2. Marshal the Request into a json-string
  3. Unmarshal the json-string into a generic map[string]interface{}
  4. Insert the LTR portion of the query into the above generic map
  5. Marshal the updated query back into a json
  6. Use the raw json functionality to run the updated query

Is there a better way of accomplishing the above?

rajivprab avatar Aug 02 '23 12:08 rajivprab