Can you create and gist a full curl recreation as we can reproduce your
concern?
I don't think I understand field as you do. How does your JSon document
look like?
Le 22 janvier 2013 à 17:30, Jimi Parekh <jimip...@gmail.com <javascript:>>
a écrit :
David,
I am trying out few things on this and I getting more confuse. I also
looked into the elasticsearch document but I don't find the proper answer.
Let me explain my scenario and the issue i am facing.
In my indexed document there is a field "@message", with the following
kind of value.
"@message:Track-Id=1234|Token-Id=ABC123XYZ|Receive-Time-MS=1358423498000".
There are other field also like "@source", "@host" etc.
I have about 300 documents indexed.
Now I want to search for the documents where "@message" field has a string
"Track-Id=1234".
Now as per your previous suggestion I create a following search:
curl -XGET 'http://localhost:9200/_search' -d '{
"query" : {
"query_string" : {
"query" : "@message:Track-Id=1234"
}
}
}'
But this returned me all the documents. What wrong I am doing? What is the
better approach for such queries, Query-DSL or Query string?
Thanks.
On Monday, January 21, 2013 5:11:31 PM UTC-5, Jimi Parekh wrote:
David,
I tried your suggestion and it seems working but not giving the expected
result.
I want to search the "@message" field and wherever that field contain the
string 'Von' anywhere in that field I want all those documents.
We can not use wildcard with query_string? I want to use term query then
what will be the exact query syntax.?
Thanks.
On Monday, January 21, 2013 3:36:54 PM UTC-5, David Pilato wrote:
Try this:
$ curl -XGET 'http://localhost:9200/_search' -d '{ "query" : {
"query_string" : {
"query" : "@message:Von"
}
}
}'
I mean that your query doesn't go through the analysis process.
When you index a document, content is analyzed (break into tokens,
lowercased, filtered...) before being indexed.
Von is indexed as von in the inverted index.
If you use a matchQuery or a QueryString it goes through the same
process. So, if you search for Von, in fact you will search for von in the
inverted index and you will find your document.
Make sense?
Le 21 janvier 2013 à 21:15, Jimi Parekh < jimip...@gmail.com> a écrit :
David,
I am new to ES. what do you mean by 'TermQuery is not analyzed"?
I tried to use below two different json format but both gives parsing
error.
{
"query_string" : {
"default_field":"@message",
"query" : "Von"
}
}
{
"query_string" : {
"query" : "@message:Von"
}
}
What will be the exact json for my query?
Thanks.
On Monday, January 21, 2013 3:01:10 PM UTC-5, David Pilato wrote:
TermQuery is not analyzed. So ES try to compare "Von" to "von" which
does not match.
Use a QueryString if you want to do the same search as q=...
HTH
Le 21 janvier 2013 à 20:52, Jimi Parekh < jimip...@gmail.com> a écrit :
Additional Info: When I use query string and pass the same condition it
gives me the desire result. Below is the curl request with query string.
curl -XGET " http://localhost:9200/_search?q=@message:Von&pretty=true"
Please let me know if both the request are translated to same search or
different?
Thanks.
On Monday, January 21, 2013 2:22:24 PM UTC-5, Jimi Parekh wrote:
http://localhost:9200/_search?q=@message:Von&pretty=true
http://localhost:9200/_search?q=@message:Von&pretty=true Hi,
I have included the query dsl in a json file. Below is the exact how my
"input.json" looks like (Please note the use of '*' before and after the
text:
{
"query" : {
"term" : { "@message" : "Von" }
}
}
Belwo is my curl command:
curl -XGET -d @input.json "
http://localhost:9200/_search?q=@message:Von&pretty=true http://localhost:9200/mass-idx/_search"
But it don't find any result. There are many documents having text 'Von'
in the '@message' field, but still it don't find anything.
Is there anything I am doing wrong?
Thanks.
http://localhost:9200/mass-idx/_search
--
http://localhost:9200/mass-idx/_search
http://localhost:9200/mass-idx/_search
--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
--
--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
--
--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs