Multisearch questions: facets and query string

Hi,

I do a multisearch with:
{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t1" :
{"terms" : {"field" : "tags1", "size" : 20}}}}

{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t2" :
{"terms" : {"field" : "tags1", "size" : 20}}}}

(twice the exact same request).

And, I get:
$ curl -XGET 'localhost:9200/_msearch?search_type=count&pretty=1'
--data-binary @requests; echo
{
"responses" : [ {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 6,
"max_score" : 0.0,
"hits" : [ ]
},
"facets" : {
"text_t1" : {
"_type" : "terms",
"missing" : 0,
"total" : 6,
"other" : 0,
"terms" : [ {
"term" : "extérieur",
"count" : 2
}, {
"term" : "autre",
"count" : 2
}, {
"term" : "nouveau",
"count" : 1
}, {
"term" : "intérieur",
"count" : 1
} ]
}
}
}, {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 10,
"max_score" : 0.0,
"hits" : [ ]
}
} ]
}

Why do I get only text_t1 facet (and not text_t2)?
Why is the hits total different?

Last question: Is it possible to pass the queries as url parameter for a
multisearch (my client doesn't let me define bodies for GET requests)?

Thanks for your help.

Benoît

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Is there an empty line between both requests?
It should not.

If you can reproduce it, can you create a full curl recreation, gist it and open an issue?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 29 mai 2013 à 23:49, benq benoit.quartier@gmail.com a écrit :

Hi,

I do a multisearch with:
{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t1" : {"terms" : {"field" : "tags1", "size" : 20}}}}

{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t2" : {"terms" : {"field" : "tags1", "size" : 20}}}}

(twice the exact same request).

And, I get:
$ curl -XGET 'localhost:9200/_msearch?search_type=count&pretty=1' --data-binary @requests; echo
{
"responses" : [ {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 6,
"max_score" : 0.0,
"hits" : [ ]
},
"facets" : {
"text_t1" : {
"_type" : "terms",
"missing" : 0,
"total" : 6,
"other" : 0,
"terms" : [ {
"term" : "extérieur",
"count" : 2
}, {
"term" : "autre",
"count" : 2
}, {
"term" : "nouveau",
"count" : 1
}, {
"term" : "intérieur",
"count" : 1
} ]
}
}
}, {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 10,
"max_score" : 0.0,
"hits" : [ ]
}
} ]
}

Why do I get only text_t1 facet (and not text_t2)?
Why is the hits total different?

Last question: Is it possible to pass the queries as url parameter for a multisearch (my client doesn't let me define bodies for GET requests)?

Thanks for your help.

Benoît

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David,

As you pointed it, the problem was the empty line between the two requests.
For those who want to use the multi search API, note that the request file
must also end with an empty line.

Do you know if the multi search API can be used with query string as
parameter, as described
here http://www.elasticsearch.org/guide/reference/api/search/uri-request/ ?
The documentation just says that not all search options are exposed,
without saying which are not exposed.

Thanks for your help.

Benoît

Le jeudi 30 mai 2013 07:18:02 UTC+2, David Pilato a écrit :

Is there an empty line between both requests?
It should not.

If you can reproduce it, can you create a full curl recreation, gist it
and open an issue?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 29 mai 2013 à 23:49, benq <benoit....@gmail.com <javascript:>> a
écrit :

Hi,

I do a multisearch with:
{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t1" :
{"terms" : {"field" : "tags1", "size" : 20}}}}

{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t2" :
{"terms" : {"field" : "tags1", "size" : 20}}}}

(twice the exact same request).

And, I get:
$ curl -XGET 'localhost:9200/_msearch?search_type=count&pretty=1'
--data-binary @requests; echo
{
"responses" : [ {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 6,
"max_score" : 0.0,
"hits" : [ ]
},
"facets" : {
"text_t1" : {
"_type" : "terms",
"missing" : 0,
"total" : 6,
"other" : 0,
"terms" : [ {
"term" : "extérieur",
"count" : 2
}, {
"term" : "autre",
"count" : 2
}, {
"term" : "nouveau",
"count" : 1
}, {
"term" : "intérieur",
"count" : 1
} ]
}
}
}, {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 10,
"max_score" : 0.0,
"hits" : [ ]
}
} ]
}

Why do I get only text_t1 facet (and not text_t2)?
Why is the hits total different?

Last question: Is it possible to pass the queries as url parameter for a
multisearch (my client doesn't let me define bodies for GET requests)?

Thanks for your help.

Benoît

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

As far as I can see, only search_type and ignore_indices parameters are supported in _msearch parameters.
So q=* does not work here.

So you should pass parameters using QueryDSL.

About documentation, I can read at the bottom of this page: http://www.elasticsearch.org/guide/reference/api/search/uri-request/ the full list of supported parameters for _search end point.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 30 mai 2013 à 23:16, benq benoit.quartier@gmail.com a écrit :

Hi David,

As you pointed it, the problem was the empty line between the two requests.
For those who want to use the multi search API, note that the request file must also end with an empty line.

Do you know if the multi search API can be used with query string as parameter, as described here http://www.elasticsearch.org/guide/reference/api/search/uri-request/ ?
The documentation just says that not all search options are exposed, without saying which are not exposed.

Thanks for your help.

Benoît

Le jeudi 30 mai 2013 07:18:02 UTC+2, David Pilato a écrit :
Is there an empty line between both requests?
It should not.

If you can reproduce it, can you create a full curl recreation, gist it and open an issue?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 29 mai 2013 à 23:49, benq benoit....@gmail.com a écrit :

Hi,

I do a multisearch with:
{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t1" : {"terms" : {"field" : "tags1", "size" : 20}}}}

{}
{"query" : { "term" : {"category" : "sport"} }, "facets" : {"text_t2" : {"terms" : {"field" : "tags1", "size" : 20}}}}

(twice the exact same request).

And, I get:
$ curl -XGET 'localhost:9200/_msearch?search_type=count&pretty=1' --data-binary @requests; echo
{
"responses" : [ {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 6,
"max_score" : 0.0,
"hits" : [ ]
},
"facets" : {
"text_t1" : {
"_type" : "terms",
"missing" : 0,
"total" : 6,
"other" : 0,
"terms" : [ {
"term" : "extérieur",
"count" : 2
}, {
"term" : "autre",
"count" : 2
}, {
"term" : "nouveau",
"count" : 1
}, {
"term" : "intérieur",
"count" : 1
} ]
}
}
}, {
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 10,
"max_score" : 0.0,
"hits" : [ ]
}
} ]
}

Why do I get only text_t1 facet (and not text_t2)?
Why is the hits total different?

Last question: Is it possible to pass the queries as url parameter for a multisearch (my client doesn't let me define bodies for GET requests)?

Thanks for your help.

Benoît

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.