1

私のデータ:

{
  "rootElement": {
    "names": {
      "name": [
        "Haseb",
        "Anil",
        "Ajinkya",
        {
          "city": "mumbai",
          "state": "maharashtra",
          "job": {
            "second": "bosch",
            "first": "infosys"
          }
        }
      ]
    },
    "places": {
      "place": {
        "origin": "INDIA",
        "current": "GERMANY"
      }
    }
  }
}

jobAPI を使用してフィールドにハッシュ インデックスを作成しました:
http://localhost:8529/_db/_api/index?collection=Metadata

{
  "type": "hash",
  "fields": [
    "rootElement.names.name[*].jobs"
  ]
}

そして、API を使用して検索クエリを作成します:
http://localhost:8529/_db/_api/simple/by-example

{
  "collection": "Metadata",
  "example": {
    "rootElement.names.name[*].jobs ": "bosch"
  }
}

理想的には、含まれているドキュメントのみがjob : bosch結果として返されます。しかし、私にとっては、配列内のすべてのドキュメントを提供しますname[*]。私はどこで間違いをしていますか?

4

1 に答える 1