I'm having some trouble with a cts:search query, but I'm not sure if
the trouble is with the query itself or with the concept I'm trying to
handle.
I have XML documents loaded into MarkLogic. The basic structure for a
document named a.xml is:
<root id="a">
<chapter id="1">
<p>one</p>
<p>two</p>
</chapter>
<chapter id="2">
<p>nine</p>
<p>ten</p>
</chapter>
</root>
I also have loaded separate XML files containing some indexing terms.
A file contains the indexing terms for each node level that will be
returned by the application. In this case we're returning <chapter>
nodes, so the example below is the index file for that chapter. The
basic structure for chapter one's indexing file is:
<index>
<fileID>1</fileID>
<entry>three</entry>
</index>
There are two requirements I'm trying to satisfy. First, if a node
does not contain a search term, but the indexing for that node does,
the node should still be returned. Second, indexing terms should be
available for use to influence search result relevance.
My basic cts:search statement is:
let $SEARCH := cts:search( //chapter, cts:word-query("three"))
I want the node <chapter id="1"> returned because even though it does
not contain the word "three" the indexing document for it does.
Is it possible to write a cts:search statement that can search in this
way? Or will I be forced to inject the indexing into the source
document?
Thanks for any help on this,
Matt
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general