I have several JSON like that :
[{
"type": "car",
"field1": "test"
}, {
"type": "bike",
"field1": "test"
}]
I stored them in MarkLogic 8.4 and I want to perform some search query on them to retrieve documents according to the type (eg : Find all documents with the type "car").
I have two potential solutions :
- Set Marklogic collections to each document. Example : put "car" and "bike" collection on the example document. In my search query I can add a collection restriction.
- Put an index on "type" field of each JSON
Is one method is better than another one in term of performances and/or best practices ?
Thanks, Romain.