Hi Shruti, MarkLogic does what it is supposed to do. See below sample
xquery version "1.0-ml"; xdmp:document-insert("/foo.xml", <foo>Hello world</foo>); xdmp:document-insert("/foo2.xml", <foo>Hello world</foo>); xquery version "1.0-ml"; declare namespace host = "http://marklogic.com/xdmp/status/host"; import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy"; let $options := <options xmlns="http://marklogic.com/appservices/search"> <term> <term-option>case-sensitive</term-option> <term-option>diacritic-sensitive</term-option> <term-option>punctuation-sensitive</term-option> <term-option>whitespace-sensitive</term-option> <term-option>unstemmed</term-option> <term-option>unwildcarded</term-option> </term> <debug>true</debug> <search-option>filtered</search-option> </options> return search:search('"Hello world"',$options) This will give you: <search:response snippet-format="snippet" total="1" start="1" page-length="10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns=""xmlns:search="http://marklogic.com/appservices/search"> <search:result index="1" uri="/foo.xml" path="fn:doc("/foo.xml")" score="47104" confidence="0.5532626" fitness="0.6769772"> <search:snippet> <search:match path="fn:doc("/foo.xml")/foo"> <search:highlight> Hello world </search:highlight> </search:match> </search:snippet> </search:result> <search:qtext> "Hello world" </search:qtext> <search:report id="SEARCH-FLWOR"> (cts:search(fn:collection(), cts:word-query("Hello world", ("case-sensitive","diacritic-sensitive","punctuation-sensitive","whitespace-sensitive","unstemmed","unwildcarded","lang=en"), 1), ("filtered"), 1))[1 to 10] </search:report> <search:metrics> <search:query-resolution-time> PT0.004736S </search:query-resolution-time> <search:facet-resolution-time> PT0.000051S </search:facet-resolution-time> <search:snippet-resolution-time> PT0.000603S </search:snippet-resolution-time> <search:total-time> PT0.021619S </search:total-time> </search:metrics> </search:response> As you can see it returns the correct document foo.xml and not foo2.xml. The difference is that you also need to specify unfiltered in the options section. I’m not sure why the double spaces are not reflected in the search:qtext or the cts:word-query in the search:report. Hope this helps. Peter Peter Kester Senior Consultant peter.kes...@marklogic.com<mailto:peter.kes...@marklogic.com> +31 611188543 http://nl.linkedin.com/in/peetkes/ [Description: Description: cid:image001.png@01CCB980.BB82DD90] [Description: Description: MarkLogic Corporation] Graadt van Roggenweg, 328-334, 3531 AH Utrecht http://www.marklogic.com/ New generation databases, you just need to think differently www.nosqlfordummies.com<http://t.co/YKkJ0Wxseo> From: shruti kapoor <shrutikapoor....@gmail.com<mailto:shrutikapoor....@gmail.com>> Reply-To: MarkLogic Developer Discussion <general@developer.marklogic.com<mailto:general@developer.marklogic.com>> Date: dinsdag 6 januari 2015 08:49 To: MarkLogic Developer Discussion <general@developer.marklogic.com<mailto:general@developer.marklogic.com>> Subject: [MarkLogic Dev General] Exact match in search:search implementation Hi all, I want to search a phrase in marklogic, but it normalizes the space before searching it. For example : my search term is: "Test Abc"(Notice there are 2 spaces between the words) Also, I have passed the search terms in quote. I have added the following option in search:search for this, but it did not produce the desired result: <term xmlns="http://marklogic.com/appservices/search"<http://marklogic.com/appservices/search%22>> <term-option>case-sensitive</term-option> <term-option>diacritic-sensitive</term-option> <term-option>punctuation-sensitive</term-option> <term-option>whitespace-sensitive</term-option> <term-option>unstemmed</term-option> <term-option>unwildcarded</term-option> </term>. But the qtext is always "Test Abc". Any help would be appreciated. -- Regards, Shruti Kapoor
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general