Aggregations don't seem to work with template queries

If I send a perfectly well formed aggregation query as a template query, I
don't get the aggregation results.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-template-query.html

Is this by design, or is there a workaround? I am using the Java query DSL
and version 1.2.3.

Kind regards,

Luke

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/960b74e9-4ef0-4e34-8b2d-e7c5dbf3930f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Luke,

The page you linked to is for templating just the query section of a search
request. To template the entire search request there is a dedicated
endpoint described in the following link:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html

Let me know if this helps or not,

Colin

On Friday, 28 November 2014 11:37:26 UTC, Luke Wilson-Mawer wrote:

If I send a perfectly well formed aggregation query as a template query, I
don't get the aggregation results.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-template-query.html

Is this by design, or is there a workaround? I am using the Java query DSL
and version 1.2.3.

Kind regards,

Luke

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d16e23bb-cb65-4b43-bd1e-9d8b797e4f53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sorry, this is the link I meant to attach:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html

Colin

On Friday, 28 November 2014 11:48:10 UTC, Colin Goodheart-Smithe wrote:

Hi Luke,

The page you linked to is for templating just the query section of a
search request. To template the entire search request there is a dedicated
endpoint described in the following link:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html

Let me know if this helps or not,

Colin

On Friday, 28 November 2014 11:37:26 UTC, Luke Wilson-Mawer wrote:

If I send a perfectly well formed aggregation query as a template query,
I don't get the aggregation results.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-template-query.html

Is this by design, or is there a workaround? I am using the Java query
DSL and version 1.2.3.

Kind regards,

Luke

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f222c11f-8f67-408d-9ed3-d388ce6ac5cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Colin,

Thanks Colin. This does seem like it's the problem. I am building the query
with the java query DSL but it seems to just stick the whole thing into the
query section.

TemplateQueryBuilder qb = new TemplateQueryBuilder(myQueryString, myParams)

SearchResponse resp = client.prepareSearch(index).setQuery(qb
).execute().actionGet();

Any idea how to get the Java API to point to the template endpoint?

Luke

On Friday, 28 November 2014 11:48:10 UTC, Colin Goodheart-Smithe wrote:

Hi Luke,

The page you linked to is for templating just the query section of a
search request. To template the entire search request there is a dedicated
endpoint described in the following link:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html

Let me know if this helps or not,

Colin

On Friday, 28 November 2014 11:37:26 UTC, Luke Wilson-Mawer wrote:

If I send a perfectly well formed aggregation query as a template query,
I don't get the aggregation results.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-template-query.html

Is this by design, or is there a workaround? I am using the Java query
DSL and version 1.2.3.

Kind regards,

Luke

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d13daac4-2092-4c87-b3d8-ef4c4a918337%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.