Hi Micah, In addition to the operator question, can the operators be made case-insensitive? for eg if i provide "JOURNALONLINEFIRST" or "JournalONLINEFirst" still it should fetch the results.
Regards Amit On 7 June 2012 10:49, amit gope <[email protected]> wrote: > Hi Micah, > > Thank you so much for your help. It worked. > > Regards > Amit > > On 7 June 2012 10:12, <[email protected]> wrote: > >> Send General mailing list submissions to >> [email protected] >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://community.marklogic.com/mailman/listinfo/general >> or, via email, send a message with subject or body 'help' to >> [email protected] >> >> You can reach the person managing the list at >> [email protected] >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of General digest..." >> >> Today's Topics: >> >> 1. xdmp:base64Decode returns invalid UTF-8 escape sequence >> (Steve Spigarelli) >> 2. Re: xdmp:base64Decode returns invalid UTF-8 escape sequence >> (Michael Blakeley) >> 3. Re: xdmp:base64Decode returns invalid UTF-8 escape sequence >> (Steve Spigarelli) >> 4. Re: xdmp:base64Decode returns invalid UTF-8 escape sequence >> (Michael Blakeley) >> 5. Issue with operator in Search api (amit gope) >> 6. Re: Issue with operator in Search api (Micah Dubinko) >> >> >> ---------- Forwarded message ---------- >> From: Steve Spigarelli <[email protected]> >> To: [email protected] >> Cc: >> Date: Wed, 6 Jun 2012 14:25:12 -0600 >> Subject: [MarkLogic Dev General] xdmp:base64Decode returns invalid UTF-8 >> escape sequence >> How do I tell this code that I don't want it to be UTF-8 encoded? >> >> xquery version "1.0-ml"; >> >> xdmp:base64-decode('JxrHeSl2YX4LunZkWKZqog==') >> >> Thanks >> Steve >> >> >> >> ---------- Forwarded message ---------- >> From: Michael Blakeley <[email protected]> >> To: MarkLogic Developer Discussion <[email protected]> >> Cc: >> Date: Wed, 6 Jun 2012 13:37:34 -0700 >> Subject: Re: [MarkLogic Dev General] xdmp:base64Decode returns invalid >> UTF-8 escape sequence >> That function only works with encoded strings, and I think they have to >> be UTF-8 as well. But try this trick: >> >> binary { xs:hexBinary(xs:base64Binary('JxrHeSl2YX4LunZkWKZqog==')) >> >> -- Mike >> >> On 6 Jun 2012, at 13:25 , Steve Spigarelli wrote: >> >> > How do I tell this code that I don't want it to be UTF-8 encoded? >> > >> > xquery version "1.0-ml"; >> > >> > xdmp:base64-decode('JxrHeSl2YX4LunZkWKZqog==') >> >> >> >> >> >> ---------- Forwarded message ---------- >> From: Steve Spigarelli <[email protected]> >> To: [email protected] >> Cc: >> Date: Wed, 6 Jun 2012 14:53:48 -0600 >> Subject: Re: [MarkLogic Dev General] xdmp:base64Decode returns invalid >> UTF-8 escape sequence >> So the initial string "JxrHeSl2YX4LunZkWKZqog==" is a base64 encoded >> nonce from soapUI. It only contains characters that are valid in a >> base64 world, so Marklogic has no problems with it. It's what happens >> next when one runs the decode that causes the problems. >> >> In order to calculate a SOAP password digest one needs the original >> nonce (base64 decoded of the base64 encoded nonce), the timestamp and >> the password. But, in order to base64 decode a nonce with invalid >> UTF-8 sequences one must use functions that are not available in >> Marklogic. Casting the original base64 encoded string (that is already >> valid) to base64 binary then to hexbinary then to a binary document >> doesn't get me what I need for calling the base64-decode function that >> expects an xs:string. >> >> I think that my colleague will just end up doing simple passwords over >> https instead of password digest unless there is another way to do >> this. >> >> Steve >> >> >> That function only works with encoded strings, and I think they have >> to be UTF-8 as well. But try this trick: >> >> binary { xs:hexBinary(xs:base64Binary('JxrHeSl2YX4LunZkWKZqog==')) >> >> -- Mike >> >> >> On Wed, Jun 6, 2012 at 2:25 PM, Steve Spigarelli <[email protected]> wrote: >> > How do I tell this code that I don't want it to be UTF-8 encoded? >> > >> > xquery version "1.0-ml"; >> > >> > xdmp:base64-decode('JxrHeSl2YX4LunZkWKZqog==') >> > >> > Thanks >> > Steve >> >> >> >> ---------- Forwarded message ---------- >> From: Michael Blakeley <[email protected]> >> To: MarkLogic Developer Discussion <[email protected]> >> Cc: >> Date: Wed, 6 Jun 2012 14:11:33 -0700 >> Subject: Re: [MarkLogic Dev General] xdmp:base64Decode returns invalid >> UTF-8 escape sequence >> HTTPS sounds reasonable, but you can do a few more tricks with binary >> data. This might get you there: >> >> xdmp:hex-to-integer( >> string(xs:hexBinary(xs:base64Binary('JxrHeSl2YX4LunZkWKZqog==')))) >> >> The result is an xs:decimal 18446744073709551615 - is that what you need? >> You might want to construct an xs:unsignedLong from it, and use >> xdmp:not64() and its siblings for the math. >> >> -- Mike >> >> On 6 Jun 2012, at 13:53 , Steve Spigarelli wrote: >> >> > So the initial string "JxrHeSl2YX4LunZkWKZqog==" is a base64 encoded >> > nonce from soapUI. It only contains characters that are valid in a >> > base64 world, so Marklogic has no problems with it. It's what happens >> > next when one runs the decode that causes the problems. >> > >> > In order to calculate a SOAP password digest one needs the original >> > nonce (base64 decoded of the base64 encoded nonce), the timestamp and >> > the password. But, in order to base64 decode a nonce with invalid >> > UTF-8 sequences one must use functions that are not available in >> > Marklogic. Casting the original base64 encoded string (that is already >> > valid) to base64 binary then to hexbinary then to a binary document >> > doesn't get me what I need for calling the base64-decode function that >> > expects an xs:string. >> > >> > I think that my colleague will just end up doing simple passwords over >> > https instead of password digest unless there is another way to do >> > this. >> > >> > Steve >> > >> > >> > That function only works with encoded strings, and I think they have >> > to be UTF-8 as well. But try this trick: >> > >> > binary { xs:hexBinary(xs:base64Binary('JxrHeSl2YX4LunZkWKZqog==')) >> > >> > -- Mike >> > >> > >> > On Wed, Jun 6, 2012 at 2:25 PM, Steve Spigarelli <[email protected]> wrote: >> >> How do I tell this code that I don't want it to be UTF-8 encoded? >> >> >> >> xquery version "1.0-ml"; >> >> >> >> xdmp:base64-decode('JxrHeSl2YX4LunZkWKZqog==') >> >> >> >> Thanks >> >> Steve >> > _______________________________________________ >> > General mailing list >> > [email protected] >> > http://community.marklogic.com/mailman/listinfo/general >> >> > >> >> >> >> >> ---------- Forwarded message ---------- >> From: amit gope <[email protected]> >> To: [email protected] >> Cc: >> Date: Thu, 7 Jun 2012 09:57:46 +0530 >> Subject: [MarkLogic Dev General] Issue with operator in Search api >> Hello All, >> >> I am new to search api and i am having trouble in implementing one >> functionality. There are basically two things that i am stuck with: >> >> 1. Can i have two operators in the options? >> 2. I have a code which looks something like this: >> >> <operator name="sort"> >> <state name="relevance"> >> <sort-order> >> <score/> >> </sort-order> >> </state> >> <state name="date"> >> <sort-order direction="descending" >> type="xs:date" collation=""> >> <element ns=" >> http://www.marklogic.com/app/meta" name="Date"/> >> </sort-order> >> <sort-order> >> <score/> >> </sort-order> >> </state> >> </operator> >> <operator name="JournalOnlineFirst"> >> <state name="true"> >> >> <searchable-expression>/Publisher[.//JournalOnlineFirst]</searchable-expression> >> </state> >> </operator> >> >> If my URL has an reads something like this >> "localhost:1234://..../q=issn:1573-4803 >> journalonlinefirst:true&api_key=asdbfdas2342sfda" i want the api to fetch >> me those docs which are of the type JournalOnlineFirst. But i get the error >> as :" >> >> XDMP-ARGTYPE: (err:XPTY0004) fn:in-scope-prefixes((<searchable-expression >> xmlns="http://marklogic.com/appservices/search">/Publisher[.//JournalOnlineFirst]</searchable-expression>, >> <searchable-expression >> xmlns="http://marklogic.com/appservices/search">fn:collection()</searchable-expression>)) >> -- arg1 is not of type element()" >> >> Please suggest how to achieve the result because i am stuck at this >> place. I have also tried something like this. >> >> "<operator name="JournalOnlineFirst"> >> <state name="true"> >> >> </state> >> </operator> >> >> <searchable-expression>/Publisher[.//JournalOnlineFirst]</searchable-expression>". >> >> >> Here i dont get the result, but i dont get the error as well. Please let >> me know where i am going wrong. Thanks in advance. >> Regards >> Amit >> >> >> >> >> ---------- Forwarded message ---------- >> From: Micah Dubinko <[email protected]> >> To: MarkLogic Developer Discussion <[email protected]> >> Cc: >> Date: Wed, 6 Jun 2012 21:42:50 -0700 >> Subject: Re: [MarkLogic Dev General] Issue with operator in Search api >> Hi Amit, >> >> Welcome. >> >> First a bit of general advice, which you may have heard before. Run the >> function search:check-options often. Set up your build environment so that >> it runs every time you do a search. If it returns empty-sequence, you're >> golden, otherwise it's alerting you to current or potential problems. (It >> does in-depth checks which take time, so don't run it in a production >> environment). >> >> It can be tricky to keep track of which config elements are allowed >> where, but check-options will keep you on the path. >> >> It looks like the error below comes from having multiple >> <searchable-expression>s. Having one inside a <state> should be fine, but >> not with a global one too. Since your global one is pointing at >> fn:collection() which is the default anyway, you can get rid of it. >> >> Try these and let us know how things turn out. >> >> Thanks, -m >> >> >> >> >> On Jun 6, 2012, at 9:27 PM, amit gope wrote: >> >> Hello All, >> >> I am new to search api and i am having trouble in implementing one >> functionality. There are basically two things that i am stuck with: >> >> 1. Can i have two operators in the options? >> 2. I have a code which looks something like this: >> >> <operator name="sort"> >> <state name="relevance"> >> <sort-order> >> <score/> >> </sort-order> >> </state> >> <state name="date"> >> <sort-order direction="descending" >> type="xs:date" collation=""> >> <element ns=" >> http://www.marklogic.com/app/meta" name="Date"/> >> </sort-order> >> <sort-order> >> <score/> >> </sort-order> >> </state> >> </operator> >> <operator name="JournalOnlineFirst"> >> <state name="true"> >> >> <searchable-expression>/Publisher[.//JournalOnlineFirst]</searchable-expression> >> </state> >> </operator> >> >> If my URL has an reads something like this "localhost: >> 1234://..../q=issn:1573-4803journalonlinefirst:true&api_key=asdbfdas2342sfda" >> i want the api to fetch >> me those docs which are of the type JournalOnlineFirst. But i get the error >> as :" >> >> XDMP-ARGTYPE: (err:XPTY0004) fn:in-scope-prefixes((<searchable-expression >> xmlns="http://marklogic.com/appservices/search">/Publisher[.//JournalOnlineFirst]</searchable-expression>, >> <searchable-expression >> xmlns="http://marklogic.com/appservices/search">fn:collection()</searchable-expression>)) >> -- arg1 is not of type element()" >> >> >> Please suggest how to achieve the result because i am stuck at this >> place. I have also tried something like this. >> >> "<operator name="JournalOnlineFirst"> >> <state name="true"> >> >> </state> >> </operator> >> >> <searchable-expression>/Publisher[.//JournalOnlineFirst]</searchable-expression>". >> >> >> Here i dont get the result, but i dont get the error as well. Please let >> me know where i am going wrong. Thanks in advance. >> Regards >> Amit >> >> >> _______________________________________________ >> General mailing list >> [email protected] >> http://community.marklogic.com/mailman/listinfo/general >> >> >> >> _______________________________________________ >> General mailing list >> [email protected] >> http://community.marklogic.com/mailman/listinfo/general >> >> > > > > >
_______________________________________________ General mailing list [email protected] http://community.marklogic.com/mailman/listinfo/general
