On Thu, 01 Sep 2016 23:57:01 -0700, Mani, Sivasubramani (ELS) <s.m...@elsevier.com> wrote:
> Hi Team, > > How do I search SPACE,QUESTION mark is the only value for the particular > element > using cts:element-value-query but it results wrongly. > > My query was > > Let $estiamte := > xdmp:estimate(cts:search(doc(),cts:element-value-query(xs:QName("ce:title"),"?")) > > Kindly assist me to get correct result. Thanks in advance. > > Thanks & Regards, > > Siva > Estimate is giving you a count of what the indexes were able to determine as matches. You can do an xdmp:plan on this search to see what the indexes are being asked. This will tell you whether your query is working as you expect and whether you have the indexes enabled that you need. It could be that this is being interpreted as a wildcard query (? is a wildcard character), but even if it is not (depends on index settings), punctuation and whitespace are only indexed in very specific cases, so this can only work as an exact (case-sensitive, diacritic-sensitive,space-sensitive,unstemmed,unwildcarded) value query where the string is exactly what it in the content. cts:element-value-query(xs:QName("ce:title")," ?",("exact")) You may also be be better off using a string range index and using a cts:element-range-query(xs:QName("ce:title"),"="," ?") Depends on what you're trying to do in general. Value queries are about full-text search with stemming and so on; string range indexes are about string matching. //Mary _______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general