{
  "testtype" : {
    "properties" : {
      "mobile" : {
        "type" : "string"
      },
      "name" : {
        "type" : "string"
      },
      "number" : {
        "type" : "long"
      }
    }
  }
}

curl -XGET 'http://host:IP/testindex/testtype/_search?pretty'{
  "took" : 3,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 5,
    "max_score" : 1.0,
    "hits" : [ {
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "1",
      "_score" : 1.0, "_source" : {"name":"praveen kumar","mobile":"praveen 
joseph"}
    }, {
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "3",
      "_score" : 1.0, "_source" : {"name":"praveen kumar arepalli"}
    }, {
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "2",
      "_score" : 1.0, "_source" : {"name":"kumar ravi"}
    }, {
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "4",
      "_score" : 1.0, "_source" : {"name":"joseph 
praveen","mobile":"joseph","number":"123"}
    }, {
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "5",
      "_score" : 1.0, "_source" : {"name":"raj sekhar","mobile":"joseph 
praveen","number":"567"}
    } ]
  }
}
This index of type testtype contains 5 documents.

curl -XGET 'http://host:IP/testindex/testtype/_search?pretty' -d 
'{"query":{"term":{"name":"praveen"}},"explain":true}'
{
  "took" : 5,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 3,
    "max_score" : 6.7261667,
    "hits" : [ {
      "_shard" : 0,
      "_node" : "mkEXkeGDQzuq4Z5ONLcVYA",
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "1",
      "_score" : 6.7261667, "_source" : {"name":"praveen 
kumar","mobile":"praveen joseph"},
      "_explanation" : {
        "value" : 6.7261667,
        "description" : "weight(name:praveen in 519) [PerFieldSimilarity], 
result of:",
        "details" : [ {
          "value" : 6.7261667,
          "description" : "fieldWeight in 519, product of:",
          "details" : [ {
            "value" : 1.0,
            "description" : "tf(freq=1.0), with freq of:",
            "details" : [ {
              "value" : 1.0,
              "description" : "termFreq=1.0"
            } ]
          }, {
            "value" : 10.761867,
            "description" : "idf(docFreq=3, maxDocs=69436)"
          }, {
            "value" : 0.625,
            "description" : "fieldNorm(doc=519)"
          } ]
        } ]
      }
    }, {
      "_shard" : 0,
      "_node" : "mkEXkeGDQzuq4Z5ONLcVYA",
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "4",
      "_score" : 6.7261667, "_source" : {"name":"joseph 
praveen","mobile":"joseph","number":"123"},
      "_explanation" : {
        "value" : 6.7261667,
        "description" : "weight(name:praveen in 0) [PerFieldSimilarity], 
result of:",
        "details" : [ {
          "value" : 6.7261667,
          "description" : "fieldWeight in 0, product of:",
          "details" : [ {
            "value" : 1.0,
            "description" : "tf(freq=1.0), with freq of:",
            "details" : [ {
              "value" : 1.0,
              "description" : "termFreq=1.0"
            } ]
          }, {
            "value" : 10.761867,
            "description" : "idf(docFreq=3, maxDocs=69436)"
          }, {
            "value" : 0.625,
            "description" : "fieldNorm(doc=0)"
          } ]
        } ]
      }
    }, {
      "_shard" : 0,
      "_node" : "mkEXkeGDQzuq4Z5ONLcVYA",
      "_index" : "testindex",
      "_type" : "testtype",
      "_id" : "3",
      "_score" : 5.3809333, "_source" : {"name":"praveen kumar arepalli"},
      "_explanation" : {
        "value" : 5.3809333,
        "description" : "weight(name:praveen in 545) [PerFieldSimilarity], 
result of:",
        "details" : [ {
          "value" : 5.3809333,
          "description" : "fieldWeight in 545, product of:",
          "details" : [ {
            "value" : 1.0,
            "description" : "tf(freq=1.0), with freq of:",
            "details" : [ {
              "value" : 1.0,
              "description" : "termFreq=1.0"
            } ]
          }, {
            "value" : 10.761867,
            "description" : "idf(docFreq=3, maxDocs=69436)"
          }, {
            "value" : 0.5,
            "description" : "fieldNorm(doc=545)"
          } ]
        } ]
      }
    } ]
  }
}

Here i used "explain":true 
Could you please explain me 

On Tuesday, 25 March 2014 12:52:16 UTC+5:30, David Pilato wrote:
>
>
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html#search-request-explain
>
>
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>
>
> Le 25 mars 2014 à 08:18, Praveenkumar Arepalli 
> <[email protected]<javascript:>> 
> a écrit :
>
> How to use explain David?
>
>
> On Tue, Mar 25, 2014 at 12:44 PM, David Pilato <[email protected]<javascript:>
> > wrote:
>
>> I understand that you as a developer want to know it.
>> My question is what are you going to do with that information?
>>
>> If it's for debugging purpose then explain is fine.
>>
>>
>> --
>> David ;-)
>> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>>
>>
>> Le 25 mars 2014 à 08:07, Praveenkumar Arepalli 
>> <[email protected]<javascript:>> 
>> a écrit :
>>
>> Hi David,
>> A record have 40 fields
>> if the each field has same word in it then as  a developer I want know 
>> which field is matched
>>
>> Ex: 
>> {
>> "name" : "joseph",
>> "phoneNumber" : "joseph 123",
>> "emailId" : "joseph 234",
>> "address" : "joseph street",
>>  .....
>>
>> }
>> like this 40 fields
>>
>> i am using matchQuery to get results back.
>>
>> My searchText will be "joseph"
>>
>> it is returning results but eagerly waiting to know field is matched.   
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Mar 25, 2014 at 12:29 PM, David Pilato <[email protected]<javascript:>
>> > wrote:
>>
>>> May be using explain option. 
>>>
>>> But question is more "why a user would like knowing that?"
>>> Could you describe a little more your use case and what you are trying 
>>> to achieve? 
>>>
>>>
>>>
>>> --
>>> David ;-)
>>> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>>>
>>>
>>> Le 25 mars 2014 à 07:37, Praveenkumar Arepalli 
>>> <[email protected]<javascript:>> 
>>> a écrit :
>>>
>>> Hi Team, I have little knowledge in elasticsearch but i cannot satisfied 
>>> with what have know.i want to enhance my knowledge.
>>> Here is the question 1.How to know which field is matched in indexed 
>>> document while fetching from Index?
>>> Ex: structure of document in index
>>>
>>> Document #1 { \"name\" : \"praveen kumar\", \"Company\" : \"praveen 
>>> Tech\", \"email\" : \"[email protected] <javascript:>\", \"phone\" : 
>>> \"1234567890\" }
>>> Document #2 { \"name\" : \"joseph\", \"company\": \"praveen Tech\" }
>>>
>>> -- 
>>> 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 [email protected] <javascript:>.
>>>
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elasticsearch/7be39d44-4573-422b-ac69-d22989062b1a%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/7be39d44-4573-422b-ac69-d22989062b1a%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 a topic in the 
>>> Google Groups "elasticsearch" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/elasticsearch/N1MJrXE1Zng/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> [email protected] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elasticsearch/38D636E7-01B5-4E17-BBCD-EBAC6B75E6DC%40pilato.fr<https://groups.google.com/d/msgid/elasticsearch/38D636E7-01B5-4E17-BBCD-EBAC6B75E6DC%40pilato.fr?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Thanks & Regards:
>> Praveenkumar Arepalli
>>  
>> -- 
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/CACuc-KnVn4TdXZGj95tF%3DZo2LfS%2BWZ9CzYJMn4GNFOd-hRQkmA%40mail.gmail.com<https://groups.google.com/d/msgid/elasticsearch/CACuc-KnVn4TdXZGj95tF%3DZo2LfS%2BWZ9CzYJMn4GNFOd-hRQkmA%40mail.gmail.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 a topic in the 
>> Google Groups "elasticsearch" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/elasticsearch/N1MJrXE1Zng/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/78BBE902-889B-4B26-BA32-1D56758D6FE8%40pilato.fr<https://groups.google.com/d/msgid/elasticsearch/78BBE902-889B-4B26-BA32-1D56758D6FE8%40pilato.fr?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Thanks & Regards:
> Praveenkumar Arepalli
>  
> -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/CACuc-Kn38vmWFw%2BRFGG%3DV4xtCCAiDaxvafwen%3Dp6qq82GnVDPg%40mail.gmail.com<https://groups.google.com/d/msgid/elasticsearch/CACuc-Kn38vmWFw%2BRFGG%3DV4xtCCAiDaxvafwen%3Dp6qq82GnVDPg%40mail.gmail.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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/800e1ebf-9633-40c5-9bcd-e9da0c2a26fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to