Amish, Have you looked into cts:and-not-query? Something like:
cts:and-not-query( cts:word-query(“worker”, (“case-insensitive”), cts:word-query(“worker”, (“case-sensitive”) ) Shan Jiang Senior Consultant MarkLogic Corporation [email protected] Phone: +1 703 869 4672 www.marklogic.com<http://www.marklogic.com/> From: <[email protected]<mailto:[email protected]>> on behalf of "Shah, Amish (LNG-CON)" <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Wednesday, November 25, 2015 at 2:27 PM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] searching for word where uppercase letter can occur anywhere in the word Marklogic version used by me version 7 or 8: Looks like Marklogic provides the ability to do case-sensitive and case-insensitive search and we can set those options with a combination of filtered or unfiltered search. It also provides a mechanism to index the documents using fast case sensitive searches option in the configure part of the database, of course index will affect the results from filtered or unfiltered. Our application wants to start supporting mechanism where we want to find any letter in the word which may upper case. For example a search for anyletterupperCase (worker) Should give matches for Worker WOrker workEr but no match for worker match words where uppercase can happen. I could not find any search option or feature which would help me come to what I need (atleast so far). Any help or thoughts if something close to above is supported. Solution that I can think of -------------------------------- For simplicity lets assume that there is only one occurrence of word worker in each of my documents One solution I was thinking was, To do a search with “exact” on worker lets call the search result as (List_exact) This should give me list of documents that I can exclude Then do a case-insensitive search on worker, call the search result as (List_general) Resultant_list = list_general – list_exact Resultant_list will have occurences of worker where any word would be uppercase Inefficiency is that my solution involve two searches. Thanks in advance Amish
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
