elasticsearch查询具有相似名称的多个嵌套对象

xxe27gdn  于 2021-06-09  发布在  ElasticSearch
关注(0)|答案(0)|浏览(201)

我想搜索多个具有类似名称的嵌套对象数据我的数据Map在json文件中包含以下嵌套字段
我在asp.net核心网站上工作,搜索视频中的一个实体将视频转换为json后,我得到了一个json文件。现在我想通过搜索在不同时间包含该特定实体的所有视频来访问json文件中实体的出现时间
例如,我想搜索足球然后它应该返回给我一个json的洞察点击率为所有视频包含足球作为标签,关键字或文本等。

{
    "properties": {
      "name": {
        "type": "text",
        "analyzer": "string_lowercase",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "id": {
        "type": "text",
        "analyzer": "string_lowercase",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },
      "privacyMode": {
        "type": "text",
        "analyzer": "string_lowercase",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      },

      "duration": {
        "type": "nested",
        "properties": {
          "time": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "seconds": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          }
        }
      },
      "keywords": {
        "type": "nested",
        "properties": {
          "isTranscript": {
            "type": "boolean",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "id": {
            "type": "long",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "emotions": {
        "type": "nested",
        "properties": {
          "type": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "seenDurationRatio": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "audioEffects": {
        "type": "nested",
        "properties": {
          "type": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "seenDurationRatio": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "labels": {
        "type": "nested",
        "properties": {
          "id": {
            "type": "long",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "framePatterns": {
        "type": "nested",
        "properties": {
          "id": {
            "type": "long",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "brands": {
        "type": "nested",
        "properties": {
          "referenceId": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "referenceUrl": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "confidence": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "description": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "seenDuration": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "id": {
            "type": "long",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "namedLocations": {
        "type": "nested",
        "properties": {
          "referenceId": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "referenceUrl": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "confidence": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "description": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "seenDuration": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "id": {
            "type": "long",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "namedPeople": {
        "type": "nested",
        "properties": {
          "referenceId": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "referenceUrl": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "confidence": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "description": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "seenDuration": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "id": {
            "type": "long",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      },
      "topics": {
        "type": "nested",
        "properties": {
          "referenceUrl": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "iptcName": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "iabName": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "confidence": {
            "type": "float",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "id": {
            "type": "long",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "text",
            "analyzer": "string_lowercase",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "appearances": {
            "type": "nested",
            "properties": {
              "startTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endTime": {
                "type": "text",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "startSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "endSeconds": {
                "type": "float",
                "analyzer": "string_lowercase",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      }
    }

}

例如,我想搜索一个视频名称包含关键字和标签为“电子”
对此应该有什么查询??

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题