I feel compelled to add: MarkLogic 8 also added cts:true-query() for those who haven't learned the trick that an AND of empty means all.
cts:search(doc(), cts:true-query(), "format-json") finds all JSON documents cts:search(doc(), cts:true-query(), "format-xml") finds all XML documents There's a cts:false-query() too. -jh- On Sep 7, 2016, at 9:29 PM, Joe Bryan <[email protected]<mailto:[email protected]>> wrote: Hi All, MarkLogic 8 adds the format-* option to cts:search(): cts:search(/, cts:and-query(()), "format-json") finds all JSON documents cts:search(/, cts:and-query(()), "format-xml") finds all XML documents And so on, for binary, json, text, or xml. http://docs.marklogic.com/cts:search?q=cts:search&v=8.0&api=true Thanks. -jb From: <[email protected]<mailto:[email protected]>> on behalf of Dave Cassel <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Wednesday, September 7, 2016 at 7:26 AM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: Re: [MarkLogic Dev General] Search constrained by mime-type? I think you'd need to write a custom constraint<http://docs.marklogic.com/guide/search-dev/search-api#id_49750> to do that. -- Dave Cassel<http://davidcassel.net/>, @dmcassel<https://twitter.com/dmcassel> Technical Community Manager MarkLogic Corporation<http://www.marklogic.com/> http://developer.marklogic.com/ From: <[email protected]<mailto:[email protected]>> on behalf of Steve Anderson <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Wednesday, September 7, 2016 at 12:10 AM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] Search constrained by mime-type? Is there a way to constrain a search to a certain mime-type? For example, if I want to search every JSON document, but not any XML documents, how can I do that? Thanks, Steve _______________________________________________ General mailing list [email protected]<mailto:[email protected]> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
