Hello,

I asked around and Mary gave me this information (apparently wildcards are 
tricky with Chinese tokenization):

I think what is going on here is that  "哈*" is asking for the value to be a 
single word starting with that character, but the value "哈哈" is tokenized as 
two words.
You have to do this: 
cts:element-attribute-value-query(xs:QName("product"),xs:QName("tmp")," 哈* 
*",("wilcarded","whitespace-insensitive"))

--
Dave Cassel<http://davidcassel.net>, @dmcassel<https://twitter.com/dmcassel>
Technical Community Manager
MarkLogic Corporation<http://www.marklogic.com/>
http://developer.marklogic.com/


From: 
<[email protected]<mailto:[email protected]>>
 on behalf of 张晓博 <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Monday, July 13, 2015 at 3:56 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] search chinese word can not work when used 
wildcard query

some node of xml document is:
    <product dept="ACC" tmp="哈哈">
        <number>563</number>
        <name language="en">Floppy Sun Hat</name>
    </product>
the language of attribute tmp is chinese.

the query :
cts:search(collection()/catalog/product,
cts:and-query((cts:element-attribute-value-query(xs:QName("product"), 
xs:QName("tmp"), '哈*', "wildcarded"))))/name

will return the empty result.
but the below query will return the right result:
cts:search(collection()/catalog/product,
cts:and-query((cts:element-attribute-value-query(xs:QName("product"), 
xs:QName("dept"), 'A*', "wildcarded"))))/name
result is:
<name language="en">Floppy Sun Hat</name>

why the first query return the empty result?




_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to