My Elastic Search query is not giving results, even though the value exsist

27 Views Asked by At

My Elastic Search Query is


GET /My_index_here/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "nested": {
            "path": "positions",
            "query": {
              "bool": {
                "must": [
                  {
                    "wildcard": {
                      "positions.positionID": "04b698d0-afbf-4c09-a21a-d02ec8efaa70"
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    }
  }
}

Even though a record with position id mentioned in the query exists but still its now giving the results

This is the sample output i want

{
  "took" : 60,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "manpower_cv_index_analyzed_accseparated_new3",
        "_type" : "_doc",
        "_id" : "bf03fe1d-4cb0-4e6f-a8a8-3c4b74e9cda3",
        "_score" : 1.0,
        "_source" : {
          "primaryKey" : "bf03fe1d-4cb0-4e6f-a8a8-3c4b74e9cda3",
          "addressList" : [
            {
              "city" : "",
              "country" : "",
              "fullAddress" : "",
              "location" : {
                "longitudeLatitude" : {
                  "lat" : -2.0,
                  "lon" : -2.0
                }
              },
              "prov" : ""
            }
          ],
          "allSkills" : "",
          "allSoftskills" : "null",
          "awards" : "null",
          "corpusId" : "BODY",
          "custBirthDateRange" : "NoAge",
          "custEMail" : "[email protected]",
          "custFirstName" : "ewe",
          "custLastName" : "rfwe",
          "username" : "testk12@yahoo",
          "genderID" : 0,
          "custMiddleName" : "",
          "custOrigine" : "R",
          "custPBCandID" : "null",
          "custSesso" : "null",
          "custURLcvR" : "",
          "custUpdateDate" : "2023-03-03T08:19:50.2300000",
          "candidateUpdateDate" : "0001-01-01T00:00:00",
          "createdDate" : "2023-02-15T19:24:56.1070000",
          "recruiterActivityRange" : "1W",
          "reconnectionDateRange" : "N/A",
          "cvFile" : "",
          "cvId" : "00000000-0000-0000-0000-000000000000",
          "cvLanguage" : "English",
          "cvText" : "",
          "plText" : """
 

     
""",
          "email" : "[email protected]",
          "facebookID" : "",
          "firstname" : "null",
          "fullname" : "ewe rfwe",
          "displayName" : "ewe rfwe",
          "lastname" : "null",
          "linkedInID" : "",
          "references" : "",
          "skypeID" : "",
          "twitterID" : "null",
          "viadeoID" : "null",
          "recruiterComments" : "Recruiter has modified profile details, Recruiter has modified profile details, Recruiter has modified profile details, Recruiter has modified profile details",
          "reconnectionDate" : "0001-01-01T00:00:00",
          "lastTimeIndexed" : "2023-03-03T08:23:23.2328586+00:00",
          "RCandidateId" : "bf03fe1d-4cb0-4e6f-a8a8-3c4b74e9cda3",
          "RAccountId" : [
            "bc73afda-d4f2-42ae-9ec9-32a86e8e445e"
          ],
          "Tags" : [ ],
          "idType" : 0,
          "employeeId" : "",
          "Nationality" : 0,
          "mobilePhone" : "N/A",
          "otherPhone" : "",
          "bestTimeToCall" : "",
          "expectedSalary" : 0,
          "ExpectedSalaryRange" : "<5k",
          "minExpectedSalary" : 0.0,
          "maxExpectedSalary" : 0.0,
          "expectedSalaryPer" : 0,
          "expectedSalaryCurrency" : 21,
          "salaryPerHours" : {
            "gt" : 0.0,
            "gte" : 0.0,
            "lt" : 0.0,
            "lte" : 0.0
          },
          "marketingNotifications" : false,
          "contactByEmail" : false,
          "contactByPhone" : false,
          "contactByText" : false,
          "contractTypeDesc" : "",
          "Classification" : [ ],
          "score" : 0.0,
          "isGeneralPrivacy" : true,
          "generalPrivacyDate" : "2023-02-15T19:24:56.1070000",
          "isLegalNoticePrivacy" : true,
          "legalNoticeSignedDate" : "2023-02-15T19:24:56.1070000",
          "isMarketingPrivacy" : false,
          "marketingPrivacyDate" : "2023-02-15T19:24:56.1070000",
          "isSensitivePrivacy" : false,
          "sensitivePrivacyDate" : "2023-02-15T19:24:56.1070000",
          "lastCandidateActivity" : "2023-02-15T19:24:56.1070000",
          "positionInfoEsLst" : [
            {
              "positionID" : "6c10fa0c-8d9c-49a0-96e7-1c9b2e2b42d6",
              "positionName" : "test1",
              "positionRoleNo" : "",
              "employerID" : "63717ce2-c93a-4686-828e-8499324a99d9",
              "employerName" : "General",
              "sourceName" : "",
              "employeeName" : "",
              "jobStartDate" : "2023-02-15T00:00:00",
              "jobEndDate" : "2023-02-16T00:00:00",
              "candidateFlowStatusTypeID" : 1,
              "candidateFlowStatusID" : "09c75489-5334-4af3-ad80-799393ef3139",
              "lastCandidateFlowStatusDate" : "2023-02-15T00:00:00"
            },
            {
              "positionID" : "04b698d0-afbf-4c09-a21a-d02ec8efaa70",
              "positionName" : "new case",
              "positionRoleNo" : "",
              "employerID" : "63717ce2-c93a-4686-828e-8499324a99d9",
              "employerName" : "General",
              "sourceName" : "Indeed",
              "employeeName" : "",
              "jobStartDate" : "2023-03-01T06:09:12.9430000",
              "jobEndDate" : "2023-03-02T06:09:12.9470000",
              "candidateFlowStatusTypeID" : 3,
              "candidateFlowStatusID" : "c4f2d4b5-17bd-41a0-a171-74b7b15fbb3f",
              "lastCandidateFlowStatusDate" : "2023-03-02T00:00:00"
            }
          ],
          "customFields" : [ ]
        }
      }
    ]
  }
}

i have pasted the mappings in the different question here is the link to the question where mappings is pasted

My Elastic Search query is not giving results, even though the value exist

0

There are 0 best solutions below