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:
-
MyParser: A subclass of
org.apache.lucene.queryparser.classic.QueryParser, with an overridden
parse(String query) method.
-
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.