# Elastic search front end

**URL:** <https://discuss.elastic.co/t/elastic-search-front-end/22479>\
**Category:** Elasticsearch\
**Created:** [March 2, 2015, 8:27pm UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479 "2015-03-02T20:27:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oranit\_Dror](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@Oranit\_Dror](https://discuss.elastic.co/u/Oranit_Dror)\
**Post date:** [March 2, 2015, 8:27pm UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/1 "2015-03-02T20:27:13Z")

</div>

Hi,

I am new to ElasticSearch and have a newbie question: I want to have a  
user-friendly front-end to the data with a free text search bar. In this  
search bar the user inputs a query string, which I would like to parse and  
transform to a new string (application-dependent) that will be used on  
ElasticSearch. I then want to highlight the matching search terms in the  
results. I have implemented a similar application in Solr.

I thought of using Kibana's Discover page. Is there a way to hook into  
Kibana and/or ElasticSearch, so I can transform the user's query string  
before it is sent to ES and highlight the results?

Regards,  
Oranit

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [March 2, 2015, 8:46pm UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/2 "2015-03-02T20:46:22Z")

</div>

You can write your own QueryParser as a plugin but that sounds like an  
overkill. If all you need is display some highlighted results its easy  
enough to do in any language and I'd say you don't really need Kibana for  
that

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror [oranit@gmail.com](mailto:oranit@gmail.com) wrote:

> Hi,
> 
> I am new to Elasticsearch and have a newbie question: I want to have a  
> user-friendly front-end to the data with a free text search bar. In this  
> search bar the user inputs a query string, which I would like to parse and  
> transform to a new string (application-dependent) that will be used on  
> Elasticsearch. I then want to highlight the matching search terms in the  
> results. I have implemented a similar application in Solr.
> 
> I thought of using Kibana's Discover page. Is there a way to hook into  
> Kibana and/or Elasticsearch, so I can transform the user's query string  
> before it is sent to ES and highlight the results?
> 
> Regards,  
> Oranit
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu8koPc\_snQq-4MSyPDNPFvL5L-r83RocRH%3D\_YWK\_zY3Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu8koPc_snQq-4MSyPDNPFvL5L-r83RocRH%3D_YWK_zY3Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [March 2, 2015, 8:59pm UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/3 "2015-03-02T20:59:34Z")

</div>

Usually you'd use match or phrase\_prefix query for the user's string and  
then just enable highlighting. That _should_ be enough to get started.

Nik

On Mon, Mar 2, 2015 at 3:46 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)  
wrote:

> You can write your own QueryParser as a plugin but that sounds like an  
> overkill. If all you need is display some highlighted results its easy  
> enough to do in any language and I'd say you don't really need Kibana for  
> that
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> [Lucene.NET](http://Lucene.NET) committer and PMC member
> 
> On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror [oranit@gmail.com](mailto:oranit@gmail.com) wrote:
> 
> > Hi,
> > 
> > I am new to Elasticsearch and have a newbie question: I want to have a  
> > user-friendly front-end to the data with a free text search bar. In this  
> > search bar the user inputs a query string, which I would like to parse and  
> > transform to a new string (application-dependent) that will be used on  
> > Elasticsearch. I then want to highlight the matching search terms in the  
> > results. I have implemented a similar application in Solr.
> > 
> > I thought of using Kibana's Discover page. Is there a way to hook into  
> > Kibana and/or Elasticsearch, so I can transform the user's query string  
> > before it is sent to ES and highlight the results?
> > 
> > Regards,  
> > Oranit
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu8koPc\_snQq-4MSyPDNPFvL5L-r83RocRH%3D\_YWK\_zY3Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu8koPc_snQq-4MSyPDNPFvL5L-r83RocRH%3D_YWK_zY3Q%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu8koPc\_snQq-4MSyPDNPFvL5L-r83RocRH%3D\_YWK\_zY3Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu8koPc_snQq-4MSyPDNPFvL5L-r83RocRH%3D_YWK_zY3Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd203YuzpuuMQQrXsrH%3DHOWeSa928fRHgoXS415wProzOA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd203YuzpuuMQQrXsrH%3DHOWeSa928fRHgoXS415wProzOA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 2, 2015, 9:14pm UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/4 "2015-03-02T21:14:47Z")

</div>

Look at simple\_query\_string

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

in that case, there is not much to do about transforming. Hihglighting is  
supported independently from user's query string, the field mappingneed  
some attention

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Jörg

On Mon, Mar 2, 2015 at 9:27 PM, Oranit Dror [oranit@gmail.com](mailto:oranit@gmail.com) wrote:

> Hi,
> 
> I am new to Elasticsearch and have a newbie question: I want to have a  
> user-friendly front-end to the data with a free text search bar. In this  
> search bar the user inputs a query string, which I would like to parse and  
> transform to a new string (application-dependent) that will be used on  
> Elasticsearch. I then want to highlight the matching search terms in the  
> results. I have implemented a similar application in Solr.
> 
> I thought of using Kibana's Discover page. Is there a way to hook into  
> Kibana and/or Elasticsearch, so I can transform the user's query string  
> before it is sent to ES and highlight the results?
> 
> Regards,  
> Oranit
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFjnzjabnVEBJSw53VnehwmDcYh4LW6h\_Xnux4CgYcmyQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFjnzjabnVEBJSw53VnehwmDcYh4LW6h_Xnux4CgYcmyQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Oranit\_Dror](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@Oranit\_Dror](https://discuss.elastic.co/u/Oranit_Dror)\
**Post date:** [March 3, 2015, 10:12am UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/5 "2015-03-03T10:12:10Z")

</div>

Hi,

I will be glad to get some more information on your suggestion to write my  
own QueryParser as a plugin. To be more specific, I would like that this  
parser will do some Natural Language processing on the full text query  
string, supplied by the user, in the front-end search bar. In fact, in SolR  
I have implemented such a parser (as a QParserPlugin subclass). The output  
of the parser plugin should be a new string that I would like to give to  
Elasticsearch.

Additionally, before displaying the returned results, I would like to add  
my own code for selecting the text that I would like to highlight. In SolR,  
I have implemented a class that extends the  
DefaultSolrHighlighter class.

thank you,  
Oranit.

On Monday, March 2, 2015 at 10:46:32 PM UTC+2, Itamar Syn-Hershko wrote:

> You can write your own QueryParser as a plugin but that sounds like an  
> overkill. If all you need is display some highlighted results its easy  
> enough to do in any language and I'd say you don't really need Kibana for  
> that
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> [Lucene.NET](http://Lucene.NET) committer and PMC member
> 
> On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror \<[ora...@gmail.com](mailto:ora...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi,
> > 
> > I am new to Elasticsearch and have a newbie question: I want to have a  
> > user-friendly front-end to the data with a free text search bar. In this  
> > search bar the user inputs a query string, which I would like to parse and  
> > transform to a new string (application-dependent) that will be used on  
> > Elasticsearch. I then want to highlight the matching search terms in the  
> > results. I have implemented a similar application in Solr.
> > 
> > I thought of using Kibana's Discover page. Is there a way to hook into  
> > Kibana and/or Elasticsearch, so I can transform the user's query string  
> > before it is sent to ES and highlight the results?
> > 
> > Regards,  
> > Oranit
> > 
> > --  
> > 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](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [March 3, 2015, 10:58am UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/6 "2015-03-03T10:58:48Z")

</div>

You just need to create a Lucene QueryParser (implementing QueryBuilder)  
and register it like so:

> <https://github.com/elastic/elasticsearch/issues/3264#issuecomment-20247436>
>
> Hi,
> 
> IndicesQueriesModule's addQuery and addFilter method's signatures seems wei…rd..
> I can not register my custom parser's class..
> 
> They should be changed to Class\<? extends QueryParser\> and Class\<? extends FilterParser\> respectively..
> 
> \`\`\`
> public synchronized IndicesQueriesModule addQuery(Class\<QueryParser\> queryParser) {
> queryParsersClasses.add(queryParser);
> return this;
> }
> 
> 
> public synchronized IndicesQueriesModule addFilter(Class\<FilterParser\> filterParser) {
> filterParsersClasses.add(filterParser);
> return this;
> }
> \`\`\`
> 
> thanks.

However, Elasticsearch provides a very good and expressive query DSL - so  
I'd rather look at doing this on your search facade, and generate a verbose  
query JSON to send to Elasticsearch. Many things that you have to support  
in Solr via custom query parsers can be done using the provided query DSL  
with Elasticsearch because JSON is way better than LocalParams etc

Alternatively, NLP and POS tagging could be done also on the analysis  
level. I'd look at doing using TeeSinkTolenFilters.

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
[Lucene.NET](http://Lucene.NET) committer and PMC member

On Tue, Mar 3, 2015 at 12:12 PM, Oranit Dror [oranit@gmail.com](mailto:oranit@gmail.com) wrote:

> Hi,
> 
> I will be glad to get some more information on your suggestion to write my  
> own QueryParser as a plugin. To be more specific, I would like that this  
> parser will do some Natural Language processing on the full text query  
> string, supplied by the user, in the front-end search bar. In fact, in SolR  
> I have implemented such a parser (as a QParserPlugin subclass). The output  
> of the parser plugin should be a new string that I would like to give to  
> Elasticsearch.
> 
> Additionally, before displaying the returned results, I would like to add  
> my own code for selecting the text that I would like to highlight. In SolR,  
> I have implemented a class that extends the  
> DefaultSolrHighlighter class.
> 
> thank you,  
> Oranit.
> 
> On Monday, March 2, 2015 at 10:46:32 PM UTC+2, Itamar Syn-Hershko wrote:
> 
> > You can write your own QueryParser as a plugin but that sounds like an  
> > overkill. If all you need is display some highlighted results its easy  
> > enough to do in any language and I'd say you don't really need Kibana for  
> > that
> > 
> > --
> > 
> > Itamar Syn-Hershko  
> > [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> > Freelance Developer & Consultant  
> > [Lucene.NET](http://Lucene.NET) committer and PMC member
> > 
> > On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror [ora...@gmail.com](mailto:ora...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I am new to Elasticsearch and have a newbie question: I want to have a  
> > > user-friendly front-end to the data with a free text search bar. In this  
> > > search bar the user inputs a query string, which I would like to parse and  
> > > transform to a new string (application-dependent) that will be used on  
> > > Elasticsearch. I then want to highlight the matching search terms in the  
> > > results. I have implemented a similar application in Solr.
> > > 
> > > I thought of using Kibana's Discover page. Is there a way to hook into  
> > > Kibana and/or Elasticsearch, so I can transform the user's query string  
> > > before it is sent to ES and highlight the results?
> > > 
> > > Regards,  
> > > Oranit
> > > 
> > > --  
> > > 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](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zs%2BbzJzkcPY7FYi0W7FDuYf9v-9%3DngL\_PXhtokCgBPDzQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zs%2BbzJzkcPY7FYi0W7FDuYf9v-9%3DngL_PXhtokCgBPDzQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Oranit\_Dror](https://avatars.discourse-cdn.com/v4/letter/o/958977/32.png) [@Oranit\_Dror](https://discuss.elastic.co/u/Oranit_Dror)\
**Post date:** [March 4, 2015, 8:38am UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/7 "2015-03-04T08:38:23Z")

</div>

Hi,

Thank you very much! I have followed your advice, but I am unsure how to  
make ES to use my parser instead of the default one.  
Specifically, I have written two classes:

1. MyParser: A subclass of  
org.apache.lucene.queryparser.classic.QueryParser, with an overridden  
parse(String query) method.

2. A subclass of org.elasticsearch.plugins.AbstractPlugin with:

public String name() { return "custom\_query"; }

public void onModule(IndexQueryParserModule module) {  
module.addQueryParser("custom\_query", MyParser.class);  
}

Then, I have exported the classes to a jar file and placed the jar under my  
ELASTIC\_SEARCH\_HOME\_DIR/plugins directory

Is there something else that I should do?

Best,  
Oranit.

On Tuesday, March 3, 2015 at 12:58:57 PM UTC+2, Itamar Syn-Hershko wrote:

> You just need to create a Lucene QueryParser (implementing QueryBuilder)  
> and register it like so:  
> [custom query parser registration · Issue #3264 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3264#issuecomment-20247436)
> 
> However, Elasticsearch provides a very good and expressive query DSL - so  
> I'd rather look at doing this on your search facade, and generate a verbose  
> query JSON to send to Elasticsearch. Many things that you have to support  
> in Solr via custom query parsers can be done using the provided query DSL  
> with Elasticsearch because JSON is way better than LocalParams etc
> 
> Alternatively, NLP and POS tagging could be done also on the analysis  
> level. I'd look at doing using TeeSinkTolenFilters.
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> [Lucene.NET](http://Lucene.NET) committer and PMC member
> 
> On Tue, Mar 3, 2015 at 12:12 PM, Oranit Dror \<[ora...@gmail.com](mailto:ora...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi,
> > 
> > I will be glad to get some more information on your suggestion to write  
> > my own QueryParser as a plugin. To be more specific, I would like that this  
> > parser will do some Natural Language processing on the full text query  
> > string, supplied by the user, in the front-end search bar. In fact, in SolR  
> > I have implemented such a parser (as a QParserPlugin subclass). The output  
> > of the parser plugin should be a new string that I would like to give to  
> > Elasticsearch.
> > 
> > Additionally, before displaying the returned results, I would like to add  
> > my own code for selecting the text that I would like to highlight. In SolR,  
> > I have implemented a class that extends the  
> > DefaultSolrHighlighter class.
> > 
> > thank you,  
> > Oranit.
> > 
> > On Monday, March 2, 2015 at 10:46:32 PM UTC+2, Itamar Syn-Hershko wrote:
> > 
> > > You can write your own QueryParser as a plugin but that sounds like an  
> > > overkill. If all you need is display some highlighted results its easy  
> > > enough to do in any language and I'd say you don't really need Kibana for  
> > > that
> > > 
> > > --
> > > 
> > > Itamar Syn-Hershko  
> > > [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> > > Freelance Developer & Consultant  
> > > [Lucene.NET](http://Lucene.NET) committer and PMC member
> > > 
> > > On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror [ora...@gmail.com](mailto:ora...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I am new to Elasticsearch and have a newbie question: I want to have a  
> > > > user-friendly front-end to the data with a free text search bar. In this  
> > > > search bar the user inputs a query string, which I would like to parse and  
> > > > transform to a new string (application-dependent) that will be used on  
> > > > Elasticsearch. I then want to highlight the matching search terms in the  
> > > > results. I have implemented a similar application in Solr.
> > > > 
> > > > I thought of using Kibana's Discover page. Is there a way to hook into  
> > > > Kibana and/or Elasticsearch, so I can transform the user's query string  
> > > > before it is sent to ES and highlight the results?
> > > > 
> > > > Regards,  
> > > > Oranit
> > > > 
> > > > --  
> > > > 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](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/648dfc5a-49e4-4a82-8b4a-2497a90dad42%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/19c77bbe-7714-4b60-9cb7-c61b9ff30e89%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/19c77bbe-7714-4b60-9cb7-c61b9ff30e89%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:28am UTC](https://discuss.elastic.co/t/elastic-search-front-end/22479/8 "2017-07-06T00:28:40Z")

</div>


