1
votes

I have the following xml structure:-

<Root>
<text>
 Marklogic is a good big data tool. Right now I am exploring Marklogic.
</text>
</Root>

Now I want to count the occurrence of unique words(e.g Marklogic- 2 times, big- 1 time, data-1 time etc). I achieved this by using fn:count() but fn:count() is too slow in case of large database.

Is there any other optimized way to achieve this ? (something related to indexes)

1

1 Answers

0
votes

Per http://docs.marklogic.com/guide/search-dev/lexicon#chapter you could enable the word-lexicon and use cts:words.