나는 아래의 형식을 가지고 있으며 elasticsearch를 사용하여 대량으로 사전 처리하기를 원합니다.탄성 검색을 위해 JSON 형식을 일괄 변경하는 방법
{"title":"April","url":"https://simple.wikipedia.org/wiki/April", "abstract":"April is the 4th month of the year, and comes between March and May. It is one of four months to have 30 days.","sections":["The Month","April in poetry","Events in April","Fixed Events","Moveable Events","Selection of Historical Events","Trivia","References"]}
{"title":"August","url":"https://simple.wikipedia.org/wiki/August", "abstract":"August (Aug.) is the 8th month of the year in the Gregorian calendar, coming between July and September.","sections":["The Month","August observances","Fixed observances and events","Moveable and Monthlong events","Selection of Historical Events","Trivia","References"]}
인덱스를 추가하려고 할 때 각 줄 앞에 입력하십시오. 읽기 이전 게시물에
{"index":{"_index":"myindex","_type":"wiki","_id":"1"}}
나는 아래와 같은 Kevin Marsh's post을 사용하고 있습니다 :
cat file.json jq -c '.[] | {"index": {"_index": "myindex", "_type": "wiki", "_id": .id}}, .'
는 내가 그런거 오류 JQ를 얻을 앞에있는 오류를 파악하려고으로 파이프를 사용하고 있지 않다 : 그러한 파일이나 디렉토리가 없습니다. 그런 다음 jq --version and get jq-1.5-1-a5b5cbe
을 사용했습니다.
도움을 주시면 감사하겠습니다.
필요한 것을 모릅니다. –
감사합니다. Hatim은 내 고양이 진술에 문제가 있거나 탄성 검색을 사용하여 대량 API를 준비 할 수있는 형식을 변경하는 더 좋은 해결책을 찾고자했습니다. – ESLearner
제 생각에 json 파일이 있고 Bulk API를 사용하여 Elasticsearch에서 색인을 생성하려고합니다. 권리? –