Elastic search front end

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

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 | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror 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.
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?utm_medium=email&utm_source=footer
.
For more options, visit 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.
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.
For more options, visit https://groups.google.com/d/optout.

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
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 | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror 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.
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?utm_medium=email&utm_source=footer
.
For more options, visit 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.
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?utm_medium=email&utm_source=footer
.

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

Look at simple_query_string

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

Jörg

On Mon, Mar 2, 2015 at 9:27 PM, Oranit Dror 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.
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?utm_medium=email&utm_source=footer
.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFjnzjabnVEBJSw53VnehwmDcYh4LW6h_Xnux4CgYcmyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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 | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror <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 <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?utm_medium=email&utm_source=footer
.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5d8e4b46-a68f-42d8-b097-0848fde5508c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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 | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Tue, Mar 3, 2015 at 12:12 PM, Oranit Dror 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 | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror 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.
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?utm_medium=email&utm_source=footer
.
For more options, visit 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.
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?utm_medium=email&utm_source=footer
.

For more options, visit 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.
To view this discussion on the web visit 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.

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

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 | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Tue, Mar 3, 2015 at 12:12 PM, Oranit Dror <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 | @synhershko https://twitter.com/synhershko
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Mon, Mar 2, 2015 at 10:27 PM, Oranit Dror 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.
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?utm_medium=email&utm_source=footer
.
For more options, visit 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 <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?utm_medium=email&utm_source=footer
.

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