Re: [MarkLogic Dev General] cts:search and xdmp:save()
Hi, I tried adding the unwildcarded option but it is still not working. I am attaching my query and the sample data on which I am running my query. Please let me know if anything can be done to bring up results containing ? in them. Thanks Yashmeet -Original Message- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley Sent: Tuesday, June 19, 2012 8:59 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Understandable, I think. The sample code is hard to read, and won't parse or run in its current form. But Mary has powerful ESP. Here's a test case that shows what I think Mary has in mind. Punctuation in the query text could be punctuation or could be a wildcard. Since the term is punctuation-insensitive, it is treated as a wildcard. The wildcard will be looking for a word character, not a punctuation character, the term fails to match anything. The second two forms show possible fixes: be explicit about no wildcards, or be punctuation-sensitive. (: punctuation-insensitive, implicit wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: explicitly not a wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, ('unwildcarded', case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: default wildcard, punctuation-sensitive :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-sensitive, unstemmed, lang=en))) = false true true -- Mike On 19 Jun 2012, at 07:20 , David Lee wrote: This is confusing to me. From my read of this, the ? is in the data not the query ... so how is wildcarded or not affect this ? -- --- David Lee Lead Engineer MarkLogic Corporation d...@marklogic.com Phone: +1 650-287-2531 Cell: +1 812-630-7622 www.marklogic.com This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mary Holstege Sent: Tuesday, June 19, 2012 10:13 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Try adding an explicit unwilcarded option. Question mark is a wildcard character, so you are looking for something that matches that word with one more character at the end. Sent from my Samsung Epic(tm) 4G Yeshmeet Singh yeshmeet_si...@infosys.com wrote: 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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query /cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enEPL/cts:text cts:optioncase-insensitive/cts:option
Re: [MarkLogic Dev General] cts:search and xdmp:save()
This time the query seems to be: let $search := 'can i have a word with you?' But I see no matches for that string in the XML. The closest match in the XML seems to be: wl:headcan i have a word with u?/wl:head -- Mike On 20 Jun 2012, at 00:13 , Yeshmeet Singh wrote: Hi, I tried adding the unwildcarded option but it is still not working. I am attaching my query and the sample data on which I am running my query. Please let me know if anything can be done to bring up results containing ? in them. Thanks Yashmeet -Original Message- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley Sent: Tuesday, June 19, 2012 8:59 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Understandable, I think. The sample code is hard to read, and won't parse or run in its current form. But Mary has powerful ESP. Here's a test case that shows what I think Mary has in mind. Punctuation in the query text could be punctuation or could be a wildcard. Since the term is punctuation-insensitive, it is treated as a wildcard. The wildcard will be looking for a word character, not a punctuation character, the term fails to match anything. The second two forms show possible fixes: be explicit about no wildcards, or be punctuation-sensitive. (: punctuation-insensitive, implicit wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: explicitly not a wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, ('unwildcarded', case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: default wildcard, punctuation-sensitive :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-sensitive, unstemmed, lang=en))) = false true true -- Mike On 19 Jun 2012, at 07:20 , David Lee wrote: This is confusing to me. From my read of this, the ? is in the data not the query ... so how is wildcarded or not affect this ? -- --- David Lee Lead Engineer MarkLogic Corporation d...@marklogic.com Phone: +1 650-287-2531 Cell: +1 812-630-7622 www.marklogic.com This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mary Holstege Sent: Tuesday, June 19, 2012 10:13 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Try adding an explicit unwilcarded option. Question mark is a wildcard character, so you are looking for something that matches that word with one more character at the end. Sent from my Samsung Epic(tm) 4G Yeshmeet Singh yeshmeet_si...@infosys.com wrote: 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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text
Re: [MarkLogic Dev General] cts:search and xdmp:save()
That was by mistake. It had to be can I have a word with you in the xml also. I have made the change in xml and have attached it in the mail. -Original Message- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley Sent: Wednesday, June 20, 2012 9:50 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() This time the query seems to be: let $search := 'can i have a word with you?' But I see no matches for that string in the XML. The closest match in the XML seems to be: wl:headcan i have a word with u?/wl:head -- Mike On 20 Jun 2012, at 00:13 , Yeshmeet Singh wrote: Hi, I tried adding the unwildcarded option but it is still not working. I am attaching my query and the sample data on which I am running my query. Please let me know if anything can be done to bring up results containing ? in them. Thanks Yashmeet -Original Message- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley Sent: Tuesday, June 19, 2012 8:59 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Understandable, I think. The sample code is hard to read, and won't parse or run in its current form. But Mary has powerful ESP. Here's a test case that shows what I think Mary has in mind. Punctuation in the query text could be punctuation or could be a wildcard. Since the term is punctuation-insensitive, it is treated as a wildcard. The wildcard will be looking for a word character, not a punctuation character, the term fails to match anything. The second two forms show possible fixes: be explicit about no wildcards, or be punctuation-sensitive. (: punctuation-insensitive, implicit wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: explicitly not a wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, ('unwildcarded', case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: default wildcard, punctuation-sensitive :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-sensitive, unstemmed, lang=en))) = false true true -- Mike On 19 Jun 2012, at 07:20 , David Lee wrote: This is confusing to me. From my read of this, the ? is in the data not the query ... so how is wildcarded or not affect this ? - - --- David Lee Lead Engineer MarkLogic Corporation d...@marklogic.com Phone: +1 650-287-2531 Cell: +1 812-630-7622 www.marklogic.com This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mary Holstege Sent: Tuesday, June 19, 2012 10:13 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Try adding an explicit unwilcarded option. Question mark is a wildcard character, so you are looking for something that matches that word with one more character at the end. Sent from my Samsung Epic(tm) 4G Yeshmeet Singh yeshmeet_si...@infosys.com wrote: 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 itemcts:and-query cts:or
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:* general-boun...@developer.marklogic.com [mailto: general-boun...@developer.marklogic.com] *Namens *Yeshmeet Singh *Verzonden:* dinsdag 19 juni 2012 7:55 *Aan:* general@developer.marklogic.com *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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query /cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enEPL/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures*/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query /cts:or-query cts:collection-query cts:uridictionaryid /cts:uri /cts:collection-query cts:collection-querycts:uridictionarystatus/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 General@developer.marklogic.com http://community.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] cts:search and xdmp:save()
Thanks Greet I was able to save my xml file. From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] 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: general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com [mailto:general-bounces@developer.mmailto:general-bounces@developer.marklogic.comhttp://arklogic.com] Namens Yeshmeet Singh Verzonden: dinsdag 19 juni 2012 7:55 Aan: general@developer.marklogic.commailto:general@developer.marklogic.com 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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query /cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enEPL/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures*/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query /cts:or-query cts:collection-query cts:uridictionaryid /cts:uri /cts:collection-query cts:collection-querycts:uridictionarystatus/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 General@developer.marklogic.com http://community.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] cts:search and xdmp:save()
Try adding an explicit unwilcarded option. Question mark is a wildcard character, so you are looking for something that matches that word with one more character at the end. Sent from my Samsung Epic™ 4G Yeshmeet Singh yeshmeet_si...@infosys.com wrote: 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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query /cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enEPL/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures*/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query /cts:or-query cts:collection-query cts:uridictionaryid /cts:uri /cts:collection-query cts:collection-querycts:uridictionarystatus/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 General@developer.marklogic.com http://community.marklogic.com/mailman/listinfo/general
Re: [MarkLogic Dev General] cts:search and xdmp:save()
This is confusing to me. From my read of this, the ? is in the data not the query ... so how is wildcarded or not affect this ? - David Lee Lead Engineer MarkLogic Corporation d...@marklogic.com Phone: +1 650-287-2531 Cell: +1 812-630-7622 www.marklogic.comhttp://www.marklogic.com/ This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mary Holstege Sent: Tuesday, June 19, 2012 10:13 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Try adding an explicit unwilcarded option. Question mark is a wildcard character, so you are looking for something that matches that word with one more character at the end. Sent from my Samsung Epic™ 4G Yeshmeet Singh yeshmeet_si...@infosys.com wrote: 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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query /cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enEPL/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures*/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query /cts:or-query cts:collection-query cts:uridictionaryid /cts:uri /cts:collection-query cts:collection-querycts:uridictionarystatus/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
Re: [MarkLogic Dev General] cts:search and xdmp:save()
Understandable, I think. The sample code is hard to read, and won't parse or run in its current form. But Mary has powerful ESP. Here's a test case that shows what I think Mary has in mind. Punctuation in the query text could be punctuation or could be a wildcard. Since the term is punctuation-insensitive, it is treated as a wildcard. The wildcard will be looking for a word character, not a punctuation character, the term fails to match anything. The second two forms show possible fixes: be explicit about no wildcards, or be punctuation-sensitive. (: punctuation-insensitive, implicit wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: explicitly not a wildcard :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, ('unwildcarded', case-insensitive, diacritic-sensitive, punctuation-insensitive, unstemmed, lang=en))), (: default wildcard, punctuation-sensitive :) cts:contains( element test { EPL and Fixtures: Are the fixtures out? }, cts:element-value-query( xs:QName('test'), EPL and Fixtures: Are the fixtures out?, (case-insensitive, diacritic-sensitive, punctuation-sensitive, unstemmed, lang=en))) = false true true -- Mike On 19 Jun 2012, at 07:20 , David Lee wrote: This is confusing to me. From my read of this, the ? is in the data not the query ... so how is wildcarded or not affect this ? - David Lee Lead Engineer MarkLogic Corporation d...@marklogic.com Phone: +1 650-287-2531 Cell: +1 812-630-7622 www.marklogic.com This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mary Holstege Sent: Tuesday, June 19, 2012 10:13 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] cts:search and xdmp:save() Try adding an explicit unwilcarded option. Question mark is a wildcard character, so you are looking for something that matches that word with one more character at the end. Sent from my Samsung Epic™ 4G Yeshmeet Singh yeshmeet_si...@infosys.com wrote: 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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query /cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enEPL/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures*/cts:text cts:optioncase
[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 itemcts:and-query cts:or-querycts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enEPL and Fixtures: Are the fixtures out?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query cts:element-value-query cts:element_1:head/cts:element cts:text xml:lang=enFixtures and the EPL 2009: Champion?/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-value-query /cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enEPL/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:or-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query cts:element-word-query cts:element_1:head/cts:element cts:textxml:lang=enFixtures*/cts:text cts:optioncase-insensitive/cts:option cts:optiondiacritic-sensitive/cts:option cts:optionpunctuation-insensitive/cts:option cts:optionunstemmed/cts:option /cts:element-word-query /cts:or-query cts:collection-query cts:uridictionaryid /cts:uri /cts:collection-query cts:collection-querycts:uridictionarystatus/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 General@developer.marklogic.com http://community.marklogic.com/mailman/listinfo/general