Reputation: 993
Following is the structure of my document:
{
'id':1
'urls':[
{'index':0, 'text':'http://ex1.com'},
{'index':1, 'text':'http://ex2.com'}
]
}
My question is, what is the type to be specified for the field 'urls' in the XML schema for it to be indexed?
Upvotes: 0
Views: 481
Reputation: 9789
Solr does not work this way. You need to decide what you actually want to find and work backwards.
For example, if you search of ex1, do you want to find a record that just has one URL, do you want to find a parent record that has both the urls or do you not even search for ex1 and want it to be just stored and returned.
I recommend you go through the Solr tutorial and keep thinking about your content (not JSON schema) and how you want that content to be found.
Then, ask specific question on how to map your requirements. Which would most likely be some sort of decomposition by either flattening each URL with parent information or a parent-child relationship. But it would depend on your search (not source data) needs.
However, if you absolutely need to include JSON, you could also look at SIREn that builds on top of Solr to give some of that flexibility.
Upvotes: 1