You should be able to quote the text with the colon as a phrase, and then the 
quote will become a phrase.  Something like:

import module namespace search = "http://marklogic.com/appservices/search";
    at "/MarkLogic/appservices/search/search.xqy";

search:parse("foo:bar 'foo:bar'",
    <options xmlns="http://marklogic.com/appservices/search";>
      <constraint name="foo">
        <word>
      <element ns="http://widgets-r-us.com"; name="name"/>
    </word>
      </constraint>
      <debug>true</debug>
    </options>)

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Treskon, Matthew
Sent: Tuesday, November 06, 2012 2:47 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Search term includes colon

You may get a better response than this, but you could wildcard it '?' before 
sending it to search:search.


Matthew Treskon




From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Harry B.
Sent: Tuesday, November 06, 2012 5:44 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Search term includes colon

I am using search:search and the grammar options currently see the colon (:) as 
the joiner-string for a constraint. The requirement has surfaced where the 
query string may contain a colon and it will not be meant as a joiner, ex. 
"Kill Bill:2". What should I do to accommodate this requirement? Encoding the 
colon doesn't help. It seems perhaps I need to not use the colon as a joiner 
and use a pipe or some other character? Any other ideas?

Thanks,
Harry




This electronic message contains information generated by the USDA solely for 
the intended recipients. Any unauthorized interception of this message or the 
use or disclosure of the information it contains may violate the law and 
subject the violator to civil or criminal penalties. If you believe you have 
received this message in error, please notify the sender and delete the email 
immediately.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to