我想索引一个JSON文件在Solr中,它的工作原理,但我不明白为什么Solr索引元素作为一个数组而不是元件。Solr索引json,它索引为列表而不是作为项目
当我索引示例json文件“books.json”它工作正常,但如果我索引另一个文件“items.json”它会生成不同的输出。
我在下面:
Books.json
[{
"id" : "978-0641723445",
"cat" : ["book","hardcover"],
"name" : "The Lightning Thief",
"author" : "Rick Riordan",
"series_t" : "Percy Jackson and the Olympians",
"sequence_i" : 1,
"genre_s" : "fantasy",
"inStock" : true,
"price" : 12.50,
"pages_i" : 384
}]
OUTPUT
{
"id": "978-0641723445",
"cat": [
"book",
"hardcover"
],
"name": "The Lightning Thief",
"author": "Rick Riordan",
"author_s": "Rick Riordan",
"series_t": "Percy Jackson and the Olympians",
"sequence_i": 1,
"genre_s": "fantasy",
"inStock": true,
"price": 12.5,
"price_c": "12.5,USD",
"pages_i": 384,
"_version_": 1457847842153431000
},
Items.json
[{
"title" : "Pruebas Carlos",
"id" : 14,
"desc" : "Probando como funciona el campo de descripciones"
}]
OUTPUT
{
"title": [
"Pruebas Carlos"
],
"id": "10",
"desc": [
"Probando como funciona el campo de descripciones"
],
"_version_": 1457849881416695800
},
My Schema,这里我只补充说,我需要的新领域。
有人可以向我解释我如何做索引没有[]的元素?
感谢
您可以编辑您的问题,并补充说,核心的'schema.xml'? – cheffe
完成后,我将它上传到pastebin –