Solutions

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Learn

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Community

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Company

Stay on top of everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

 
Knowledgebase:
Difference between cts: contains and fn: contains
30 September 2014 12:56 PM

Search fundamentals

 

Difference between cts: contains and fn: contains

 1)fn:contains is a substring match, where as cts:contains performs word matching

 2)cts:contains utilizes stemming, where fn:contains does not

 

For example:-

 

Example.xml

<test>daily running makes you fit</test>

 

  •         fn:contains(fn:doc(“Example.xml”),”ning”)

          True

  •          cts:contains(fn:doc(“Example.xml”),”ning”)

         False

 

   

  •         fn:contains(fn:doc(“Example.xml”),”ran”)

           False

  •         cts:contains(fn:doc(“Example.xml”),”ran”)

            True

 

 

Note:-

Stemming reduces words down to their root, allowing for smaller term lists

 

1)Words from different languages are treated differently, and will not stem to the same root word entry from another language.

2)Note: Nouns will not stem to verbs and vice versa. For example, the word “runner” will not stem to “run”.

 

(8 vote(s))
Helpful
Not helpful

Comments (0)