Hi Jason,
I guess what I don't understand is how the range query within a cts:search uses a range index. I'm used to associating range indexes with lexicon searches. In the case of lexicon searches, the frequency of occurrences depends on the number of fragments in which an indexed value occurs, so I don't understand how the range searches work with cts:search in contrast to a term search such as cts:element-value-query. I'm probably just not understanding the big picture correctly. I would expect the range query to be faster than cts:element-value-query for exact queries as it takes advantage of range indexes rather than a term list. However, the range query doesn't provide all the nice search options (case, punctuation sensitivity choices.). Why would one ever use cts:element-value-query() with the exact option if range queries are faster? Why not include the various sensitivity options with the range query? Thanks, Tim _____ From: [email protected] [mailto:[email protected]] On Behalf Of Jason Hunter Sent: Thursday, December 16, 2010 1:27 PM To: General MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Indexing in MarkLogic for FasterSearches I'm confused by the question. Whether the search is unfiltered or not depends on the parameters to the cts:search call, not what queries you're constraining by. And when unfiltered you don't always need to have a fragment root on the root node of the search. -jh- On Dec 16, 2010, at 10:12 AM, Tim Meagher wrote: Since the range query takes advantage of a range index, does it treat the cts:search as if it were unfiltered, i.e. is a fragment root required on the root node of the search? _____ From: [email protected] [mailto:[email protected]] On Behalf Of Jason Hunter Sent: Thursday, December 16, 2010 12:54 PM To: General MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Indexing in MarkLogic for FasterSearches To do an exact element value match, you can do a range query using "=" as a comparator, or a cts:element-value-query with the "exact" parameter. The first uses a range index to resolve it; the latter uses a term list. The range index you have to configure by the QName; the term list is always present. The range index can compare using a collation; the term list for "exact" is just a codepoint comparison. To do a search-style match (i.e. ignoring whitespace, punctuation, case, diacritics, etc) you'll want to use cts:element-value-query and pass the appropriate parameters on what should and shouldn't be sensitive. It'll then resolve using term lists. -jh- On Dec 16, 2010, at 9:47 AM, Tim Meagher wrote: I understand the usefulness of range indexes in MarkLogic for getting a unique & searchable list of values for an indexed element using lexicon searches, but I'm not sure I understand the benefit of indexing for non-lexicon searches using cts:search and cts:contains. For example, to perform a cts:search on a particular title value, is setting a range index on the title element sufficient to improve performance? Thanks ahead of time, 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
