On 8/22/2011 2:34 AM, Ron Hitchens wrote:
> Maybe collections could help here? If the latest
> version of each document is in the "LATEST" collection,
> then it's simply:
>
> cts:search (doc(), cts:and-query (cts:collection-query ("LATEST"),
> $random-query))
>
> You just need to make sure you manage collections
> on ingest, so that when a new version of a document is
> loaded, the previous latest version is removed from the
> "LATEST" collection.
Thanks Ron - yes, we could certainly do that, but the question was
really about what the best you can do is if you don't allow any stored
info. For example, maybe some kind of grouping operation (group by
document-id) followed by a selection (newest in the group) ... but I
don't know how to do that in xquery, or whether that is possible. Just
wondering if there is some construct I'm unaware of that could help.
-Mike
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general