MongoDB에서 ElasticSearch.Mongo River 플러그인으로 데이터를 내보내고 싶습니다. 컬렉션의 덤프를 먼저 가져 와서 복원하는 옵션이 있습니다.하지만 Mongo River를 사용하고 싶지 않습니다. 플러그인, 나는 elaster
을 사용하여 MongoDB에서 Elasticsearch로 데이터를 내보내고 있습니다.MongoDB에서 ElasticSearch로 내보내기
- 탄성 검색 버전 - 1.3.2
- Node.js를 버전 - v0.11.8 사전
- MongoDB를 버전 - 2.4.x에서
내가 실행 : ./bin/elaster
는 말한다 :
{
[Error: MapperParsingException[object mapping for [collection] tried to parse as object, but got EOF, has a concrete value been provided to it?]]
message: 'MapperParsingException[object mapping for [collection] tried to parse as object, but got EOF, has a concrete value been provided to it?]'
}
내 Elaster 구성은 다음과 같습니다
,536,913 63,210module.exports = {
mongo: {
connection: 'mongodb://127.0.0.1:27017/times'
},
elastic: {
host: {
host: '127.0.0.1'
},
requestTimeout: 5000
},
collections: [
{
name: "walldisplay",
index: "walldisplay",
type: "collection",
fields: [
"_id",
"wat",
"wct",
"u",
"i",
"cd"
],
mappings: {
"collection": {
"properties": {
"wat":{
'type':'string',
'index': 'not_analyzed'
},
"wct":{
'type':'string',
'index': 'not_analyzed'
},
"u":{
"type" : "object",
"dynamic" : true,
"properties":{
"_id":{
'type':'string',
'index': 'not_analyzed'
},
"n":{
'type':'string',
'index': 'not_analyzed'
},
"st":{
'type':'string',
'index': 'not_analyzed'
},
"id":{
'type':'string',
'index': 'not_analyzed'
}
},
"index":"not_analyzed"
},
"i":{
"type" : "nested",
"include_in_parent" : true,
"properties":{
"_id":{
'type':'string',
'index': 'not_analyzed'
},
"ti":{
'type':'string',
'index': 'not_analyzed'
},
"st":{
'type':'string',
'index': 'not_analyzed'
},
"n":{
'type':'string',
'index': 'not_analyzed'
},
"cst":{
'type':'string',
'index': 'not_analyzed'
}
}
},
"cd":{
'type':'long',
'index': 'not_analyzed'
},
}
}
}
}
]
};
또한이 유형과 "walldisplay"와 같은 인덱스로 "수집"을 정의한 이후에 온라인
{
"_id": ObjectId("5406a47970b17246b9a293e1"),
"cd": 1409721465,
"i": [
{
"_id": ObjectId("50f693d17deed44cf000007f"),
"st": "seo-title",
"ti": "title",
"n": "categoryname",
"cst": "category-seotitle",
"r": null,
"c": null
},
{
"_id": ObjectId("50f693d17deed44cf000007f"),
"st": "seo-title",
"ti": "title",
"n": "categoryname",
"cst": "category-seotitle",
"r": null,
"c": null
},
{
"_id": ObjectId("50f693d17deed44cf000007f"),
"st": "seo-title",
"ti": "title",
"n": "categoryname",
"cst": "category-seotitle",
"r": null,
"c": null
}
],
"u": {
"_id": ObjectId("50ce4f79edaffd69e40ee010"),
"n": "Richa Sen",
"st": "richasen",
"id": "d8mzxlp9ekn323l6jg5s8tly1"
},
"wat": 1,
"wct": 1
}
안녕하세요. 회신 해 주셔서 감사합니다. 네, 앞으로 더 나아갈 수있었습니다. 이제 다음과 같은 오류가 발생합니다 {{Error : MapperParsingException [parse [wct]] 실패; 중첩 : NumberFormatException [입력 문자열의 경우 : "i"]; ] 메시지 : 'MapperParsingException [구문 분석하지 못했습니다. [wct]]; 중첩 : NumberFormatException [입력 문자열의 경우 : "i"]; '} 제공된 문서에서 알 수 있듯이 WCT => 정수 값이고 "i"는 배열입니다. – coder
"walldisplay"라는 이름의 색인이 이미 있는지 확인하고 elasticsearch?에 매핑이있는 "collection"을 입력하십시오. 매핑 또는 유형 자체를 삭제하고 다시로드하십시오. – BatScream
예 기존의 모든 매핑을 curl -XDELETE 'http : // localhost : 9200/*/_ mapping/*'로 삭제하고 Elastic Search를 재시작했습니다. 그러나 여전히 동일한 오류가 발생합니다. – coder