Thanks Greet I was able to save my xml file. From: [email protected] [mailto:[email protected]] On Behalf Of Geert Josten Sent: Tuesday, June 19, 2012 11:49 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save()
Hi Yashmeet, I am not sure I fully understand your problem. Most notably, why are you using value-matching instead of just plain word searching? Can you give a full test case with two small xml files, the exact results you expect, and a running piece of code that shown what you attempted so far? The docs are a bit misguiding about xdmp:save, you can save any kind of doc with it, text, binary and xml. Just pass the node you want saved. Kind regards, Geert Van: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>arklogic.com<http://arklogic.com>] Namens Yeshmeet Singh Verzonden: dinsdag 19 juni 2012 7:55 Aan: [email protected]<mailto:[email protected]> Onderwerp: [MarkLogic Dev General] cts:search and xdmp:save() Hi, I am having some trouble with the cts:search. I have an application in which when a user enters a search term I take that term and search it through the marklogic collections and return the result. Now what problem I am facing is that in the database in my xml file I have a tag called <head>, now if in this head if I have any statement that has a "?" in it it is not being returned by the cts:search. For example if I search for a term say "EPL and Fixtures" what I do first is create a cts:element-value-match query to search the database first and store that query in a variable which gives me the following output- Let $t := <v:results v:warning="non-element item"><cts:and-query> <cts:or-query><cts:element-value-query> <cts:element>_1:head</cts:element> <cts:text xml:lang="en">EPL and Fixtures: Are the fixtures out?</cts:text> <cts:option>case-insensitive</cts:option> <cts:option>diacritic-sensitive</cts:option> <cts:option>punctuation-insensitive</cts:option> <cts:option>unstemmed</cts:option> </cts:element-value-query> <cts:element-value-query> <cts:element>_1:head</cts:element> <cts:text xml:lang="en">Fixtures and the EPL 2009: Champion?</cts:text> <cts:option>case-insensitive</cts:option> <cts:option>diacritic-sensitive</cts:option> <cts:option>punctuation-insensitive</cts:option> <cts:option>unstemmed</cts:option> </cts:element-value-query> </cts:or-query> <cts:element-word-query> <cts:element>_1:head</cts:element> <cts:textxml:lang="en">EPL</cts:text> <cts:option>case-insensitive</cts:option> <cts:option>diacritic-sensitive</cts:option> <cts:option>punctuation-insensitive</cts:option> <cts:option>unstemmed</cts:option> </cts:element-word-query> <cts:or-query> <cts:element-word-query> <cts:element>_1:head</cts:element> <cts:textxml:lang="en">Fixtures</cts:text> <cts:option>case-insensitive</cts:option> <cts:option>diacritic-sensitive</cts:option> <cts:option>punctuation-insensitive</cts:option> <cts:option>unstemmed</cts:option> </cts:element-word-query> <cts:element-word-query> <cts:element>_1:head</cts:element> <cts:textxml:lang="en">Fixtures*</cts:text> <cts:option>case-insensitive</cts:option> <cts:option>diacritic-sensitive</cts:option> <cts:option>punctuation-insensitive</cts:option> <cts:option>unstemmed</cts:option> </cts:element-word-query> </cts:or-query> <cts:collection-query> <cts:uri>dictionaryid </cts:uri> </cts:collection-query> <cts:collection-query><cts:uri>dictionarystatus</cts:uri> </cts:collection-query> </cts:and-query> </v:results> Now I make a call to my cts search- Let result := cts:search(/wl:start, $t) The above does not return any result. And this is happening only for those terms in my <head> tag that have "?". Also I wanted to write the output of my xqy file into an xml file. Using xdmp:save() we can create a text file. Is there any way to create an xml file? Thanks Yashmeet Singh **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________ General mailing list [email protected] http://community.marklogic.com/mailman/listinfo/general
