How can I get an XQuery map of MarkLogic document URIs to lexicon (range index) values in the document?

StackOverflow https://stackoverflow.com/questions/21245918

  •  30-09-2022
  •  | 
  •  

문제

I'm writing a REST API extension where I need to know the mapping of lexicon values to documents.

Given a lexicon (and backing range index), how can I get a map of of document URIs to lexicon (index) values?

도움이 되었습니까?

해결책

In XQuery, for values of an element, use

cts:value-tuples(cts-uri-reference(), cts:element-reference("foo"))

For values of a field, use:

cts:value-tuples(cts-uri-reference(), cts:field-reference("foo"))

See also

cts:collection-reference, 
cts:element-attribute-reference, 
cts:path-reference, 
cts:geospatial-attribute-pair-reference
cts:geospatial-element-child-reference
cts:geospatial-element-pair-reference
cts:geospatial-element-reference
cts:geospatial-path-reference

You can get a map on co (or n-way) occurence tuples as well, by providing more arguments to cts:value-tuples().

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top