> Q1: (easy I hope) > > How can I do a search for not only an exact term but a total text content. > > For example I’m doing this query > > cts:search(/hl7:document , cts:word-query( $term , "exact" ) > ) ... > This is great. But what if I want an *exact total text equality* match, > that is only match > > <some_element>AMA</text>
You could use the search api, and then pass in "some_element:AMA" to match elements called "some_element" with the text "AMA". You could create the constraint in the options block: let $options := <options xmlns="http://marklogic.com/appservices/search"> <constraint name="some_element"> <value> <element ns="" name="some_element"/> </value> </constraint> </options> return search:search($query-term, $options) > Q2: (harder) > > Suppose I do a search or other extraction and get a string like > > “Take two aspirin or codeine and call me in the morning” > > > > I would like to search this entire string and find matches where any word in > the string is an exact match to some criteria. Again, using the search api, you just pass that string to the search:search() function. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
