# Extending query DSL in plugin

**URL:** <https://discuss.elastic.co/t/extending-query-dsl-in-plugin/12462>\
**Category:** Elasticsearch\
**Created:** [June 18, 2013, 3:45pm UTC](https://discuss.elastic.co/t/extending-query-dsl-in-plugin/12462 "2013-06-18T15:45:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik\_Fassler\_2](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@Erik\_Fassler\_2](https://discuss.elastic.co/u/Erik_Fassler_2)\
**Post date:** [June 18, 2013, 3:45pm UTC](https://discuss.elastic.co/t/extending-query-dsl-in-plugin/12462/1 "2013-06-18T15:45:28Z")

</div>

Hey there,

Since ES has quite a modular architecture, I thought I could extend the  
query DSL in a plugin. More precisely, I wanted to add a new elementParser  
to the SearchService in an attempt to create a new kind of queries I desire.

But it seems this is not possible, am I right? Perhaps I missed something,  
but the ElementParsers are completely shut off from any outside access, it  
seems. Is this something to change or intended? The ElementParsers are  
added to a private ImmutableMap. Isn't the search process something that  
should be extended? Is there a hidden getter/setter anywhere?

My ultimate goal would have been to send multiple queries at once and then  
do some quite custom computations on the facet values of the two result  
sets. Could I achieve something like that using multiple requests perhaps?  
Currently, I send the queries, get the facet values and do the computations  
in my web app. But this doesn't scale so well and I have some overhead  
because I can't access the Lucene index directly. Thus, I wanted to shift  
that code into a plugin.

Any ideas?

Thanks and best regards,

Erik

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![clandestino\_bgd\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clandestino_bgd_2/32/1315_2.png) [@clandestino\_bgd\_2](https://discuss.elastic.co/u/clandestino_bgd_2)\
**Post date:** [June 20, 2013, 7:54pm UTC](https://discuss.elastic.co/t/extending-query-dsl-in-plugin/12462/2 "2013-06-20T19:54:21Z")

</div>

I found elastic  
search-query-accorssvariants[https://github.com/yakaz/elasticsearch-query-acrossvariants](https://github.com/yakaz/elasticsearch-query-acrossvariants)  
as  
an example how to implement a new query parser, but I think this is not  
enough for my use case.  
I would like to have PayloadTermQuery as part of my plugin to behave the  
same way as other TermQueries when combined with filters, facets for  
instance.  
Is it something that would be possible in the near future?

thanks,  
Milan

On Tue, Jun 18, 2013 at 5:45 PM, Erik Fäßler [khituras@gmail.com](mailto:khituras@gmail.com) wrote:

> Hey there,
> 
> Since ES has quite a modular architecture, I thought I could extend the  
> query DSL in a plugin. More precisely, I wanted to add a new elementParser  
> to the SearchService in an attempt to create a new kind of queries I desire.
> 
> But it seems this is not possible, am I right? Perhaps I missed something,  
> but the ElementParsers are completely shut off from any outside access, it  
> seems. Is this something to change or intended? The ElementParsers are  
> added to a private ImmutableMap. Isn't the search process something that  
> should be extended? Is there a hidden getter/setter anywhere?
> 
> My ultimate goal would have been to send multiple queries at once and then  
> do some quite custom computations on the facet values of the two result  
> sets. Could I achieve something like that using multiple requests perhaps?  
> Currently, I send the queries, get the facet values and do the computations  
> in my web app. But this doesn't scale so well and I have some overhead  
> because I can't access the Lucene index directly. Thus, I wanted to shift  
> that code into a plugin.
> 
> Any ideas?
> 
> Thanks and best regards,
> 
> Erik
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:30am UTC](https://discuss.elastic.co/t/extending-query-dsl-in-plugin/12462/3 "2017-07-06T02:30:09Z")

</div>


