Hi Michele,


The basic options are: collections, properties, directories or element
within doc. Properties are indexed in same way as elements within
documents, so you can use cts:element-value-query on properties as well,
just make sure to include properties fragments as option to cts:search e.a.
Directories would be very inconvenient here, you would literally have to
move docs from one uri to another to change category.



So, that leaves collections. Collections are most flexible in this respect.
You can also add docs to multiple collections at the same time. Collections
are also not stored within the fragments themselves, so in that regard also
less heavy. I think collections are your best option here.



Kind regards,

Geert



*Van:* [email protected] [mailto:
[email protected]] *Namens *Michele Bassanelli
*Verzonden:* woensdag 5 maart 2014 1:13
*Aan:* [email protected]
*Onderwerp:* [MarkLogic Dev General] Collections or properties documents



Hi all,



I have some doubt  about how organize a lot of  documents on MarkLogic.



I have about five milions of documents logically divided in five categories



In the normal life of the application any document can move from one
category to another, often this movements involve 100k documents at once.



I'm thinking at these solutions:

  -add a collection to each document (a different collection for any
category): this is good for query execution because I can use istructions
like "cts:search(//field,cts:collection-query("category1"))" or similar but
I'm worried about the permormance time when I must change category to many
documents("document-remove-collections" and "document-and-collections")

  -adding a property (with category) to each document: the queries became
"fn:doc()[property::category = 'category1']//field",  but with milions of
document it is very slow; is it possible to use some index on property
document.



Are there  other approaches to this problem?



Regards,

Bassanelli Michele
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to