Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Multisearch is not formatted correctly #245

Closed
hlassiege opened this issue Oct 9, 2015 · 1 comment
Closed

Multisearch is not formatted correctly #245

hlassiege opened this issue Oct 9, 2015 · 1 comment
Labels

Comments

@hlassiege
Copy link

I'm not sure exactly if I use multisearch correctly but I've a request produced by Jest like this :

{"index" : "test", "type" : "test"}
{
    "query" : {
        "query" : { 
          "match_all" : {} 
        }
    }
}

However, this is not correct, it should have been

{"index" : "test", "type" : "test"}
{ "query" : {      "match_all" : {}         }}

(Everything on the same line, only one query)

I used a query build to build the Search into the Multisearch object :

List searches = new ArrayList<>();
// build Searches
MultiSearch multiSearch = new MultiSearch.Builder(searches).build();

Any idea what could be wrong ?

@kramer
Copy link
Member

kramer commented Oct 11, 2015

See MultiSearchIntegrationTest for example usage.

You are right that query should be on a single line and it is user's responsibility to provide it without line breaks to Jest just as they would do to ES. There is no line break replacement on Jest side to counter this because it's bit of a destructive process that could potentially effect the actual data.

As for the fact that query element is present twice: the outer query element inserted by MultiSearch should not have been there, probably result of an assumption carried out from past, I have fixed that now.

@kramer kramer added the bug label Oct 11, 2015
@kramer kramer closed this as completed Oct 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants