Simple example to illustrate the differences between fn:contains and
cts:contains:
fn:contains("there was a dragon", "on") (: true :)
, cts:contains(text { "there was a dragon" }, "on" ) (: false :)
, fn:contains ( "ran like crazy", "run" ) (: false :)
, cts:contains( text { "ran like crazy" } , "run" ) (: true :)
Nuno
On Mon, Feb 28, 2011 at 11:38 AM, Vedavalli Radhika <[email protected]>wrote:
> Thanks for the reply Nuno.
> The got that point from one of the marklogic training manuals.
> Example provided:
> process-para(doc("mydoc.xml")/book/chapter[contains(.,
> "fungus")]/para[@type = "approved"])
> In this scenario, contains should be ideally replaced by cts:contains.
>
> On 2/28/11, Nuno Job <[email protected]> wrote:
> > Hi Vedavalli,
> >
> > cts:contains and fn:contains are not the same function. cts:contains is
> word
> > matching (including stemming etc) and fn:contains is, as defined in the
> > standard, substring matching.
> >
> > I don't know of any code review checklist.
> >
> > Nuno
> >
> > On Mon, Feb 28, 2011 at 10:46 AM, Vedavalli Radhika
> > <[email protected]>wrote:
> >
> >> Hi,
> >>
> >> Are there any Marklogic XQuery optimization checklist or standards
> >> available?
> >>
> >> Apart from the "Query Performance and Tuning Guide" provided by
> >> Marklogic, is there any optimization hints readily available that can
> >> be used as a code review checklist?
> >>
> >> I would require one in the performance tuning/optimization perspective.
> >>
> >> For example: Few items can be 1. Use cts:contains() instead of
> >> contains() 2. Avoid XPath reverse axes etc.,
> >>
> >> Thanks,
> >> Radhika.
> >> _______________________________________________
> >> General mailing list
> >> [email protected]
> >> http://developer.marklogic.com/mailman/listinfo/general
> >>
> >
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general