Reusing Lucene queries in Elastic Search


(Harsh) #1

Hello,
I am new to elastic search, I have a small sample search application built
in lucene and for some reasons have to migrate the code to elastic search,
I wanted to know if I can use the queries as it is as its written in
Lucene. I would be glad for any help in this.


(David Pilato) #2

Query string should help : http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html

David

Le 13 juin 2012 à 08:58, Harsh harsh.chhatwani@gmail.com a écrit :

Hello,
I am new to elastic search, I have a small sample search application built in lucene and for some reasons have to migrate the code to elastic search, I wanted to know if I can use the queries as it is as its written in Lucene. I would be glad for any help in this.


(Harsh) #3

Could you suggest something in JAVA API?

On Wed, Jun 13, 2012 at 12:31 PM, David Pilato david@pilato.fr wrote:

Query string should help :
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html

David

Le 13 juin 2012 à 08:58, Harsh harsh.chhatwani@gmail.com a écrit :

Hello,
I am new to elastic search, I have a small sample search application
built in lucene and for some reasons have to migrate the code to elastic
search, I wanted to know if I can use the queries as it is as its written
in Lucene. I would be glad for any help in this.

--
Harsh Chhatwani
3rd year student
M.Sc(Hons.)Maths with B.E(Hons.)Computer Science
BITS Pilani
Rajasthan(333031)


(David Pilato) #4

Have a look here : http://www.elasticsearch.org/guide/reference/java-api/search.html
Then, try to play with import static org.elasticsearch.index.query.QueryBuilders.*;

You should find query string builder.

David

Le 13 juin 2012 à 09:05, Harsh Chhatwani harsh.chhatwani@gmail.com a écrit :

Could you suggest something in JAVA API?

On Wed, Jun 13, 2012 at 12:31 PM, David Pilato david@pilato.fr wrote:
Query string should help : http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html

David

Le 13 juin 2012 à 08:58, Harsh harsh.chhatwani@gmail.com a écrit :

Hello,
I am new to elastic search, I have a small sample search application built in lucene and for some reasons have to migrate the code to elastic search, I wanted to know if I can use the queries as it is as its written in Lucene. I would be glad for any help in this.

--
Harsh Chhatwani
3rd year student
M.Sc(Hons.)Maths with B.E(Hons.)Computer Science
BITS Pilani
Rajasthan(333031)


(Shay Banon) #5

Reusing existing queries in Lucene (like custom a query) requires writing a
plugin that registers a query parser that generates that Lucene query. The
query parser knows how to parse the query definition (you effectively add
it to the Query DSL).

On Wed, Jun 13, 2012 at 8:58 AM, Harsh harsh.chhatwani@gmail.com wrote:

Hello,
I am new to elastic search, I have a small sample search application
built in lucene and for some reasons have to migrate the code to elastic
search, I wanted to know if I can use the queries as it is as its written
in Lucene. I would be glad for any help in this.


(system) #6