Reactivesearch и его компоненты - PullRequest
0 голосов
/ 17 июня 2020

Я пытаюсь извлечь все такие данные, class = "person".

У меня есть вложенный объект в одном из моих полей, и я определил сопоставление:

    "mappings": {

    "properties": {
        "date":{"type":"date"},
        "time":{ "type": "text"},
        "frame_id": {"type":"integer"},
        "camera_id":{"type":"integer"},
        "path":{"type":"text"},
        "objects" : {"type": "nested", 
             "properties": {
                  "class":    { "type": "text"  },
                  "confidence": { "type": "float"  }, 
                  "coordinates":{ "type": "nested" ,
                      "properties": { "x" :{"type":"float"},
                                      "y" :{"type":"float"},
                                      "w" :{"type":"float"},
                                      "h" :{"type":"float"}
                      }
                  }
             }
        }
    }
}

Это это мой компонент поиска данных

<DataSearch // text
componentId="authors"

dataField="objects"
placeholder="Search by Class"
autosuggest={true}
className="datasearch"
        innerClass={{
          "input": "searchbox",
          "list": "suggestionlist"
        }}
customQuery={ (value,props) => {
    return {
            "query": {
                "nested": {
                  "path": "objects",
                  "query": {
                    "bool": {
                      "must": [
                        { "match": { "objects.class":  value }}
                      ]
                    }
                  }
                }
              }
            }
          }} />

, но когда я попытался выполнить поиск в строке поиска, появляется следующая ошибка:

Something went wrong! Error details {"type":"default","status":400,"ok":false,"statusText":"Bad Request","headers":{"map":{"content-type":"application/json; charset=UTF-8"}},"url":"http://localhost:9200/vid_detect/_msearch?","_bodyInit":{},"_bodyBlob":{},"bodyUsed":true}
...