Query Parser in Elastic Search, JAVA API


(Harsh) #1

Hello, I am new to elasticsearch and have been trying to use query parser.
Can anyone guide me in how to do that? any help would be appreciated.


(David Pilato) #2

What did you do ?
What is the failure ?

See : http://www.elasticsearch.org/help/

David

Le 14 juin 2012 à 06:53, Harsh harsh.chhatwani@gmail.com a écrit :

Hello, I am new to elasticsearch and have been trying to use query parser. Can anyone guide me in how to do that? any help would be appreciated.


(Harsh) #3

I didn't do anything, I don't know how to do it,
See, like in lucene first we create a QueryParser object and then with this
object using the parse() method we create a query. Is there anything like
this in elasticsearch?


(David Pilato) #4

I'm afraid not to understand.

Are you looking for something else that the example in ES site frontpage ?
$ curl -XPUT http://localhost:9200/twitter/tweet/2 -d '{
"user": "kimchy",
"post_date": "2009-11-15T14:12:12",
"message": "You know, for Search"
}'

$ curl -XGET http://localhost:9200/twitter/tweet/_search?q=user:kimchy

$ curl -XGET http://localhost:9200/twitter/tweet/_search -d '{
"query" : {
"term" : { "user": "kimchy" }
}
}'

$ curl -XGET http://localhost:9200/twitter/_search?pretty=true -d '{
"query" : {
"range" : {
"post_date" : {
"from" : "2009-11-15T13:00:00",
"to" : "2009-11-15T14:30:00"
}
}
}
}'

is it what you are after ?

Sorry if I misunderstood.

Le 14 juin 2012 à 07:35, Harsh harsh.chhatwani@gmail.com a écrit :

I didn't do anything, I don't know how to do it,
See, like in lucene first we create a QueryParser object and then with this object using the parse() method we create a query. Is there anything like this in elasticsearch?


(system) #5