+1 But what would be really cool is computed indexes.. http://www.xqueryhacker.com/2012/03/03/computed-indexes-in-marklogic.html
From: Clark Richey <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Thursday, 9 January 2014 00:34 To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Cc: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: Re: [MarkLogic Dev General] Fining all elements with a wild carded name Agreed! +1 -------------------- Clark Richey, CTO FactGem 240-252-7507<tel:240-252-7507> [email protected]<mailto:[email protected]> [cid:30676006-F7BA-4C7F-96A8-7EFEF5DDDE5B] Need immediate assistance? Please try: Cate Downing, Assistant [email protected]<mailto:[email protected]> 614.325.2404<tel:614.325.2404> Beth Price, Assistant [email protected]<mailto:[email protected]> 614.365.0740<tel:614.365.0740> This message and any included attachments are property of FactGem and its affiliates, and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail. Thank you. On Jan 8, 2014, at 19:26, "Ron Hitchens" <[email protected]<mailto:[email protected]>> wrote: +1 for a an element name (and attribute name, and namespace URI) lexicon. --- Ron Hitchens {[email protected]<mailto:[email protected]>} +44 7879 358212 On Jan 8, 2014, at 5:43 PM, Justin Makeig <[email protected]<mailto:[email protected]>> wrote: Rachel, There’s currently no way to resolve such a query out of MarkLogic’s indexes. XPath can describe such queries //*[matches(local-name(.), "foo"] However, that won’t scale for a large database because that XPath will require reading the documents themselves, rather than an index, like you’d have with a word-query, for example. I’m tracking this request and other similar ones, but I can’t make any promises about if and when we might add this capability to the database. In the meantime, I’d suggest you do some sampling. Select a small(ish) number of documents, randomly or by some other query logic and do some XPath inquiry on that smaller set. Something like: distinct-values( cts:search(collection(), cts:and-query(()), ("unfiltered","score-random"))[1 to 100] //*[matches(local-name(.), "Address$")]/xdmp:path(.) ) where I’m getting the distinct paths of all of the elements whose local names than end with the string “Address” (e.g. StreetAddress, FullAddress). Again, this type of query will be expensive on a large set of documents. I’ve limited my input to the first 100 randomly selected. If you have more smarts about the query you could do to select the universe of documents, even better (cts:and-query(()) means select everything). Justin On Jan 8, 2014, at 7:23 AM, Rachel Wilson <[email protected]<mailto:[email protected]>> wrote: Is there a way of listing all the paths to wildcarded element name? Either using a FLOWR expression or cts:search. i.e. I would like to find all elements with a name that contains a wildcarded string because I'm unsure of the name of an element or where it is. And the most useful think I can think of to return would be the path to all elements (or attributes?) that contain that string. I found this document<http://developer.marklogic.com/blog/name-is-a-code-smell> that talks about name() vs local-name() or node-name(), and these return a QName, and I found xdml:path which would return a path given a node, so what I think I need is something like node-name but returns the node which I could pass to xdml:path. Otherwise I'm aware of term lists and the universal index but I can't find out how to query them. I guess I'm looking for something akin to the USER_TAB_COLUMNS dictionary table in Oracle. Many thanks and happy new year, Rachel ---------------------------- http://www.bbc.co.uk<http://www.bbc.co.uk/> This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. --------------------- _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
