|
Hi,
I have been reading the documentation and doing a lot of tests but I can not get an answer to this. I need to integrate an application that uses Lucene as search engine with Elastic Search. I already can write in my Elastic Search cluster, but the searches are much more difficult. I have a lot of complex Lucene queries that I am trying to pass to Elastic Search but they didn't work. Is it possible to pass directly a Lucene query to Elastic Search? If yes, how? If not, what should I do in order to get that? Thanks!!! |
|
I assume that you are using Java.
Did you look at this? and this? Does it help? -- Le 13 févr. 2013 à 15:23, elastray <[hidden email]> a écrit : Hi, 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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
|
In reply to this post by elastray
You can a use query_string query.
On Wednesday, February 13, 2013 9:23:29 AM UTC-5, elastray wrote: Hi, 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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
|
In reply to this post by dadoonet
Hi dadoonet,
and thanks for your response! You assume well, I am using java. And Jest to talk to Elastic Search cluster. I am testing that right now, but I am not sure that it is what I am looking for. For what I understand, I think that I have to understand the queries, translate them into Elastic Search nomenclature and then use Jest or the Java API to execute them, isn't it? Is there any other way to do that? Regards! |
|
I see. I don't know the JEST API.
The links I gave are related to Elasticsearch Java client (using transport network layer, 9300-9399 ports and not REST API, 9200-9299 ports). Whatever the Java client you use, you have to find the right query for your use case. Have a look at http://www.elasticsearch.org/guide/reference/query-dsl/ to find the API that suits you the more. HTH -- Le 13 févr. 2013 à 15:39, elastray <[hidden email]> a écrit : Hi dadoonet, 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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
|
In reply to this post by Jérôme Gagnon
Thanks Jerome, I already have been reading that, but I don't know how to use it. Right now I am trying to use a Lucene's BooleanQuery and it is being impossible, so I suppose that I would have to read every query and transform it, isn't it?
Regards! |
|
If you are using a boolean query that already has some clauses in it, you could just add a must clause to your query with the querystringquery inside containing tjhe lucene query.
Or if you already have a lucene query built, you could simply replace your booleanquery with the querystringquery containing the lucene query itself.
-- On Wednesday, February 13, 2013 9:54:47 AM UTC-5, elastray wrote: Thanks Jerome, I already have been reading that, but I don't know how to use 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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
That would be great!! I will try it, but do you have a small example? Thanks!!! |
|
Perhaps I didn't explain myself... I do not have something like "fist AND second", I do have something like this after searching for "test" in the App:
Of course, if I send that to Elastic Search it doesn't works, and I do not see how to translate that... I am not really sure about that but looking into the app code it seems that is the Lucene query... does it makes sense? Thanks!! |
|
Anyone knows why that is working with Solr and not with Elastic Search?
Thanks!!! |
|
I think this should work if you wrap this around a QueryStringQuery as your query, no ? You could try putting it to the q parameter while calling the rest API
On Wednesday, February 13, 2013 11:31:39 AM UTC-5, elastray wrote: Anyone knows why that is working with Solr and not with Elastic Search?-- 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 [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
|
Thanks Jerome!!!
I tried this (using Jest, you know...): Search search = new Search(Search.createQueryWithBuilder(QueryBuilders.queryString(translatedQuery.toString()).toString())); where translatedQuery is my original query, and I am not sure if it works but I get something different this time :). And different is good when you are stuck :D. I will investigate this and let you know if it works!! (first I have to get the facets, and that it is another quest...) Regards!! |
| Powered by Nabble | Edit this page |
