2
votes

I have an element which contains text value and I need to be able to search for the text content in it from the GUI application. I was reading the ML 5.0 documentation and I saw that I can use Element Range Index or Element Word lexicon on this element. I would like to now which one should I use considering the fact that I need to

  1. Search across 10 million documents which contains this element
  2. Search speedily
  3. use cts:element-word-query
  4. Use search options where I am searching with starts-with and contains options.

Appreciate any help.

Harry

2
Can you post the options/queries you're using? A big part of the optimization is the query, not just the index. - wst

2 Answers

3
votes

No extra range indexes or lexicons are needed. Searches for element text with cts:element-word-query use the universal index. The most efficient way is "fast element word search", which is enabled by default when you create a new database.

Further reading:

http://docs.marklogic.com/guide/search-dev

http://docs.marklogic.com/guide/admin/text_index

2
votes

One notable difference between an element range index and an element word lexicon is that the range index will store the string value of the element ("search terms"), and the word lexicon will store individual word tokens ("search", "terms"). Each facilitate different types of queries.

If you post a more detailed example of how you want to search the element, it will be easier to make a recommendation for a query/lexicon strategy.