I'm trying to index a JSON file in Solr and it works, but i don't understant why Solr is indexing elements as an array instead of an element.
When I indexed the example json file "books.json" it works fine, but if I index another file "items.json" it generates a different output.
I show below:
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, where i only added the new fields that i need.
Can someone explain to me how I have to do to index the elements without []?
Thanks