Build a word lexicon of all uppercase words in MarkLogic?

Viewed 32

To support an acronym search feature, I would like to create a word lexicon of all uppercase words as possible acronyms in my database. Is it possible to configure word lexicon in MarkLogic to only include uppercase words?

For example, if my only document in the database is

MarkLogic DHF supports both XML and JSON documents.

The lexicon would be ["DHF", "XML", "JSON"].

I could add a pre-processing step to extract all uppercase words and create an element lexicon. But I am not sure if that is necessary/optimal.

Or perhaps I should approach this requirement from a different angle? Thanks!

1 Answers

The word lexicon doesn't support this. You'll need to be creative. An element range index driven against pre-processed data like you suggested is probably the best approach.

Related