Elastic Search Indexing and Search Issue


(Ranveer Kumar Singh) #1

search query formed for searching the documents with given skills.

GET resume_index/_search
{
"query": {
"bool" : {
"must" : [ {
"ids" : {
"types" : [],
"values" : [ "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228" ]
}
}, {
"bool" : {
"should" : [ {
"match" : {
"skills" : {
"query" : "c#",
"type" : "phrase",
"analyzer" : "synonym"

                }
              }
            }, {
              "match" : {
                "skills" : {
                  "query" : "asp.net",
                  "type" : "phrase",
                  "analyzer" : "synonym"

                }
              }
            } ],
            "minimum_should_match" : "1"
          }
        }, {
          "match" : {
            "skills" : {
              "query" : "c#",
              "type" : "phrase",
               "analyzer" : "synonym"


            }
          }
        } ]
      }
       }
    }

Result is coming when i replace c# with other skill like java. But if c# or .net is mentioned in search query it is result is comin blank even those skills are already indexed.

{
"took": 11,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 0.40027505,
"hits": [
{
"_index": "resume_index",
"_type": "phrase",
"_id": "198",
"_score": 0.40027505,
"_source": {
"content": "",
"skills": [
"10g",
"c++",
"crystal report",
"ms-access",
"real estate",
"ui",
".net",
"ado",
"c#",
"database",
"java",

               ]
            }
         },
         
         {
            "_index": "resume_index",
            "_type": "phrase",
            "_id": "208",
            "_score": 0.3556832,
            "_source": {
               "content": "",
               "skills": [
                  "c++",
                 ".net",
                  "ado",
                  "c#",
                 "java",
                  "mvc",
                 "asp.net",
                  "c programming",
                  "css",
                  "development methodologies",
                  "entity framework",
                  "management",
                 
               ]
            }
         }
      ]
   }
}

Content section i have removed because of max character allowed. You can see that c# is indexed in document but still not able to get the result.


(system) #2