This would make a great blog post for the future ... ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected] Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Michael Blakeley Sent: Monday, March 18, 2013 1:19 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts query options Under the hood there isn't much difference between cts:search and search:search. The higher-level API constructs a cts:query and runs cts:search, and optionally adds a number of other features: sorting, facets, highlighting, etc. If I want those features, I use search:search. If I want those features but want to construct my own queries, perhaps using something like xqysp, I use search:resolve. If I do not need those extra features I might use cts:search directly. The choice between cts:element-range-query and cts:element-value-query isn't always a clear one. There are trade-offs with database configuration complexity, ingestion performance, and memory size. Mostly the range index lookup will be faster and more predictable, but universal index lookups are also very fast. As you mention there is a fairly broad divide between word-query and collation options, so I try to avoid fighting with that. Because of these considerations I usually start with cts:element-word-query or cts:element-value-query, and only use range indexes where the benefits outweigh the costs. We all know about avoiding premature optimization, and to my mind cts:element-range-query is an optimization. So for full-text search I try to use range indexes when needed, not as the default. For other applications and features - facets and semantics both come to mind - range indexes are the workhorse. -- Mike On 18 Mar 2013, at 09:33 , "Tim" <[email protected]> wrote: > Hi Folks, > > I'd like to get an idea what criteria folks use for selecting cts search > queries associated with cts:search. My guess is that the optimal queries are > cts:element-range-query() and cts:element-attribute-range-query() used in > conjunction with range queries. I haven't always found these the best choice > for cts queries because there are no options for case, punctuation, > diacritic, and space insensitivity, but then again I don't know if that is > inherently addressed by the index collation. In any case I'd like to get a > feel for how much faster it is to use the range queries instead of value > queries in conjunction with the cts:search query and for that matter when to > use one versus the other. > > Likewise, when to use the search:search queries instead of the cts:Search and > embedded cts queries. > > Thank you! > > Tim Meagher > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
