Kibana 我的ElasticSearch查询未给出结果,即使值存在

a64a0gku  于 2023-03-06  发布在  Kibana
关注(0)|答案(1)|浏览(234)

以下是即使值存在也不给我结果的查询

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

第二查询

GET /My_index_here/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "IsGeneralPrivacy": "false"
          }
        }
      ]
    }
  }
}

我的Map是

{
  "My_index_here" : {
    "mappings" : {
      "properties" : ,
        "custEMail" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custFirstName" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custLastName" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custMiddleName" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custOrigine" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custPBCandID" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custSesso" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custSostegnoLav" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custStatus" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custURLcvR" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "custUpdateDate" : {
          "type" : "date"
        },
        "custWebUpdatedate" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "customFields" : {
          "properties" : {
            "fieldName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "fieldValue" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        },
        "cvFile" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "cvId" : {
          "type" : "keyword"
        },
        "cvLanguage" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "cvProfile" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "cvText" : {
          "type" : "text",
          "analyzer" : "analyzer_cvtext"
        },
        "description" : {
          "type" : "text",
          "analyzer" : "analyzer_educations"
        },
        "displayName" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "educations" : {
          "properties" : {
            "EducationStatusID" : {
              "type" : "short"
            },
            "candidateID" : {
              "type" : "keyword"
            },
            "description" : {
              "type" : "text",
              "analyzer" : "analyzer_educations"
            },
            "field" : {
              "properties" : {
                "name" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabel" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabelAnalyzed" : {
                  "type" : "text",
                  "analyzer" : "analyzer_educations"
                }
              }
            },
            "honor" : {
              "properties" : {
                "name" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabel" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabelAnalyzed" : {
                  "type" : "text",
                  "analyzer" : "analyzer_educations"
                }
              }
            },
            "level" : {
              "properties" : {
                "degreeId" : {
                  "type" : "short"
                },
                "name" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabel" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabelAnalyzed" : {
                  "type" : "text",
                  "analyzer" : "analyzer_educations"
                }
              }
            },
            "location" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "period" : {
              "properties" : {
                "duration" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "endDate" : {
                  "type" : "date"
                },
                "period" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "startDate" : {
                  "type" : "date"
                }
              }
            },
            "school" : {
              "properties" : {
                "name" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabel" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabelAnalyzed" : {
                  "type" : "text",
                  "analyzer" : "analyzer_educations"
                }
              }
            }
          }
        },
        "email" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "employeeId" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "expectedSalary" : {
          "type" : "long"
        },
        "expectedSalaryCurrency" : {
          "type" : "long"
        },
        "expectedSalaryPer" : {
          "type" : "long"
        },
        "experiences" : {
          "properties" : {
            "ReasonForLeaving" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "ReportingTo" : {
              "type" : "text",
              "analyzer" : "analyzer_skills_roles"
            },
            "candidateID" : {
              "type" : "keyword"
            },
            "description" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "label" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "location" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "organisation" : {
              "properties" : {
                "industry" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "name" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                }
              }
            },
            "organisationIndustry" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "organisationName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "reasonForLeaving" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "role" : {
              "properties" : {
                "area" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "duration" : {
                  "type" : "float"
                },
                "endDate" : {
                  "type" : "date"
                },
                "name" : {
                  "type" : "text"
                },
                "normalizedLabel" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabelAnalyzed" : {
                  "type" : "text",
                  "analyzer" : "analyzer_skills_roles"
                },
                "period" : {
                  "type" : "date"
                },
                "startDate" : {
                  "type" : "date"
                }
              }
            },
            "roles" : {
              "properties" : {
                "duration" : {
                  "type" : "float"
                },
                "endDate" : {
                  "type" : "date"
                },
                "normalizedLabel" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "normalizedLabelAnalyzed" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                },
                "period" : {
                  "type" : "date"
                },
                "startDate" : {
                  "type" : "date"
                }
              }
            }
          }
        },
        "facebookID" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "field" : {
          "properties" : {
            "normalizedLabelAnalyzed" : {
              "type" : "text",
              "analyzer" : "analyzer_educations"
            }
          }
        },
        "firstname" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "fullname" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "functionalArea" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "genderID" : {
          "type" : "long"
        },
        "generalPrivacyDate" : {
          "type" : "date"
        },
        "haveIncomeSupportID" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "honor" : {
          "properties" : {
            "normalizedLabelAnalyzed" : {
              "type" : "text",
              "analyzer" : "analyzer_educations"
            }
          }
        },
        "iD" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "idType" : {
          "type" : "long"
        },
        "industry" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "internalImpressionTimeStamp" : {
          "type" : "date"
        },
        "isCarOwner" : {
          "type" : "boolean"
        },
        "isDriverLicenseCar" : {
          "type" : "boolean"
        },
        "isGeneralPrivacy" : {
          "type" : "boolean"
        },
        "isLegalNoticePrivacy" : {
          "type" : "boolean"
        },
        "isMarketingPrivacy" : {
          "type" : "boolean"
        },
        "isSensitivePrivacy" : {
          "type" : "boolean"
        },
        "mobilePhone" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "mostRecentRole" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "normalizedLabelAnalyzed" : {
          "type" : "text",
          "analyzer" : "analyzer_skills_roles"
        },
        "objective" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "occupationID" : {
          "type" : "integer"
        },
        "otherPhone" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "plText" : {
          "type" : "text"
        },
        "positionInfoEsLst" : {
          "properties" : {
            "candidateFlowStatusID" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "candidateFlowStatusTypeID" : {
              "type" : "long"
            },
            "employeeName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "employerID" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "employerName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "jobEndDate" : {
              "type" : "date"
            },
            "jobStartDate" : {
              "type" : "date"
            },
            "lastCandidateFlowStatusDate" : {
              "type" : "date"
            },
            "occupationID" : {
              "type" : "long"
            },
            "positionID" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "positionName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "positionRoleNo" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "roleID" : {
              "type" : "long"
            },
            "sourceName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        },
        "positions" : {
          "type" : "nested",
          "properties" : {
            "CandidateFlowStatusID" : {
              "type" : "keyword"
            },
            "CandidateFlowStatusTypeID" : {
              "type" : "integer"
            },
            "EmployeeName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "EmployerID" : {
              "type" : "keyword"
            },
            "EmployerName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "JobEndDate" : {
              "type" : "date"
            },
            "JobStartDate" : {
              "type" : "date"
            },
            "LastCandidateFlowStatusDate" : {
              "type" : "date"
            },
            "OccupationID" : {
              "type" : "integer"
            },
            "PositionID" : {
              "type" : "keyword"
            },
            "PositionRoleNo" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "RoleID" : {
              "type" : "integer"
            },
            "SourceName" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "candidateID" : {
              "type" : "keyword"
            },
            "positionName" : {
              "type" : "text"
            }
          }
        },
        "primaryKey" : {
          "type" : "keyword"
        },
        
      }
    }
  }
}

有些查询返回结果,有些查询没有返回结果,以上两个查询没有给出任何结果,即使存在许多具有这些值的记录,并且当我使用它们的emailid或任何其它字段搜索它们时,这些值会出现

ewm0tg9j

ewm0tg9j1#

您的字段名为PositionID,初始大写字母为P

"PositionID" : {
          "type" : "keyword"
        },

因此,您的查询应该是

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

相关问题