Re: [MarkLogic Dev General] How to specify Collection along with the document URI when inserting a marklogic document

2018-05-09 Thread Christopher Hamlin
The second and third examples at
https://docs.marklogic.com/xdmp:document-insert shows collections
being set.

Do those work for you?

On Wed, May 9, 2018 at 7:48 AM, Bharath Umesh  wrote:
> Hi
>
> How do I specify Collection info  along with the document URI when inserting
> a marklogic document.
>
>
> Thanks,
> Bharath
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Near Query with min-occurs

2018-04-04 Thread Christopher Hamlin
The min-occurs is an option to the word-query, not the near-query. I'd
check if results match what is described in the word query doc page.

On Tue, Apr 3, 2018, 10:37 PM Praveen Gontla <
praveenkumargontla...@gmail.com> wrote:

> Team,
>
> Has anyone come across a query like this ? Trying to understand what would
> happen in here.
>
>  
> prop*
> case-insensitive
> diacritic-insensitive
> punctuation-insensitive
> *min-occurs=4*   weight="0"> tax
> case-insensitive
> diacritic-insensitive
> punctuation-insensitive
> unstemmed 
> ordered 
>
> When my near query contains a min-occurs option set how should it behave ?
>
> I thought a document that contains prop* with in a distance of 1 for the
> term tax atleast 4 times . But the documents I get for this query are not
> like that. Even if the document has single occurrence of the term property
> tax are also returned.
>
> Is my understanding correct or am I missing something in here ?
>
> Thanks,
> Praveen.
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Marklogic9 Oscar database

2018-02-15 Thread Christopher Hamlin
Hi,

I'm not sure what exactly exercises are used, but MarkLogic University
is probably the place I'd look:
https://www.marklogic.com/learn/university/

There is a variety of instruction including self-paced, on demand, and
instructor led.  Free.

/ch


On Thu, Feb 15, 2018 at 10:03 AM, Noah Manukonda  wrote:
> Hi,
>
> I am learning Marklogic and beginner.I am currently learning on Marklogic 9.
>
> Do we have oscar db equivalent exercise in Marklogic 9? I heard that’s it a
> very good exercise to start leaning marklogic.
>
>
> Thanks,
> Noah
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Serialization encoding, SJS

2018-02-15 Thread Christopher Hamlin
Maybe http://docs.marklogic.com/xdmp.setResponseEncoding


On Thu, Feb 15, 2018 at 4:09 AM, Florent Georges  wrote:
> Hi,
>
> I am using SJS, and I would like to set the encoding used for serializing
> the response (a bit like xdmp:output or output:* for XQuery).
>
> Extra points if it is possible to use it "dynamically" (e.g. depending on an
> if/then/else condition).
>
> Any idea? Regards,
>
> --
> Florent Georges
> H2O Consulting
> http://h2o.consulting/
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Regarding limiting no of co-occurrences returned.

2017-11-28 Thread Christopher Hamlin
Yeah, TDE is a great suggestion if you you are on 9.

You can control extraction context, and so keep separate the kind of
"repeating rows" that can be difficult with tuples.

For example see:  http://docs.marklogic.com/guide/app-dev/TDE#id_71415

On Tue, Nov 28, 2017 at 4:02 PM, Erik Hennum  wrote:
> Hi, Shabana:
>
> If you are on MarkLogic 9, you might consider using TDE to project the rows 
> you want from the documents.
> You can then use the Optic API to retrieve rows from documents qualified by a 
> cts.query().
>
> Erik Hennum
>
>
>
> 
> From: general-boun...@developer.marklogic.com 
>  on behalf of Christopher Hamlin 
> 
> Sent: Tuesday, November 28, 2017 8:05:14 AM
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] Regarding limiting no of co-occurrences  
>   returned.
>
> You'll get tuples for the cross product over the document (that is,
> the co-occurrences within the whole document).
>
> So, is it the case that you have more than one occurrence of the two
> values you are returning, in the same document?
>
> If so, sometimes you can do some work by using the 'proximity' and
> 'ordered' options.
>
> The query you pass restricts the fragments.  Unless you have
> fragmentation, this equates to co-occurrences across all documents
> matching the query.
>
> /ch
>
> On Tue, Nov 28, 2017 at 7:53 AM, shabana khan  wrote:
>> Hi All,
>>
>> I am using cts:value-co-occurrences() for fetching pair of values for data
>> set in my project.I have a query too for restricting resultant pair only
>> from specific section.
>> But the problem I am facing is that duplicate results are being returned for
>> each occurrence of values.
>> Basically, I am looking for a way by which each pair of value should occur
>> only once in result. I looked at the available options and tried using
>> "limit=N" but that seems to have no effect on this.
>> Filtering at later stage is not possible since it slows down the query if I
>> go for selecting unique records based on some value.
>>
>> Is there some way to achieve it. If anyone has faced this problem please do
>> share what you did exactly to get unique pair of values.
>> Any heads-up will be appreciated.
>>
>> Thanks and Regards,
>> Shabana Khan
>> LinkedIn
>>
>>
>>
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Regarding limiting no of co-occurrences returned.

2017-11-28 Thread Christopher Hamlin
You'll get tuples for the cross product over the document (that is,
the co-occurrences within the whole document).

So, is it the case that you have more than one occurrence of the two
values you are returning, in the same document?

If so, sometimes you can do some work by using the 'proximity' and
'ordered' options.

The query you pass restricts the fragments.  Unless you have
fragmentation, this equates to co-occurrences across all documents
matching the query.

/ch

On Tue, Nov 28, 2017 at 7:53 AM, shabana khan  wrote:
> Hi All,
>
> I am using cts:value-co-occurrences() for fetching pair of values for data
> set in my project.I have a query too for restricting resultant pair only
> from specific section.
> But the problem I am facing is that duplicate results are being returned for
> each occurrence of values.
> Basically, I am looking for a way by which each pair of value should occur
> only once in result. I looked at the available options and tried using
> "limit=N" but that seems to have no effect on this.
> Filtering at later stage is not possible since it slows down the query if I
> go for selecting unique records based on some value.
>
> Is there some way to achieve it. If anyone has faced this problem please do
> share what you did exactly to get unique pair of values.
> Any heads-up will be appreciated.
>
> Thanks and Regards,
> Shabana Khan
> LinkedIn
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xsl:output, character maps and document-insert

2017-11-08 Thread Christopher Hamlin
Yeah, the xdmp:save gives you a serialized version to look at directly
and check.

There's a little more on this here:
https://help.marklogic.com/knowledgebase/article/View/328/0/xml-serialization-and-output-options

/ch

On Wed, Nov 8, 2017 at 11:31 AM, Mark Donoghue  wrote:
> Christopher, thank you for responding :-) I was experimenting with your
> suggestion (it worked) when Mary's response arrived.
>
> Mary, thank you for the information and workaround!
>
> It was surprising to find out the difference between writing back to the
> database and serializing. I assumed it would be serialized everywhere.
>
> Best,
> Mark
>
> - -- --- -  -
> Mark Donoghue
> IEEE
> (732) 562-6045
> m.donog...@ieee.org
>
> IEEE - Advancing Technology for Humanity
>
> On Wed, Nov 8, 2017 at 10:19 AM, Mary Holstege 
> wrote:
>>
>>
>> Character maps apply to serializations. What gets stored in the database
>> isn't serialized: it is a data model instance, that isn't serialized
>> unless it is (a) rendered as output from a query (b) saved to disk or (c)
>> explicitly serialized as a string via xdmp:quote.
>>
>> There is a special pass-through that when a document is returned from XSLT
>> and returned as a result of the query, the XSLT serialization options will
>> be applied, but that only works within the context of a single query.
>>
>> Try this: force a serialization using xdmp:quote and saving the reparse of
>> that, e.g.
>> xdmp:document-insert("/my.xml", xdmp:unquote(xdmp:quote($doc)) )
>>
>> I think that should work. Round-tripping a serialization/parse to/from
>> disk should also work, e.g.
>> xdmp:document-insert("/my.xml", xdmp:document-get("/tmp/my.xml",
>> xdmp:save("/tmp/my.xml",$doc)))
>>
>> Failing that, you'll need to do a manual sweep-replace yourself so that
>> the data model instance you save has the characters in it that you want.
>>
>> //Mary
>>
>>
>> On Tue, 07 Nov 2017 15:22:41 -0800, Mark Donoghue 
>> wrote:
>>
>> > Hi,
>> >
>> >
>> > I am running a query in the query console that retrieves a document from
>> > the
>> > database, invokes an XSLT and stores the result over the same document
>> > URI.
>> >
>> >
>> > The purpose of the XSLT is to unescape double-escaped character entities
>> > (i.e.:
>> > &). Following what I thought was standard practice, the XSLT
>> > replaces &'s
>> > with &xE; and uses a character map to swap the private character
>> > with an
>> > ampersand on output (using the use-character-maps on the xsl:output
>> > element).
>> >
>> >
>> > This works fine in oXygen and even in the query console tests where I
>> > output the
>> > result document to the output pane.
>> >
>> >
>> > The problem occurs when I retrieve the document from the database. The
>> > private
>> > character &xE; is still in the result document I stored, and hasn't
>> > been
>> > replaced with an ampersand.
>> >
>> >
>> > Does document-insert (or something) ignore the xsl:output directives in
>> > the
>> > stylesheet?
>> >
>> >
>> > Am I running into some some query console behavior I'm not aware of (I'm
>> > still
>> > rather new at using MarkLogic).
>> >
>> >
>> > Any pointers in the right direction will he much appreciated.
>> >
>> >
>> > Best,
>> >
>> > Mark
>> >
>> >
>> > - -- --- -  -
>> > Mark Donoghue
>> >
>> > IEEE
>> >
>> > (732) 562-6045
>> >
>> > m.donog...@ieee.org
>> >
>> >
>> > IEEE - Advancing Technology for Humanity
>>
>>
>> --
>> Using Opera's revolutionary email client: http://www.opera.com/mail/
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xsl:output, character maps and document-insert

2017-11-08 Thread Christopher Hamlin
Sometimes query console output can be misleading, since it's creating
a display.  Another way to test is xdmp:save to the disk and look
there.

Do you have a small example to try?

/ch

On Tue, Nov 7, 2017 at 6:22 PM, Mark Donoghue  wrote:
> Hi,
>
> I am running a query in the query console that retrieves a document from the
> database, invokes an XSLT and stores the result over the same document URI.
>
> The purpose of the XSLT is to unescape double-escaped character entities
> (i.e.: &). Following what I thought was standard practice, the XSLT
> replaces &'s with &xE; and uses a character map to swap the private
> character with an ampersand on output (using the use-character-maps on the
> xsl:output element).
>
> This works fine in oXygen and even in the query console tests where I output
> the result document to the output pane.
>
> The problem occurs when I retrieve the document from the database. The
> private character &xE; is still in the result document I stored, and
> hasn't been replaced with an ampersand.
>
> Does document-insert (or something) ignore the xsl:output directives in the
> stylesheet?
>
> Am I running into some some query console behavior I'm not aware of (I'm
> still rather new at using MarkLogic).
>
> Any pointers in the right direction will he much appreciated.
>
> Best,
> Mark
>
> - -- --- -  -
> Mark Donoghue
> IEEE
> (732) 562-6045
> m.donog...@ieee.org
>
> IEEE - Advancing Technology for Humanity
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Replicating Security Database

2017-10-31 Thread Christopher Hamlin
Probably the answer starts here:

http://docs.marklogic.com/guide/cluster/failover#id_80780

and continues here:

http://docs.marklogic.com/guide/cluster/config-both-failover#id_57935

On Tue, Oct 31, 2017 at 3:39 PM, Yogesh Jadhav 
wrote:

> Hi Everyone,
>
> I have created one MarkLogic cluster using three virtual machines.
>
> First, I initialized MarkLogic on host1 and joined host2 and host3 to
> host1.
>
> Just to try HA in MarkLogic, I shut down the host1 and after that, I was
> unable to admin console on host2 and host3.
>
> I know, This could be because of security database as it resides on host1.
> I tried replicating security forest to host2 and host3 but I got an error
> like 'private forests can't be replicated'.
>
> Could anyone please help me on this.
>
> Thanks
>
> --
>
> *Regards,*
>
> *Yogesh Jadhav*
>
> [image: View Yogesh Jadhav's profile on LinkedIn]
> 
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] exact match using regex

2017-10-13 Thread Christopher Hamlin
You can use anchors, as

fn:matches("I am learning regex","^re$")

7.6.2 fn:matches of https://www.w3.org/TR/xpath-functions/#flags says:

Unless the metacharacters ^ and $ are used as anchors, the string is
considered to match the pattern if any substring matches the pattern.
But if anchors are used, the anchors must match the start/end of the
string (in string mode), or the start/end of a line (in multiline
mode).

Note:

This is different from the behavior of patterns in [XML Schema Part 2:
Datatypes Second Edition], where regular expressions are implicitly
anchored.

On Fri, Oct 13, 2017 at 3:19 PM,   wrote:
> Hi All,
>
>
>
> How to match exact word using fn:matches and regex.
>
>
>
> Example : fn:matches(“I am learning regex”,”re”)
>
> Above statement returning true as it is  matching with “regex”  but I want
> it should match only when string found exact keyword.
>
>
>
> Regards,
>
> Vikas Singh
>
>
>
> This e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. If you are not the intended recipient(s), please reply to the
> sender and destroy all copies of the original message. Any unauthorized
> review, use, disclosure, dissemination, forwarding, printing or copying of
> this email, and/or any action taken in reliance on the contents of this
> e-mail is strictly prohibited and may be unlawful. Where permitted by
> applicable law, this e-mail and other e-mail communications sent to and from
> Cognizant e-mail addresses may be monitored.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Querying DateTime values

2017-09-26 Thread Christopher Hamlin
I'd do it bit by bit.

Just change the cts:uris to cts:search:

cts:search (/,
cts:element-attribute-range-query($element-name, $attribute-name,
'>', fn:current-dateTime () - xs:dayTimeDuration('P10D'))
)

That still worked for me.

Then add in the other stuff gradually.  When something doesn't work,
you'll know what it is.

/ch

On Tue, Sep 26, 2017 at 10:30 AM, Kari Cowan  wrote:
> @chris put another way - how would I test your example using a cts:search
> rather than displaying in the return option?
>
> On Mon, Sep 25, 2017 at 8:45 AM, Kari Cowan  wrote:
>>
>> Chris, Gert  - Thanks - I tried your test and I see that it does return
>> uri's from the last 10 days, so that works - but now I am having difficulty
>> incorporating that to a more complex query.
>>
>> When I tried dropping that into my cts:search query, it didn't return
>> anything.  Anything you can suggest to make this work, or do you see
>> anything glaringly wrong?
>>
>> let $element-name := fn:QName ('http://www.incisivemedia.com/summary',
>> 'PUBLICATION-DATE')
>> let $attribute-name := fn:QName ('', 'datetime')
>>
>>
>> let $search:=(
>>  cts:search(fn:collection(),
>>cts:and-query((
>> cts:directory-query("/data-sources/sbm/","infinity"),
>> cts:element-attribute-range-query($element-name, $attribute-name,
>> '>', fn:current-dateTime () - xs:dayTimeDuration('P10D'))
>> ))
>>   )
>> )
>>
>> for $docs in $search/ir:ARTICLE
>> order by xs:dateTime($docs//sum:PUBLICATION-DATE/@datetime) descending
>> return $docs
>>
>>
>>
>> On Sat, Sep 23, 2017 at 12:32 PM, Geert Josten
>>  wrote:
>>>
>>> I think the issue is in how you write the reference to the element you
>>> want to query. You write
>>> cts:element-attribute-range-query(xs:QName("PUBLICATION-DATE”), but like
>>> Chris is suggesting, you better write xs:QName("PUBLICATION-DATE”) as
>>> fn:QName(“http://www.incisivemedia.com/summary”, “PUBLICATION-DATE”), or you
>>> should declare a namespace prefix in your code, and use that in xs:QName:
>>>
>>> declare namespace sum = “http://www.incisivemedia.com/summary”;
>>>
>>> xs:QName(“sum:PUBLICATION-DATE")
>>>
>>> Cheers
>>>
>>> From:  on behalf of Kari Cowan
>>> 
>>> Reply-To: MarkLogic Developer Discussion
>>> 
>>> Date: Friday, September 22, 2017 at 11:02 PM
>>> To: MarkLogic Developer Discussion 
>>> Subject: Re: [MarkLogic Dev General] Querying DateTime values
>>>
>>> Let me get your opinion on this.  I confirmed that there IS a dateTime
>>> element-attribute range index.
>>>
>>> Where the query works correctly, the data is written like this
>>> representation:
>>>
>>> http://www.incisivemedia.com/summary";>
>>> >> datetime="2017-08-09T15:14:00-04:00">2017-08-09
>>> 15:14:00:000
>>> 
>>>
>>> Where it fails, the data is written this way - note the namespace
>>> precedes the declaration - which seems wrong to me.
>>>
>>> If it's right or wrong, can you advise if that needs to be updated or if
>>> there's a way to run the query to check a date range, returning docs within
>>> say the last 10 days only?
>>>
>>> >> xmlns:summary="http://www.incisivemedia.com/summary";>
>>> >> datetime="2017-09-21T17:47:00Z">2017-09-21T17:47:00Z
>>> 
>>>
>>> On Fri, Sep 22, 2017 at 1:05 PM, Kari Cowan  wrote:
>>>>
>>>> Ahh, once i fixed the misplaced paren, I can get back a proper error
>>>> that tells me something more useful -- No dateTime element-attribute range
>>>> index for fn:QName("", "PUBLICATION-DATE") fn:QName("", "datetime")
>>>>
>>>> Thanks! - I think I know where to go from here :)
>>>>
>>>> XDMP-ELEMATTRRIDXNOTFOUND: cts:search(fn:collection(),
>>>> cts:and-query((cts:directory-query("/data-sources/sbm/", "infinity"),
>>>> cts:or-query((cts:element-query(xs:QName("sum:PUBLICATION-NAME"),
>>>> cts:word-query("BenefitsPro.com", ("lang=en"), 1), ()),
>>>> cts:element-query(xs:QName("sum:PUBLICATION-NAME"),
>>>> cts:word-query("CUTimes", ("lang=en&

Re: [MarkLogic Dev General] Querying DateTime values

2017-09-22 Thread Christopher Hamlin
I tried a simple test.

I created the index as

type: dateTime
parent namespace uri: http://www.incisivemedia.com/summary
parent localname:  PUBLICATION-DATE
namespace uri:
localname:  datetime
range value positions:  false
invalid values:  reject.

and inserted those two documents.

Then,

let $element-name := fn:QName ('http://www.incisivemedia.com/summary',
'PUBLICATION-DATE')
let $attribute-name := fn:QName ('', 'datetime')
let $ref := cts:element-attribute-reference ($element-name, $attribute-name)
return cts:values ($ref)

returns the two datetime values

2017-08-09T15:14:00
2017-09-21T13:47:00

and a query like

let $element-name := fn:QName ('http://www.incisivemedia.com/summary',
'PUBLICATION-DATE')
let $attribute-name := fn:QName ('', 'datetime')
return
cts:uris ((), (),
cts:element-attribute-range-query($element-name, $attribute-name,
'>', fn:current-dateTime () - xs:dayTimeDuration('P10D'))
)

returns the uris depending on how many days I subtract.

Does this work for you too (I tested on 9.0-2)?

On Fri, Sep 22, 2017 at 5:02 PM, Kari Cowan  wrote:
> Let me get your opinion on this.  I confirmed that there IS a dateTime
> element-attribute range index.
>
> Where the query works correctly, the data is written like this
> representation:
>
> http://www.incisivemedia.com/summary";>
>  datetime="2017-08-09T15:14:00-04:00">2017-08-09
> 15:14:00:000
> 
>
> Where it fails, the data is written this way - note the namespace precedes
> the declaration - which seems wrong to me.
>
> If it's right or wrong, can you advise if that needs to be updated or if
> there's a way to run the query to check a date range, returning docs within
> say the last 10 days only?
>
> http://www.incisivemedia.com/summary";>
>  datetime="2017-09-21T17:47:00Z">2017-09-21T17:47:00Z
> 
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Querying DateTime values

2017-09-22 Thread Christopher Hamlin
I'm not sure what is the real problem.

xs:dateTime ('2003-08-01T08:00:00Z') > xs:dateTime (fn:current-date()
- xs:dayTimeDuration("P30D"))
,
xs:dateTime ('2017-09-28T00:00:00-04:00') > xs:dateTime
(fn:current-date() - xs:dayTimeDuration("P30D"))

return false and true, no failure.  What type is the index, and what
is the failure?

On Fri, Sep 22, 2017 at 11:10 AM, Geert Josten
 wrote:
> Hi Kari,
>
> Looks like you misplaced one of the parentheses. Make sure to wrap the
> string "2017-09-22T08:00:00Z” in xs:dateTime(..) before you try to substract
> the duration. In provided query you have the xs dateTime cast wrapping both
> current-date and the duration.
>
> Cheers,
> Geert
>
> From:  on behalf of Kari Cowan
> 
> Reply-To: MarkLogic Developer Discussion 
> Date: Friday, September 22, 2017 at 4:51 PM
> To: MarkLogic Developer Discussion 
> Subject: [MarkLogic Dev General] Querying DateTime values
>
> I need some expert tips on this bug.
>
> cts:element-attribute-range-query(xs:QName("PUBLICATION-DATE"),xs:QName("datetime"),
> ">=", xs:dateTime(fn:current-date() - xs:dayTimeDuration("P30D")))
>
> The above query works fine when the publication-date is in this format:
>  datetime="2017-09-28T00:00:00-04:00">2017-09-28
> 00:00:00:000
>
> But it fails when
>  datetime="2003-08-01T08:00:00Z">2003-08-01T08:00:00Z
>
> The datetime format is different, but if I manipulate the current-date to
> match that format, the query will fail with this message:
>
> [1.0-ml] XDMP-EXPR: (err:XPTY0004) "2017-09-22T08:00:00Z" -
> xs:dayTimeDuration("P30D") -- Invalid expression
>
> How would I write the query to properly compare the dates?
>
> The goal above was to return content from the last 30 days.
>
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Apparent Memory Leak in Profiler

2017-08-28 Thread Christopher Hamlin
There was a bug where, under certain circumstances, the profiler will
result in a query deadlock &/or a resource leak (#45569).  It could be
that this is what you are seeing.

It was noticed in 8.0-2 and is fixed in the latest release (8.0-7).

On Mon, Aug 28, 2017 at 1:11 PM, Eliot Kimber  wrote:
> I reported earlier that my profiling application was causing MarkLogic to 
> restart after handling about 20,000 tasks. Turns out it was an out-of-memory 
> issue on the server itself (currently configured with 256GB of RAM). We could 
> see a distinct spike in memory usage, at which point the server restarted 
> MarkLogic. I tried different input data sets so it doesn’t appear to be an 
> issue with a particular input document (my data set has a few outliers that 
> are much larger than typical but only a few).
>
> Subsequent testing determined that it was the use of the MarkLogic profiler 
> that was causing the memory spike: if I turned off the profiler then memory 
> usage was flat and all the tasks completed as expected.
>
> This is ML 8.03. I’m still working on getting my server upgraded to a newer 
> version of MarkLogic so I can see if this is an issue that has already been 
> fixed.
>
> So it looks like there’s some kind of memory leak related to the profiler and 
> I’d like to understand what that issue and either understand how to avoid it 
> or report it formally.
>
> If it’s a general potential problem with large-scale processing would like to 
> understand how to avoid it or plan for it. If it’s a problem specific to the 
> profiler then need to report it formally and provide appropriate diagnostics.
>
> So my questions:
>
> 1. Is this a known issue with profiling? I’m guessing not in that I’m 
> probably doing something out-of-the-ordinary vis-à-vis profiling and is 
> something that nobody would see in typical single-instance ad-hoc profiling.
> 2. What types of MarkLogic processing would cause this kind of memory spike 
> that lasts across the execution of multiple tasks? I would expect the memory 
> required for a given task to be released as soon as the task is complete so 
> I’m guessing it must be an issue with caches or something?
>
> Thanks,
>
> Eliot
> --
> Eliot Kimber
> http://contrext.com
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Or-Query: Synonym Scoring

2017-08-17 Thread Christopher Hamlin
>From the doc for cts:or-query, 'synonym' means:

Specifies that all of the terms in the $queries parameter are considered
synonyms for scoring purposes. The result is that occurrences of more than
one of the synonyms are scored as if there are more occurrences of the same
term (as opposed to having a separate term that contributes to score).

So it sounds like the scoring would be similar to 1 hit for a query in docs
1,3 and 2 hits for the same query in doc2, and you'd expect doc2 to score
higher in that situation.

Similar description for 'synonym' in cts:element-word-query seems to
bolster this interpretation (to me).

/ch

On Thu, Aug 17, 2017 at 9:55 AM, Andreas Hubmer 
wrote:

> Hi,
>
> We've discovered the "synonym" option of the cts:or-query and thought that
> it would solve an issue we've had for a longer time in several applications
> with several clients. But it does not work as expected. Either I am
> misunderstanding the effect of the "synonym" option or there is a bug.
>
> The following XQuery snippet demonstrates the issue. Three documents are
> inserted into the database. All contain the word "tom", but in different
> elements.
> In the search an or-query over the different elements is used. Our
> expectation was that by using the "synonym" option all results would have
> the same score. But the document with both elements name1 and name2 is
> scored higher than the other two (about 30% higher).
> Why do they have different scores?
> I would expect that the "synonym" option is working like a *maximum*
> function on the score of the subqueries.
>
> xquery version "1.0-ml";
> xdmp:document-insert("/1.xml",
>   
> tom
>   
> )
> ,
> xdmp:document-insert("/2.xml",
>   
> tom
> tom
>   
> ),
> xdmp:document-insert("/3.xml",
>   
> tom
>   
> )
> ;
>
> xquery version "1.0-ml";
> cts:search(/,
>   cts:or-query((
>   cts:element-word-query(xs:QName("name1"), "tom"),
>   cts:element-word-query(xs:QName("name2"), "tom")
> ), "*synonym*"),
>   "score-simple"
> )
> !
> ("Score: " || cts:score(.), .)
>
> "Fast element word searches" are turned on in the database.
> The scoring model (score-simple or score-logtf) does not make a difference.
>
> It would be great if you could help me!
>
> Cheers,
> Andreas
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Count of cts:element-values() not equal to number of element instances--what's going on?

2017-08-14 Thread Christopher Hamlin
Does https://docs.marklogic.com/cts:frequency help?

/ch
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Slow response from Marklogic HTTP Server

2017-08-02 Thread Christopher Hamlin
If you can use the Admin UI, look at app server status.  does it show
running tasks? if so, looking at the stack (if debuggable) may give you a
live clue as to what they are doing.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Issues with MarkLogic Function in SPARQL Queries in Query Console

2017-08-01 Thread Christopher Hamlin
On Tue, Aug 1, 2017 at 12:45 PM, Steven Anderson 
wrote:

> Thanks for the solution.  At the root of my confusion was this part of the
> doc:
>
> "For the prefix IRIs commonly associated with fn, cts, math, and xdmp (or
> any other prefix IRIs that do not end with a "/" or "#"), append a # to
> the prefix IRI to the prefix IRI and then the function localname, for
> example: http://marklogic.com/cts#contains/";
>
> I read the first saying that anything that's documented as fn: should use
> the marklogic.com path.
>

I think it means those prefixes don't end with # or /.

Some common prefixes and definitions are here:

http://docs.marklogic.com/guide/xquery/namespaces#id_21104


>
> But to your point, it also says, "Extension functions in SPARQL are
> identified by IRIs in the form of http://www.w3.org/2005/xpath-functions#
> *name*/ where *name* is the local name of the function and the string
> before the # is the prefix IRI of the function, for example
> http://www.w3.org/2005/xpath-functions#starts-with/";
>
> Apparently if something is in both (aren't all fn: in the
> xpath-functions?) I need to use the w3.org path.
>

fn: is one of the xpath-functions.  I don't see any other starts-with
function listed at http://docs.marklogic.com/all.

I've put in to remove the trailing slashes from the above paragraph too;
thanks for pointing that out.

/ch
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Issues with MarkLogic Function in SPARQL Queries in Query Console

2017-08-01 Thread Christopher Hamlin
Try the same prefix for fn, rather than the cts one:

PREFIX fn: <http://www.w3.org/2005/xpath-functions#>

I did see the other mistake in the doc, so I'll report that.  This I didn't
find, so just a copy/paste error in testing?

On Mon, Jul 31, 2017 at 5:56 PM, Steven Anderson 
wrote:

> Yup, that worked, thanks.  Any ideas on why the fn: namespace version
> isn't working?
>
> On Mon, Jul 31, 2017 at 1:29 PM, Christopher Hamlin 
> wrote:
>
>> I removed the trailing / in the function name here (after 'starts-with'):
>>
>> <http://www.w3.org/2005/xpath-functions#starts-with/>( ?o, "sf" ) )
>>
>> and the error went away.  Does that work for you?
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
>
> --
>
>  Steve
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Issues with MarkLogic Function in SPARQL Queries in Query Console

2017-07-31 Thread Christopher Hamlin
I removed the trailing / in the function name here (after 'starts-with'):

( ?o, "sf" ) )

and the error went away.  Does that work for you?
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Christopher Hamlin
Does element-value-query work for you?  You might need wildcard indexes,
but perhaps you have them on.

On Fri, Jun 16, 2017 at 6:16 PM, Oleksii Segeda 
wrote:

> Hi everyone,
>
> Can someone explain how does cts:element-value-match work with integer
> indexes? I cannot pass a string as a second argument, so it's unclear how
> to do a wildcarded search.
> Ultimate goal is to find 2000 and 200, if user typed 200. I understand
> that I can create an additional string index, but I want to know if a
> better solution exists.
>
> Thanks.
>
> Oleksii Segeda
> IT Analyst
> Information and Technology Solutions
> www.worldbank.org
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Getting "Parser Error: Cannot parse result. File size too large"

2017-06-09 Thread Christopher Hamlin
Since it mentions the parser, does changing to 'raw' view help?

If it doesn't help, you might try getting the file from REST, or xdmp:save
to the file system.


On Fri, Jun 9, 2017 at 9:36 AM,  wrote:

> Hi Guys ,
>
> Need some help here.
>
> I ingested a couple of xmls using MLCP and the file sizes are around 7-8
> MB each.
>
> While trying to see the contents of the files using qconsole , I am
> getting the following error :
>
> "Parser Error: Cannot parse result. File size too large"
>
> Any ideas how to get over this ??
>
> Many thanks in Advance
> Met vriendelijke groet / Kind regards / सादर,
>  Himanshu Mishra
> ABN AMRO | Data Innovation & Analytics
> Foppingadreef 22 | 1102 BS Amsterdam | Nederland | Location: Digital House
> Mob.: +31-613 28 28 64 | E-mail: *himanshu.mis...@nl.abnamro.com*
> 
>
> Please consider the environment before printing this email.
> This message has been sent by ABN AMRO Bank N.V., which has its seat at
> Gustav Mahlerlaan 10 (1082 PP) Amsterdam, the Netherlands, and is
> registered in the Commercial Register of Amsterdam under number 34334259.
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-22 Thread Christopher Hamlin
My guess is that it's a big doc and hard to find the HTML tags?

Open the doc in an XML editor and search for *:HTML and it may show.

Also, those are both {incisive-repository}HTML nodes, even if there is a
(surface) difference in prefix/namespace.  This is an example of why regex
for xml strings can't cope.

It's hard to recommend anything (in detail) since I guess I don't undestand
the requirements.

It's easy to say, though:  regex is not good for something like this.  You
can use xslt or recursive xquery pretty easily in ML.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-20 Thread Christopher Hamlin
I don't know off-hand of changes in xslt between 7 and 8.

Something like this in 8 is what I was thinking, don't know if it is really
what you need:

let $doc := (: blah blah blah :)
let $xslt :=
http://www.w3.org/1999/XSL/Transform"; xmlns:ir="incisive-repository">
  

  

  
  

return xdmp:xslt-eval ($xslt, $doc)
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Using RegEx in xQuery

2017-03-18 Thread Christopher Hamlin
Note that regex works on strings, not nodes.  It's easier I think to
operate on nodes here.

You could do it with xslt also.  Start with an identity transform and then
have {incisive-repository}HTML nodes with similar preceding-siblings
transform to nothing.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] hyphens and cts:element-value-query

2017-02-28 Thread Christopher Hamlin
When you run

xdmp:plan (cts:search (/, cts:element-value-query(xs:QName('ename'),
'value-1', 'exact')))

element(ename,value("value","1"))

or

element(ename,value("value","-","1"))

?  I'm not sure why, but I see the former in 8.0-6, and the latter in
8.0-5.10 and 8.0-6.1.  Are you in a position to try an upgrade?

On Tue, Feb 28, 2017 at 2:49 PM, Gary Larsen  wrote:

> Learning more than usual today J
>
>
>
> "collation=URI" is an option on element-range-query(), but not on
> element-value-query().  Looks like creating an range index would be useful
> for elements which may have spaces or punctuation and need exact matching..
>
>
>
> Thanks, Gary
>
>
>
> *From:* general-boun...@developer.marklogic.com [mailto:general-bounces@
> developer.marklogic.com] *On Behalf Of *Geert Josten
> *Sent:* Tuesday, February 28, 2017 2:28 PM
> *To:* MarkLogic Developer Discussion
>
> *Subject:* Re: [MarkLogic Dev General] hyphens and cts:element-value-query
>
>
>
> In defense of Andreas, Mary does write this too:
>
>
>
> “At the boundary, where you specify exact unstemmed value
>
> queries or exact range queries *with a codepoint collation*,
>
> the results will line up. For exact queries there are universal
>
> index entries for the value that include punctuation and
>
> whitespace, but we don't index those tokens otherwise."
>
>
>
> E.g. it might work if you select codepoint collation ("collation=
> http://marklogic.com/collation/codepoint”) together with the “exact”
> option. MarkLogic defaults to using its own root collation.
>
>
>
> *From: * on behalf of James Kerr
> 
> *Reply-To: *MarkLogic Developer Discussion  com>
> *Date: *Tuesday, February 28, 2017 at 7:34 PM
> *To: *MarkLogic Developer Discussion 
> *Subject: *Re: [MarkLogic Dev General] hyphens and cts:element-value-query
>
>
>
> From Mary’s response: “Word tokens may be stemmed and punctuation and
> space tokens are *not* indexed” (emphasis my own).
>
>
>
> The fact that punctuation and space tokens are not indexed is why you
> cannot do punctuation-sensitive or whitespace-sensitive, unfiltered word or
> value queries.
>
>
>
> Depending on what you are trying to accomplish, custom tokenization (
> https://docs.marklogic.com/guide/search-dev/custom-tokenization) may be a
> good option for you.
>
>
>
> On a side note, can you share what you are doing for your predicate check?
> By adding a check like this, you are essentially just implementing your own
> filtered search so it’s unclear what the benefit would be over just using
> the “filtered” search option.
>
>
>
> -James
>
>
>
>
>
> *From: * on behalf of Gary
> Larsen 
> *Reply-To: *MarkLogic Developer Discussion  com>
> *Date: *Tuesday, February 28, 2017 at 1:12 PM
> *To: *'MarkLogic Developer Discussion' 
> *Subject: *Re: [MarkLogic Dev General] hyphens and cts:element-value-query
>
>
>
> Geert and Andreas,
>
>
>
> Thanks for pointing out tokens vs. values that I wasn’t understanding.
>
>
>
> Using ‘filtered’ in cts:search works, but I’ve always tried to avoid that
> for performance reasons.  In this case I’ve added a predicate check in the
> result instead.
>
>
>
> But to Andreas’s point, it seems that ‘exact’ or ‘punctuation-sensitive’
> should be able to match, or maybe I’m not understanding the documentation
> for cts:element-value-query.  If it did work I guess there would be extra
> work un-tokenizing?
>
>
>
> I using ML version 8.0-6
>
>
>
> Thanks for any clarification,
>
> Gary
>
>
>
>
>
> *From:* general-boun...@developer.marklogic.com [mailto:general-bounces@
> developer.marklogic.com ] *On
> Behalf Of *Andreas Hubmer
> *Sent:* Tuesday, February 28, 2017 8:23 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] hyphens and cts:element-value-query
>
>
>
> Hi Geert,
>
>
>
> As far as I know there are index entries for "exact" queries in the
> universal index, that include punctuation and whitespace. Thus, Gary's
> value queries should work unfiltered.
>
>
>
> There is an email by Mary Holstege supporting my assumption:
> http://developer.marklogic.com/pipermail/general/2013-March/012552.html
>
>
>
> Cheers,
>
> Andreas
>
>
>
>
>
>
>
> 2017-02-28 13:58 GMT+01:00 Geert Josten :
>
> Hi Gary,
>
>
>
> Sounds like you are running an unfiltered search. Either enable filtering
> to get rid of false positives, or switch to using element-range-query
> (which requires a range index). Keep in mind that value-queries don’t use
> range indexes (even if available), but rely on the universal index, which
> contains tokens, not values..
>
>
>
> Cheers,
>
> Geert
>
>
>
> *From: * on behalf of Gary
> Larsen 
> *Reply-To: *MarkLogic Developer Discussion  com>
> *Date: *Monday, February 27, 2017 at 10:01 PM
> *To: *'General MarkLogic Developer Discussion' <
> general@developer.marklogic.com>
> *Subject: *[MarkLogic Dev General] hyphens and cts:element-value-query
>
>
>
> I’m trying to get this cts query to treat hyphens as text:
>
>
>
> cts:element-value-query(xs:QName(ename), 'value 1',

Re: [MarkLogic Dev General] Is xdml:unquote appropriate for handling accent characters?

2017-02-09 Thread Christopher Hamlin
Here is a concentrated reference on serialization controls, for reference:

https://help.marklogic.com/knowledgebase/article/View/328/0/xml-serialization-and-output-options
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Is xdml:unquote appropriate for handling accent characters?

2017-02-09 Thread Christopher Hamlin
If the XML is OK (as XML), then it sounds like something downstream.
Either something funky expected in quoted-meta-whatever content or a bad
reader?  I don't know RSS, but I thought there would be no problems these
days with UTF-8 in either XML or even HTML pages.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Is xdml:unquote appropriate for handling accent characters?

2017-02-09 Thread Christopher Hamlin
I still think the goal isn't clear (to me).

What are you actually trying to deliver?  HTML, XML, XHTML?

Why do you want é instead of the Unicode character?

I'd go back to basics:  break the problem down to steps, define what's
needed at each step, and see where it goes wrong.


On Thu, Feb 9, 2017 at 2:05 PM, Kari Cowan  wrote:

> I guess I could do a function with a series of replacements
>
> >> fn:replace($Str,"é","&eacute;")
>
>
>
> I was hoping there was a better way.
>
>
>
>
>
> *From: * on behalf of Kari Cowan
> 
> *Reply-To: *MarkLogic 
> *Date: *Thursday, February 9, 2017 at 10:53 AM
> *To: *MarkLogic 
> *Subject: *Re: [MarkLogic Dev General] Is xdml:unquote appropriate for
> handling accent characters?
>
>
>
> We stored in the doc as:  Pokémon
>
>
>
> In xQuery I retrieve with
>
> let $theTitle:=$doc//ir:HEADLINE/text()
>
>
>
> That returns as:
>
> Pokémon
>
>
>
> How can I return it as Pokémon instead of Pokémon?
>
>
>
>
>
>
>
>
>
> *From: * on behalf of
> Christopher Hamlin 
> *Reply-To: *MarkLogic 
> *Date: *Thursday, February 9, 2017 at 9:44 AM
> *To: *MarkLogic 
> *Subject: *Re: [MarkLogic Dev General] Is xdml:unquote appropriate for
> handling accent characters?
>
>
>
> It's still unclear (to me) what is going on.  Here's some stuff I'd try:
>
> Is the title in the ML db?  If so, it's been parsed and stored as UTF-8.
>
> The query console can be complicated since it is goes through layers and
> is friendly in its output.
>
> You can check the data by getting dumping out the xml to disk and
> inspecting via whatever you might use for that.  Just use xdmp:save.  Then
> you know how things are in the db.
>
> Then, if you are going through an appserver, just do the request and store
> the result.  Again, check things out on disk.  Look at the headers returned
> and the payload.  Is the returned 'stuff' OK in an XML editor?
>
> If that's OK, then what is parsing the return and choking, and why is it
> choking?
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Is xdml:unquote appropriate for handling accent characters?

2017-02-09 Thread Christopher Hamlin
It's still unclear (to me) what is going on.  Here's some stuff I'd try:

Is the title in the ML db?  If so, it's been parsed and stored as UTF-8.

The query console can be complicated since it is goes through layers and is
friendly in its output.

You can check the data by getting dumping out the xml to disk and
inspecting via whatever you might use for that.  Just use xdmp:save.  Then
you know how things are in the db.

Then, if you are going through an appserver, just do the request and store
the result.  Again, check things out on disk.  Look at the headers returned
and the payload.  Is the returned 'stuff' OK in an XML editor?

If that's OK, then what is parsing the return and choking, and why is it
choking?
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Any easy way to set xml version and encoding?

2017-02-02 Thread Christopher Hamlin
There's some info on controlling serialization here:
https://help.marklogic.com/knowledgebase/article/View/328/0/xml-serialization-and-output-options

/ch

On Thu, Feb 2, 2017 at 1:45 PM, Kari Cowan  wrote:

> I have a query the returns an RSS output implementation with some custom
> nodes.
>
>
>
> I need to insert  ahead of the  version..> declaration.
>
>
>
> I found this article from 2009 but wanted to check if there was another
> way or newer simpler approach I could do directly in the xQuery.  Any ideas?
>
> http://markmail.org/message/kwu24lbcdrt2dcim
>
>
>
>
>
> let $rss:=
>
> http://purl.org/dc/elements/1.1/"; xmlns:media="http://search.
> yahoo.com/mrss/" xmlns:content="http://purl.org/rss/1.0/modules/content/";
> xmlns:atom="http://www.w3.org/2005/Atom"; xmlns:sailthru="http://www.
> sailthru.com/rss-extension">
>
>   
>
> {$title}
>
> {$desc}
>
> 
>
> {$output}
>
> 
>
>
>
> Returns:
>
> *[1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error,
> unexpected Version_*
>
> 67.
> 68. let $rss:=
> 69. http://purl.org/dc/elements/1.1/"; xmlns:media="http://search.
> yahoo.com/mrss/" xmlns:content="http://purl.org/rss/1.0/modules/content/";
> xmlns:atom="http://www.w3.org/2005/Atom"; xmlns:sailthru="http://www.
> sailthru.com/rss-extension">
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MLCP export crashing with SEC-ROLEDNE

2016-12-08 Thread Christopher Hamlin
Hi,

This is more of a guess than a suggestion.  Let's call it a suggestive
guess.

It looks like export-to-archive copies permissions.  I'm not sure what
would happen if you had a permission (which has a role-id) and the role
with that id got removed.  Maybe the above?

- Chris

On Thu, Dec 8, 2016 at 6:39 PM, Will Thompson 
wrote:

> I am trying to export data from a Windows machine into an archive to be
> imported into a Mac, but MLCP crashes. The error MLCP returns is nearly 250
> lines, but this part seemed possibly relevant:
>
> "...Caused by: com.marklogic.xcc.exceptions.XQueryException: SEC-ROLEDNE:
> (err:FOER) Role does not exist: sec:role-id = 6626745612256060316
>  [Session: user=wthompson, cb=#17033682864837852147 [ContentSource:
> user=wthompson, cb={none} [provider: address=localhost/127.0.0.1:10003,
> pool=4/64]]] [Client: XCC/8.0-1, Server: XDBC/8.0-6]
> in /MarkLogic/security.xqy, on line 960..."
>
> The MLCP command is:
>
> mlcp.bat export
>   -host localhost -port 10003 -username wthompson -password *
>   -output_type archive -output_file_path /some/output/path
> -directory_filter /some/dir/
>
> This is on ML 8.0-6 with the latest MLCP binaries. Any suggestions?
>
> -Will
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Range indexes of document properties

2016-11-14 Thread Christopher Hamlin
On Mon, Nov 14, 2016 at 1:50 PM, Fox, David  wrote:

> Hello,
>
>
>
> I am working with a database of text documents. I have extracted some
> structured metadata from these documents and added these values as document
> properties, e.g.:
>
>
>
> http://marklogic.com/xdmp/property";>
> 2011-07-06T12:45:55.7887784
> 
>
>
>
> I wanted to add an element range index for this property, which the
> documentation says is possible even for document properties. So, via the
> admin interface I created an element range index:
>

...


>
> Any idea what  I might have missed?
>

Namespace uri looks like:  http://marklogic.com/xdmp/property

You can also use cts:values for debugging such stuff (to see what values
went in, if any).

Not sure about the bonus question.

/ch
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Issue with special charecters in MarkLogic

2016-10-05 Thread Christopher Hamlin
I'm not sure how you know what the saved version looks like in MarkLogic.

But seeing as how you are using Plane-1 characters, I think you will need
to check each step carefully to understand what's going wrong.  I did a
couple simple (non-Java) checks and didn't see a problem with such text in
MarkLogic.



On Wed, Oct 5, 2016 at 8:50 AM, Erik Hennum 
wrote:

> Hi, Vinod:
>
> If you read the character stream as UTF-8 in Java, you shouldn't need to
> do anything special on either the client or server.
>
> Are you using the MarkLogic Java Client API?  The Java API knows the
> server encodes as UTF-8 and defaults to reading as UTF-8.
>
> The only other question that occurs to me is whether the code that's
> writing the content might be double encoding.
>
>
> Hoping that helps,
>
>
> Erik Hennum
>
>
> --
> *From:* general-boun...@developer.marklogic.com [
> general-boun...@developer.marklogic.com] on behalf of
> thangella.vinodre...@cognizant.com [thangella.vinodre...@cognizant.com]
> *Sent:* Wednesday, October 05, 2016 3:23 AM
> *To:* general@developer.marklogic.com
> *Subject:* [MarkLogic Dev General] Issue with special charecters in
> MarkLogic
>
> Hi All,
>
>
>
> We are facing an issue with special characters involved in mathematical
> expressions such as “ *write **𝘢**(**𝘹**)/**𝘣**(**𝘹**) in the form* “
> which has  italic characters (*𝘢**(**𝘹**)/**𝘣**(**𝘹**)*). In
> MarkLogic these are stored as UTF-8 encoded values as “*write
> 𝘢(𝘹)/𝘣(𝘹) in the form*”. In Java
> application When we are retrieving data from MarkLogic DB ,these special
> characters are being received  as “ *write **ݘ¢(**ݘ¹)/**ݘ£(**ݘ¹) in the
> form*” .  These are being corrupted by the time we received them in Java
> layer.
>
>
>
> We tried many options from Java side to receive content as UTF-8 encoded,
> but did not resolved the issue. Can anyone please suggest a way to  resolve
> this kind of issues from MarkLogic side.
>
>
>
>
>
> Thanks,
>
> Vinod.
>
>
>
>
>
>
>
>
>
>
>
>
> This e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. If you are not the intended recipient(s), please reply to the
> sender and destroy all copies of the original message. Any unauthorized
> review, use, disclosure, dissemination, forwarding, printing or copying of
> this email, and/or any action taken in reliance on the contents of this
> e-mail is strictly prohibited and may be unlawful. Where permitted by
> applicable law, this e-mail and other e-mail communications sent to and
> from Cognizant e-mail addresses may be monitored.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MLCP - Unrecognized argument error

2016-08-29 Thread Christopher Hamlin
>From https://docs.marklogic.com/guide/mlcp/export#id_66898 it looks like
that xquery is meant to just create the serialized query as you used on the
command line.

Options files are probably easier when you get to all these characters that
need quoting on the command line.

The example at that document says that an options file should contain the
following two lines:


-query_filter
http://marklogic.com/cts
">/id/xyz.xml


If you try just that for your file does it work?

You can also enable debugging as

https://docs.marklogic.com/guide/mlcp/troubleshoot#id_75840

to show the parameters it runs with.



On Mon, Aug 29, 2016 at 4:30 PM, Mahitha T U  wrote:

> Hi ,
>
> I am using mlcp to copy an xml from Database to local system. I am using
> the following command
>
> mlcp.sh export -host localhost -port 8000 -username admin -password admin
> -mode local -database testDB -collection_filter test -query_filter
> "http://marklogic.com/cts\
> ">/id/xyz.xml" -output_file_path
> output
>
> I am getting the following error
>
>  Unrecognized argument: xmlns:cts=\'http://marklogic.com/cts\
> '>/id/xyz.xml
>
> I created an xqy file
> let $query := /id/xyz.xml
> let $q := xdmp:quote(
>   {$query}/*,
>   no
> )
> return $q
>
> And ran the following command
> mlcp.sh export -host localhost -port 8000 -username admin -password admin
> -mode local -database testDB -collection_filter test -options_file
> query.xqy -output_file_path output
>
> But got the following error
>  ERROR contentpump.ContentPump: Unrecognized argument: let $query :=
> /id/xyz.xml
>
> Please help me resolve this issue.
>
> Thanks
> Mahitha
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] root collation vs unicode collation in terms of performance

2016-08-23 Thread Christopher Hamlin
The old email from Mary explains more than I would know.

My takeaway, take it for what it's worth, is:

Use the correct collation for your 'text' indexes; use codepoint for
'value' indexes like UIDs and such.

You won't be worrying about whether your UID has diacritics, or whether it
sorts according to German or French rules (I'm guessing).

My experience is that codepoint is faster, but it will be a question of
what you do and what your indexes are.

If the indexes are small, or you only ever get the first value, it may not
matter (unless they grow . . .).

If you have huge indexes across many nodes and do things that require
sorting/unique-ifying then it can matter.

For something like a UUID, for example, it sounds like codepoint is the way
to go.

A little discussion here:

https://docs.marklogic.com/guide/search-dev/encodings_collations#id_70034

If you have data, you can test for your situation to see.


On Tue, Aug 23, 2016 at 11:46 AM, Tim Meagher  wrote:

> Just wondering why MarkLogic does not make codepoint the default collation
> if it results in a 10% performance improvement…
>
>
>
> Tim
>
>
>
> *From:* general-boun...@developer.marklogic.com [mailto:general-bounces@
> developer.marklogic.com] *On Behalf Of *Yalaverthi, Sudheer (LNG-RDU)
> *Sent:* Tuesday, August 23, 2016 11:27 AM
> *To:* MarkLogic Developer Discussion 
> *Subject:* Re: [MarkLogic Dev General] root collation vs unicode
> collation in terms of performance
>
>
>
> Hi,
>
>
>
> If anyone can share their experiences or knowledge in terms of which one
> works better in terms of performance, it will be very helpful.
>
>
>
> Thanks.
>
>
>
> -Sudheer
>
>
>
> *From:* general-boun...@developer.marklogic.com [mailto:general-bounces@
> developer.marklogic.com ] *On
> Behalf Of *Yalaverthi, Sudheer (LNG-RDU)
> *Sent:* Monday, August 22, 2016 2:31 PM
> *To:* MarkLogic Developer Discussion 
> *Subject:* [MarkLogic Dev General] root collation vs unicode collation in
> terms of performance
>
>
>
> Hi,
>
>
>
>
>
> In one of older developer community threads here
> ,
> I have found this statement from Mary.
>
>
>
> “If you are not collapsing values, the codepoint collation
>
> is generally about 10% faster in its operations.”
>
>
>
>
>
> We have few elements for which we need range indexes but these elements do
> not have any diacritic sensitive information and they just store GUIDs or
> similar sort of values. I was initially thinking of using root collation
> indexes for this. But after reading the above thread, it made me wonder if
> I have to be using codepoint collation for better performance. Since these
> elements do not have diacritic sensitive information anyway, I wonder if
> root collation performance will be in par with codepoint.
>
>
>
> Let me know which one is better in this scenario.
>
>
>
>
>
> Thanks,
>
> Sudheer
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Query

2016-08-11 Thread Christopher Hamlin
You don't say whether you are working inside MarkLogic or outside.

If outside, one way is mlcp:

https://docs.marklogic.com/guide/mlcp/import#id_28344

On Thu, Aug 11, 2016 at 2:49 AM, Prajakta Katekar <
prajakta.kate...@bhumati.in> wrote:

> How can I store json file which is present in my local directory into
> Mark Logic Database
>
> --
> Thanks & Regards,
> Prajakta
>
> Prajakta Katekar
> Bhumati Consultancy Services
> www.bhumati.com
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Fwd: Fail over - Replica setup issue

2016-07-26 Thread Christopher Hamlin
For approach 1:

The cluster needs a quorum:

https://help.marklogic.com/knowledgebase/article/View/119/0/start-up-quorum-and-forest-level-failover


Approach 2:

This looks more like DR.  Failover will not be automatic.  However, if the
replica cluster is running before the master goes down, then it should
continue to run.


The documentation for these is good.

For failover (keep the main cluster highly available), see

http://docs.marklogic.com/guide/cluster

For DR (keep another cluster ready), see

http://docs.marklogic.com/guide/database-replication




On Tue, Jul 26, 2016 at 6:28 PM, Vinayagamoorthy, Kalidoss <
kalidoss.vinayagamoor...@dowjones.com> wrote:

>
> Hi,
>
> Good Evening!!!
>
> Looking for some help to setup forest replica in a best way to setup
> Disaster Recovery environment. Two approaches have been tried out. Please
> find below the scenarios I have tried and the issues are found against my
> expectations.
>
>
> *Approach #1 - Same Cluster*
>
> Currently,  the cluster has 3 hosts in testing environment.  The DB is
> split into 3 forests as follows.
>
>- DB-F1 (host1)
>- DB-F2 (host2)
>- DB-F3 (host3)
>
> *DB-F1's* replica setup in host 2&3
>
>
>- DB-F4-F1(host2)
>- DB-F5-F1(host3)
>
>
>
> *DB-F2's* replica setup in host 1&3
>
>-  DB-F6-F2(host1)
>-  DB-F7-F2(host3)
>
>
> *DB-F3's* replica setup in host 1&2
>
>
>- DB-F8-F3(host1)
>- DB-F9-F3(host2)
>
>
>
> Later we introduced one more host "4" for Disaster Recovery . All split
> forests from host 1,2 & 3 are replicated in host-4 as follows.
>
> DB-F10-F1 - Replica for *DB-F1*
> DB-F11-F2 - Replica for *DB-F2*
> DB-F12-F3 - Replica for *DB-F3*
>
>
> *Test scenario:*
>
>   Hosts - 1,2 & 3 are down. Only Host-4 is up. And App service(HTTP)
> should work.
>
>
> *Expectation:*
>
>  Host-4 alone is able to handle the data.
>
> *Issues:*
>
>- The fail over his not happened to host-4.
>- Admin page in Host-4 couldn't be loaded.
>- HTTP-API in Host-4 doesn't seem working.
>
>
>
> *Approach #2 - Two Clusters*
>
> In this way, I have created 2 clusters.
>
>- Cluster #1 has Host 1,2 &3.
>- Cluster #2 has Host 4
>
>
> *Test scenario:*
>
>In cluster #1  all hosts are down
>
> *Expectation:*
>
>  Host-4 in cluster #2 alone is able to handle the data. And App
> service(HTTP) should work.
>
> *Issue:*
>
>
>- The fail over is not happened to cluster #2.
>- HTTP-API in Host-4 doesn't seem working.
>
>
>
> Based on my testing both approaches were failed. Looking for the
> suggestion to setup the fail over model in correct way.
>
>
> Thanks
> Kalidoss.V
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Issues installing ML 8.0-5.5 on CentOS

2016-07-22 Thread Christopher Hamlin
Hello,

There are some package requirements are noted in the Installation Guide:

http://docs.marklogic.com/guide/installation/intro#id_63469

/ch

On Fri, Jul 22, 2016 at 5:25 PM, Jain, Anuj  wrote:

> Tried to install ML 8.0-5.5 (ML RHEL/ CentOS, Version 7 from
> http://developer.marklogic.com/products) on my CentOS box (CentOS 6.6 )
> but getting errors.  Tried both yum and rpm to install.  Would appreciate
> any pointers
>
> >yum install MarkLogic-RHEL7-8.0-5.5.x86_64.rpm
>
> Loaded plugins: fastestmirror, security
>
> Setting up Install Process
>
> Examining MarkLogic-RHEL7-8.0-5.5.x86_64.rpm: MarkLogic-8.0-5.5.x86_64
>
> Marking MarkLogic-RHEL7-8.0-5.5.x86_64.rpm to be installed
>
> Loading mirror speeds from cached hostfile
>
> Resolving Dependencies
>
> --> Running transaction check
>
> ---> Package MarkLogic.x86_64 0:8.0-5.5 will be installed
>
> --> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package:
> MarkLogic-8.0-5.5.x86_64
>
> --> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for
> package: MarkLogic-8.0-5.5.x86_64
>
> --> Processing Dependency: libc.so.6(GLIBC_2.14) for package:
> MarkLogic-8.0-5.5.x86_64
>
> --> Processing Dependency: libsasl2.so.3()(64bit) for package:
> MarkLogic-8.0-5.5.x86_64
>
> --> Finished Dependency Resolution
>
> *Error: Package: MarkLogic-8.0-5.5.x86_64
> (/MarkLogic-RHEL7-8.0-5.5.x86_64)*
>
> *   Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)*
>
> *Error: Package: MarkLogic-8.0-5.5.x86_64
> (/MarkLogic-RHEL7-8.0-5.5.x86_64)*
>
> *   Requires: libc.so.6(GLIBC_2.14)(64bit)*
>
> *Error: Package: MarkLogic-8.0-5.5.x86_64
> (/MarkLogic-RHEL7-8.0-5.5.x86_64)*
>
> *   Requires: libc.so.6(GLIBC_2.14)*
>
> *Error: Package: MarkLogic-8.0-5.5.x86_64
> (/MarkLogic-RHEL7-8.0-5.5.x86_64)*
>
> *   Requires: libsasl2.so.3()(64bit)*
>
>  You could try using --skip-broken to work around the problem
>
>  You could try running: rpm -Va --nofiles --nodigest
>
>
>
> rpm -i MarkLogic-RHEL7-8.0-5.5.x86_64.rpm
>
> *error: Failed dependencies:*
>
> *libc.so.6(GLIBC_2.14)(64bit) is needed by MarkLogic-8.0-5.5.x86_64*
>
> *libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by
> MarkLogic-8.0-5.5.x86_64*
>
> *libsasl2.so.3()(64bit) is needed by MarkLogic-8.0-5.5.x86_64*
>
> *libc.so.6(GLIBC_2.14) is needed by MarkLogic-8.0-5.5.x86_64*
>
>
> AJ
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Speeding up access to large XML file

2016-06-23 Thread Christopher Hamlin
Hi Hans,

There is caching of indexes and documents, but not all information is in
memory at all times.

There is a lot of documentation, and it's very good.  But the single best
place to start is with the overall paper

https://developer.marklogic.com/inside-marklogic

It is pretty technical and covers a lot of ground, including some details
on indexing.  I would start with that then ask any follow-on questions that
arise.

= Chris


On Thu, Jun 23, 2016 at 9:11 AM, Hans Hübner 
wrote:

> Chris,
>
> thank you for your input.  I must admit that I'm still very new to
> MarkLogic and my general understanding of what I can and can't expect is
> still lacking.
>
> On Thu, Jun 23, 2016 at 2:45 PM, Christopher Hamlin 
> wrote:
>
>> To get the information in your example, the system is pulling the
>> document into memory from disk, expanding it (into the expanded tree cache)
>> and extracting per your xpath.  It actually seems pretty fast considering
>> all that.  But it is possible to speed things up.
>>
>
> I - probably wrongly - expected that MarkLogic would make it (very)
> efficient to navigate to some random element in the XML file when enough
> indexing information is present to locate it.  It was thus my naive hope
> that I could load a large XML document into the database, have ML index it
> and then quickly access arbitrary subtrees.  Now, what you seem to say is
> that the document is loaded and expanded every time that it is accessed.
>
> I'll try to figure things out by reading more, but I'm a bit overwhelmed
> by the amount of documentation that is provided.  Maybe I really need a
> consultant to set my expectations straight.  Not sure if this is the proper
> place to ask for one?
>
> Thanks for your help anyway!
> Hans
>
>
> --
> LambdaWerk GmbH
> Oranienburger Straße 87/89
> 10178 Berlin
> Phone: +49 30 555 7335 0
> Fax: +49 30 555 7335 99
>
> HRB 169991 B Amtsgericht Charlottenburg
> USt-ID: DE301399951
> Geschäftsführer:  Hans Hübner
>
> http://lambdawerk.com/
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Speeding up access to large XML file

2016-06-23 Thread Christopher Hamlin
Hi,

>From what I understand, there really isn't an issue with querying in what
you are doing, since you are calling for a part of particular document, at
least in your given example.  If you are querying more generally, it's a
different question, and then query optimization comes into play.

The Universal Index helps with lookups for queries, but doesn't contain
data to be returned from the documents.  For that you need a range index.

To get the information in your example, the system is pulling the document
into memory from disk, expanding it (into the expanded tree cache) and
extracting per your xpath.  It actually seems pretty fast considering all
that.  But it is possible to speed things up.

Since you are using paths deep into large documents, you could try path
range indexes, which would only index what is in that path:

http://docs.marklogic.com/guide/admin/range_index#id_40666

This way, you are just returning what is in that index, and the document
doesn't need to be opened at all.  Just call for the values and constrain
by the document-query as, for example,

cts:values (cts:path-reference ('/x/y/z'), (), (),
cts:document-query("file1.xml"))

The document query takes care of the constraint to a particular fragment,
so no other queries are needed.

Usual Disclaimer:  adding indexes takes space and indexing time,
everything's a tradeoff.

Also, a little info regarding the use of text():
https://blakeley.com/blogofile/archives/518/

=Chris

On Thu, Jun 23, 2016 at 12:53 AM, Hans Hübner 
wrote:

> Hi,
>
> I have a beginner's question regarding indexing:  As far as I understand,
> MarkLogic indexes all data according to global indexing rules.  Thus, in
> general, all accesses to data should be "fast" when the universal index can
> be used.
>
> I am trying to combine data from two XML files into a report, and
> throughput is not sufficient.  I'm now looking for ways to improve the
> performance of my XQuery, either by adding indexes to MarkLogic or by
> improving the query so that it runs faster.  Here's what I have:
>
> for $key in doc("file1.xml")/a/b/c/d/e/f/g/h/i[j = 123]/k/text()
> let $data-from-file-2 := doc("file2.xml")/a/b[c/d = $key]/e/f/text()
> return
>   
>$key => $data-from-file-2
>   
>
> Thus, I'm iterating over some subset of the nodes in file1.xml, selecting
> data from file2.xml for each of the nodes selected.  Both file1.xml and
> file2.xml are in a files residing in MarkLogic.  They have a pre-determined
> format and contain roughly 100,000 elements matching each of the two paths.
>
> It seems that the performance of the second of the two XPaths
> (doc("file2.xml")/a/b[c/d = $key]/e/f/text()) is most important.  Ideally,
> I would like this lookup to complete in under a millisecond, but it seems
> to need 75ms right now.
>
> Any help speeding this up would be greatly appreciated!
>
> Thanks,
> Hans
>
> --
> LambdaWerk GmbH
> Oranienburger Straße 87/89
> 10178 Berlin
> Phone: +49 30 555 7335 0
> Fax: +49 30 555 7335 99
>
> HRB 169991 B Amtsgericht Charlottenburg
> USt-ID: DE301399951
> Geschäftsführer:  Hans Hübner
>
> http://lambdawerk.com/
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] running xquery with large result

2016-06-17 Thread Christopher Hamlin
You can try REST search:

http://docs.marklogic.com/guide/rest-dev/search

Or if you are after something more general:

http://docs.marklogic.com/REST/POST/v1/eval


On Fri, Jun 17, 2016 at 9:15 AM, Paul M  wrote:

> What would be best alternative to qconsole when running a large xquery?
> Outside of browser, preferable curl command, or something in a shell.
>
> Thanks so much,
> Paul
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Marklogic Issue with Ligature

2016-06-09 Thread Christopher Hamlin
On Thu, Jun 9, 2016 at 12:48 AM, Mohapatra, Amrita (LNG-CON) <
amrita.mohapa...@lexisnexis.com> wrote:
> ... So my question was is it a Marklogic issue to give persona for
cts:stem('personae', 'en') or its an expected scenario. ...

Your application isn't clear to me, but according to my English dictionary
that stemming looks correct:

personae *noun pl.* see persona

(Shorter Oxford English Dictionary, Fifth Edition)
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Marklogic Issue with Ligature

2016-06-09 Thread Christopher Hamlin
On Thu, Jun 9, 2016 at 4:08 AM, Pande, Kiran C  wrote:
> This sounds an issue with Unicode character set support with “personae” and
> “personæ” being different.
>

Shouldn't they be different at the character level?  The Unicode chart
at http://www.unicode.org/charts/PDF/U0080.pdf doesn't show any
equivalent for

æ - 00E6 - LATIN SMALL LETTER AE

That being case, this looks like a language-level question.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Marklogic Issue with Ligature

2016-06-08 Thread Christopher Hamlin
Hi,

Are you sure everything is being done in French?

I just tested and

cts:stem ('personae', 'en'),
cts:stem ('personae', 'fr')

gives

persona
personae

=ch

On Mon, Jun 6, 2016 at 2:14 AM, Mohapatra, Amrita (LNG-CON)
 wrote:
>
>
> HI,
>
>
>
> I am currently working on some French enhancement. In that for French
> Ligature “AE” (æ) since Marklogic did not recognized this as ligature (that
> is both ae and æ will be treated as same words)  I added manually the
> equivalent words (containing æ) in my dictionary files. But now when I am
> searching for search term “personae” and “personæ” I should get same
> results. But I am getting different. On checking with my codebase I found
> the issue is with cts:stem (). When I am doing cts:stem personæ I am getting
> result as “persona”. As a result of which my result count is not coming as
> expected. Can anybody tell me the reason as why for personae I am getting
> stemmed word as persona? How to solve this issue?
>
>
>
> Example: cts:stem(“personæ”)
>
> Result : persona
>
>
>
> Thanks & Regards,
>
> Amrita
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Regarding compilation of schema for validation.

2016-05-10 Thread Christopher Hamlin
Hello,

I haven't used Schematron in a while, but when I did, the final xslt
was created using

http://www.schematron.com/implementation.html

Regards,
Christopher Hamlin


On Tue, May 10, 2016 at 6:57 AM, shabana khan  wrote:
> Hi Erik,
>
> Thanks for your input.
>
> The requirement is like we need to do 2-step validation :
> 1. Validation against the schema which we have in place.
> 2. Validation against the schematron.
>
> Currently it is being validated against the schema but it is not checking
> for the schematron part present in the schema file. So, we are planning to
> compile it into xslt and then validate the document.
>
> Thanks and Regards,
> Shabana Khan
> LinkedIn
>
>
>
>
> On Tue, May 10, 2016 at 1:14 AM, Erik Hennum 
> wrote:
>>
>> Hi, Shabana:
>>
>> > We need to compile our XSD file into XSLT so that we can use a compiled
>> > version for validation
>>
>> Is there a reason you can't use the MarkLogic builtin support for
>> validating a document
>> against an XSD?
>>
>> If you insert an XML Schema into the schema database for your content
>> database and
>> restart the server, you should be able to validate documents against the
>> schema using
>> either an XQuery validate expression:
>>
>> https://www.w3.org/TR/xquery-30/#id-validate
>>
>> or the MarkLogic validate function:
>>
>> http://docs.marklogic.com/xdmp:validate
>>
>> The builtin validation will almost certainly be faster than an XSLT
>> invocation.
>>
>> The other question is whether your Schematron compiler supports compiling
>> an XSD.
>>
>>
>> Hoping that helps,
>>
>>
>> Erik Hennum
>>
>>
>> 
>> From: general-boun...@developer.marklogic.com
>> [general-boun...@developer.marklogic.com] on behalf of shabana khan
>> [shabana.0...@gmail.com]
>> Sent: Monday, May 09, 2016 7:18 AM
>> To: General@developer.marklogic.com
>> Subject: [MarkLogic Dev General] Regarding compilation of schema for
>> validation.
>>
>> Hi All,
>>
>> We need to compile our XSD file into XSLT so that we can use a compiled
>> version for validation
>> When we use sch:compile-schema($schematron) and give schematron as input
>> it successfully generates the XSLT.
>> But we have as input an XSD which comprises both schematron part and
>> schema part like we do have pattern elements and schema elements as well.
>> We are getting errors :
>> sc:compile-schema($schematron) -- Invalid coercion
>>
>> Can anyone give suggestion regarding this.
>>
>>
>>
>>
>>
>>
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Replicas not getting reindexed

2016-04-25 Thread Christopher Hamlin
Hi,

Changes should be made to the settings on the replica first.  There is
an explanation here:

http://docs.marklogic.com/guide/concepts/backup-replication#id_27654

=ch

On Mon, Apr 25, 2016 at 4:53 AM, Ankit Bhardwaj
 wrote:
> Hi,
>
>
>
> I have to change few index settings on the production environment.
>
> While testing it, I changed the settings on “Master” first. As expected,
> indexing started automatically. After that I changed the index settings on
> replica with an expectation that indexing will start. But it does not
> started. I also tried manually triggering the re-indexing (from MarkLogic
> Admin Console) but it didn’t start.
>
> I have got good amount of data (around 500,000 documents) in my database.
> So, it can’t be the case that re-indexing happened and I didn’t noticed. I
> also checked the logs. They also haven’t got anything.
>
>
>
> Can you please suggest that what is going wrong here? Why I am not able to
> trigger re-indexing on replica?
>
>
>
> Thanks,
>
> Ankit Bhardwaj
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Platform migration - Win to OSx

2016-04-07 Thread Christopher Hamlin
Hi Rich,

"The backup files are platform specific--backups on a given platform
should only be restored onto the same platform."  So says:

http://docs.marklogic.com/guide/admin/backup_restore#id_pgfId-1042443


=ch

On Thu, Apr 7, 2016 at 1:38 PM, Richard Davies  wrote:
> Afternoon all,
>
> I am trying to migrate a MarkLogic database from Windows to OS x, and was
> wondering if anyone knew if it was possible! I know that for clustering that
> MarkLogic requires the clusters to be the same architecture (as per the
> reference documents online), but cannot find anything definitive in regards
> to exporting/restoring backups!
>
> When i did a backup / restore I got the following error:
>
> Operation failed with error message: XDMP-LABELBADPLATFORM:
> xdmp:database-restore((xs:unsignedLong("14800671169375660052"),
> xs:unsignedLong("11217911940037168149"),
> xs:unsignedLong("17896408292347543721")),
> "/Users/richard/Downloads/backup-productdemo-content/20160407-142352...",
> (), fn:false(), (), fn:false(), ()) -- Bad platform in label: winnt instead
> of macosx in
> /Users/richard/Downloads/backup-productdemo-content/20160407-142352051/Forests/productdemo-content-001-1/Label.
> Check server logs.
>
> This was on OSx, but did get the same error on Linux.
>
> Any advice would be greatly appreciated
>
> Cheers
> Rich
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Exporting Xquery files using MLCP

2016-03-31 Thread Christopher Hamlin
I'm not sure why it would do that.  A quick test I would try, if you
can live with UTF-8 documents, is to remove the content_encoding
specification.

On Thu, Mar 31, 2016 at 3:28 PM, Danny Sinang  wrote:
> Hi,
>
> Has anyone here tried to export Xquery files from the Modules database using
> MLCP ?
>
> We tried the config below, but the files generated had numbers at the start
> and end
>
>
> 014392
> xquery version "1.0-ml";
>
> module namespace cds="http://www.company.org/cds";;
>
> [2:04]
> cds:replace-subject-id-with-value($updated-xpaths, $updated-doc)
>else
>  $updated-doc
> };
> 20
>
>
> If MLCP can't do this properly, can anyone suggest another way to
> programmatically extract the said files ?
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xquery streaming

2016-03-08 Thread Christopher Hamlin
I know of a little info about that here:

http://blakeley.com/blogofile/2012/03/19/let-free-style-and-streaming/

On Tue, Mar 8, 2016 at 10:21 AM, Faktorovich, Yuriy
 wrote:
> Is it possible to stream back the result using xquery without the document
> being loaded into memory on ML?
>
>
>
> Thank You,
>
>
>
> Yuriy
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] XDMP-ENTITYREF: (err:XPST0003) Invalid entity reference "Psm#"

2016-03-07 Thread Christopher Hamlin
Looks to me like you are constructing xml with & in the text.  Try
changing & to & and see if that is better.

Then, similarly, if you have < in the text change it to < so it
doesn't look like start of a tag.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MarkLogic Currency Symbol support

2016-03-04 Thread Christopher Hamlin
UTF-8 is default, and probably what you want if you have a choice.

https://docs.marklogic.com/guide/mlcp/import#id_23879 shows an option

-content_encoding

in case you have text in some other encoding.

On Fri, Mar 4, 2016 at 4:24 PM, David Sewell  wrote:
> You almost certainly want your text file to use UTF-8 encoding. See
> https://docs.marklogic.com/fn:unparsed-text .
>
> On Fri, 4 Mar 2016, abhishek.srivas...@cognizant.com wrote:
>
>> Hi All
>>
>> My requirement is to receive currency symbol like euro, South Sudan pound in 
>> flat file and move it to MarkLogic (as xml document) using MLCP. Please let 
>> me know what character format should we use in flat file so that MarkLogic 
>> can store exact currency symbol.
>>
>> Thanks
>> Abhishek
>> This e-mail and any files transmitted with it are for the sole use of the 
>> intended recipient(s) and may contain confidential and privileged 
>> information. If you are not the intended recipient(s), please reply to the 
>> sender and destroy all copies of the original message. Any unauthorized 
>> review, use, disclosure, dissemination, forwarding, printing or copying of 
>> this email, and/or any action taken in reliance on the contents of this 
>> e-mail is strictly prohibited and may be unlawful. Where permitted by 
>> applicable law, this e-mail and other e-mail communications sent to and from 
>> Cognizant e-mail addresses may be monitored.
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>
> --
> David Sewell, Editorial and Technical Manager
> ROTUNDA, The University of Virginia Press
> PO Box 400318, Charlottesville, VA 22904-4314 USA
> Email: dsew...@virginia.edu   Tel: +1 434 924 9973
> Web: http://rotunda.upress.virginia.edu/
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] [1.0-ml] XDMP-UNDFUN: (err:XPST0017) Undefined function temporal:axis-create()

2016-02-25 Thread Christopher Hamlin
Try removing the semicolons after each temporal call and see if it goes
further.  Those are statement separators, so the imports aren't seen.

https://docs.marklogic.com/guide/xquery/enhanced#id_41212

On Thu, Feb 25, 2016 at 4:13 PM, Gaël YIMEN YIMGA 
wrote:

> Hello All,
>
> Any update on this 
>
> Gaël.
> --
> Eng, OCADB, CCAH
> yimeng...@gmail.com
> skype id : yimen.gael
> (m) +33 7 81 67 78 23
> http://yimengael.blogspot.fr/
>
> 2016-02-24 17:24 GMT+01:00 Gaël YIMEN YIMGA :
>
>> Hello all,
>>
>> I'm using Marklogic version 8 on Windows 8. I would like to create a
>> temporal collection to insert in Marklogic temporal documents. The XQuery
>> template i used is the following:
>>
>> ===
>> xquery version "1.0-ml";
>> import module namespace temporal="http://marklogic.com/xdmp/temporal"; at
>> "/MarkLogic/temporal.xqy";
>> (: import module namespace temporal="http://marklogic.com/xdmp/temporal";
>> at "C:/Program Files/MarkLogic/Modules/MarkLogic/temporal.xqy"; :)
>> (: temporal:axis-remove("system"); :)
>> (: temporal:axis-remove("valid"); :)
>> temporal:axis-create("system",
>> cts:element-reference(xs:QName("systemStart")),
>> cts:element-reference(xs:QName("systemEnd")));
>> temporal:axis-create("valid",
>> cts:element-reference(xs:QName("validStart")),
>> cts:element-reference(xs:QName("validEnd")));
>> temporal:collection-create("bitemporal", "system", "valid");
>> ===
>>
>> After trying many changes, I'm still facing the following error :
>> Undefined function temporal:axis-create.
>>
>> [image: Images intégrées 1]
>> Thanks in advance for your help.
>>
>> Gaël.
>> --
>>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] cts:contains in marklogic 5.0.3

2016-02-19 Thread Christopher Hamlin
Hi,

Since it is simple text matching, can't you just use a combination of
fn:not, fn:contains, fn:matches in the predicate?

=ch

On Fri, Feb 19, 2016 at 12:25 AM, Kapoor, Pragya 
wrote:

>
> But then how is this working on MarkLogic 7?
>
> Thanks
> Pragya
>
> --
> *From:* general-boun...@developer.marklogic.com <
> general-boun...@developer.marklogic.com> on behalf of Brent Hartwig <
> bhart...@rsicms.com>
> *Sent:* Thursday, February 18, 2016 5:39 PM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] cts:contains in marklogic 5.0.3
>
>
> Hi, Pragya,
>
>
>
> cts:uri-match() returns string identifiers to the documents, as opposed to
> the documents themselves.
>
>
>
> You may want something more along the lines of cts:search().
>
>
>
> -Brent
>
> Solutions Architect @ RSI
>
> Skype: brent.hartwig
>
> Mobile: 517.945.2132
>
>
>
> *From:* general-boun...@developer.marklogic.com [mailto:
> general-boun...@developer.marklogic.com] *On Behalf Of *Kapoor, Pragya
> *Sent:* Thursday, February 18, 2016 7:01 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* [MarkLogic Dev General] cts:contains in marklogic 5.0.3
>
>
>
> Hi,
>
>
>
> I am running below query in MarkLogic 5.0.3 and getting error while its
> running on MarkLogic 7.0
>
>
>
> let $node :=
> cts:uri-match("/docs/*.xml")[cts:contains(.,cts:not-query("COL"))][1 to 10]
>
> return $node
>
>
>
> Error:
>
> [1.0-ml] XDMP-ARGTYPE: (err:XPTY0004)
> cts:contains("/docs/002-000-001-ISDA-COL-_2005-05-17_17-28-33-...",
> cts:not-query(cts:word-query("COL", ("lang=en"), 1), 1)) -- arg1 is not of
> type node()*
>
>
>
> Stack Trace
>
> At line 1 column 43:
>
>
>
> 1. let $node :=
> cts:uri-match("/docs/*.xml")[cts:contains(.,cts:not-query("COL"))][1 to 10]
>
> 2. return $node
>
> 3.
>
>
>
>
>
> "This e-mail and any attachments transmitted with it are for the sole use
> of the intended recipient(s) and may contain confidential , proprietary or
> privileged information. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message. Any unauthorized review, use, disclosure, dissemination,
> forwarding, printing or copying of this e-mail or any action taken in
> reliance on this e-mail is strictly prohibited and may be unlawful."
> "This e-mail and any attachments transmitted with it are for the sole use
> of the intended recipient(s) and may contain confidential , proprietary or
> privileged information. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message. Any unauthorized review, use, disclosure, dissemination,
> forwarding, printing or copying of this e-mail or any action taken in
> reliance on this e-mail is strictly prohibited and may be unlawful."
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xdmp:node-replace

2016-02-08 Thread Christopher Hamlin
I'd check that such a node exists:

fn:doc(...)/calendar/approval_status

It looks like you are missing the namespace on the element steps.

On Mon, Feb 8, 2016 at 8:37 PM, Kari Cowan  wrote:

> I have used this node-replace statement on other types of records and it
> works fine, but it doesn’t work for these, and it doesn’t return an error.
> Any idea what silly error have I made?
>
>
>
>
>
> xquery version "1.0-ml";
>
> declare namespace ec = "http://www.alm.com/event-calendar";;
>
>
>
> xdmp:node-replace(doc("/data-sources/editorial-calendar/TheDrivetoThrive:CRECinderellaStories6321741.xml")/calendar/approval_status,
> true);
>
> >> *your query returned an empty sequence*
>
>
>
>
> record node example:
>
>
>
> http://www.alm.com/event-calendar";>
>
> The Drive to Thrive: CRE Cinderella Stories
>
> 
> /data-sources/editorial-calendar/TheDrivetoThrive:CRECinderellaStories6321741.xml
> 
>
> false
>
>
>
> … et cetera…
>
>
>
> --
> Learn more about ALM, visit http://www.alm.com . – ALM, an Integrated
> Media Company, is a leading provider of news and information for the legal
> and commercial real estate markets. ALM’s market-leading brands include The
> American Lawyer, Corporate Counsel, GlobeSt.com, Insight Conferences,
> Law.com, Law Journal Press, LegalTech, The National Law Journal and Real
> Estate Forum.
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Dynamically Create View Based On Indexes

2016-02-02 Thread Christopher Hamlin
On Tue, Feb 2, 2016 at 10:55 AM, Ashley Peacock 
wrote:

> Hey,
>
>
>
> I have the basic idea of how to achieve creating a view based on the
> current indexes on a field, I just can’t tie all the pieces together so
> hoping someone can help!
>
>
>
> When calling admin:database-get-range-element-indexes() it returns a bunch
> of XML defining the indexes. I want to loop through each index, retrieve
> some values (the XML looks something like:
>
>
>
> 2016-02-02 14:14:28.322 Info: TaskServer: http://www.w3.org/2001/XMLSchema-instance"; xmlns="
> http://marklogic.com/xdmp/database";>
>
> 2016-02-02 14:14:28.322 Info: TaskServer:   int
>
> 2016-02-02 14:14:28.322 Info: TaskServer:   
>
> 2016-02-02 14:14:28.322 Info: TaskServer:   
>
> 2016-02-02 14:14:28.322 Info: TaskServer:
> localname
>
> 2016-02-02 14:14:28.322 Info: TaskServer:
> true
>
> 2016-02-02 14:14:28.322 Info: TaskServer:
> ignore
>
> 2016-02-02 14:14:28.322 Info: TaskServer: 
>
>
>
> And store then in a sequence. I’ve tried the below to no luck, as my
> XQuery is not the strongest.
>
>
>
> Let $seq := ()
>
> For $i in
> admin:database-get-range-element-indexes(admin:get-configuration(),
> xdmp:database(‘myDatabase’))
>
> Return fn:insert-before($seq, 0,
> view:column($i/range-element-index/localname,
> $i/range-element-index/localname)
>
>
>
> But that doesn’t seem to work (there’s no error, it just doesn’t “do”
> anything).
>
>
>
The insert-before is returning a new sequence each time, so not what you
expect (doesn't change $seq). You aren't using the namespace for the index
elements either, so wouldn't be finding anything.

Something like the below is probably closer.  It gets the
namespace/localname, tokenizes since you can have more than one, removes a
hyphen since that's not allowed in a view column name.  Did sort-of work on
the simplistic basic db I tested on, but may be more complications.

xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"; at
"/MarkLogic/admin.xqy";
import module namespace view = "http://marklogic.com/xdmp/view"; at
"/MarkLogic/views.xqy";
declare namespace db = 'http://marklogic.com/xdmp/database';
let $config := admin:get-configuration()
let $seq :=
  for $i in
admin:database-get-range-element-indexes(admin:get-configuration(),
xdmp:database('Documents'))
  let $namespace-uri := $i/db:namespace-uri/fn:string()
  for $localname in fn:tokenize ($i/db:localname/fn:string(), '[ ,]+')
  let $col-name := fn:replace ($localname, '-', '')
  let $col := view:column($col-name, cts:element-reference (fn:QName
($namespace-uri, $localname)))
  return $col
return $seq

It looks like it gives what you want, though I didn't use the results at
all.

Also, if JS is more natural, you can use that instead.

=ch
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] declare XML namespace

2016-01-28 Thread Christopher Hamlin
On Thu, Jan 28, 2016 at 9:31 AM, Florent Georges  wrote:

> Hi,
>
> This is the XML declaration, not an XML namespace declaration.  It is
> not part of XDM, and cannot be part of a literal XML in XQuery.  If
> you need to include it when you send the document to the outside
> world, you need to look at the serialisation options of the interface
> you use (something like "omit-xml-declaration=false".)
>

For example, it's an output option on the app-server level.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MLCP input query

2016-01-24 Thread Christopher Hamlin
It looks to me like you are sending in a search, not a query.

So maybe try

-query_filter cts:directory-query("/Default/samplestack/rest-api/options/"
,"infinity")

instead.


On Sun, Jan 24, 2016 at 7:22 PM, Prasanth N V R 
wrote:

> Hi,
>
> I am trying to copy documents from one DB to another DB using MLCP.
>
> Here is my command(running in Windows)
> mlcp.bat copy -input_host localhost -input_port 5767 -input_username admin
> -input_password admin ^
> -output_host localhost -output_port 5767 -output_username admin
> -output_password admin ^
> -input_database samplestack-modules ^
> -output_database Documents ^
> -query_filter
> cts:search(doc(),cts:directory-query("/Default/samplestack/rest-api/options/","infinity"))
>
> But am getting error when i execute the above command.
> ERROR mapreduce.MarkLogicInputFormat:
> com.marklogic.xcc.exceptions.XQueryException: XDMP-DOCROOTTEXT:
> xdmp:unquote("cts:search(doc(),cts:directory-query(/Default/samplestack/rest-a...")
> -- Invalid root text
> "cts:search(doc(),cts:directory-query(/Default/samplestack/rest-api/options/,infinity))"
> at  line 1
>  [Session: user=admin, cb=samplestack-modules [ContentSource: user=admin,
> cb=samplestack-modules
>
>
> How can I pass a query in command line to select matching documents?
>
> Thanks,
> Prasanth
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] rebalance enable

2016-01-20 Thread Christopher Hamlin
Hi,


Note, very fine doc for general info:
http://docs.marklogic.com/guide/admin/database-rebalancing

It's probably good to figure out why it is trying to rebalance after a
restore.  If you are restoring then you have the same forests.

One guess to check:  is the assignment policy the same on both systems?

But, especially:

http://docs.marklogic.com/guide/admin/database-rebalancing#id_63044

=ch


On Wed, Jan 20, 2016 at 1:16 AM, Aroul, Pavadai Durai (ELS-CON) <
aro...@elsevier.com> wrote:

> Hi All,
>
>
>
> I would like to know more about rebalancer enable flag. I am actually in
> the process of creating a parallel environment by taking a backup in
> original environment and restore in parallel environment.
>
>
>
> When I do this restore, if rebalance enable is set to true, it
> automatically starts the rebalancing process which has an estimated time of
> about 30-40 hours. This is also affecting the Marklogic performance.
>
>
>
> What is the purpose of this flag? Is it going to hurt anything if I turn
> off this flag on a permanent basis? I would like to know if there is an
> impact if I turn off this flag on permanent basis.
>
>
>
>
>
>
>
>
>
> *ebalancer enable*
>
> truefalse
> Enable automatic rebalancing after configuration changes.
>
>
>
>
>
>
>
> Thanks,
>
> Durai.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Listing all graphs

2016-01-11 Thread Christopher Hamlin
Hi,

Sorry that I don't know of such a call in xquery, though there is this:
http://docs.marklogic.com/7.0/REST/GET/v1/graphs.

If you see Javascript methods, then you are probably looking at the v8
docs.  There's a selector in the upper left for version.

/ch

On Mon, Jan 11, 2016 at 10:38 AM, Ignacio Tripodi <
itrip...@catalystsecure.com> wrote:

> Hi, is there a way to list all current triple graphs in MarkLogic 7, using
> the XQuery API? I only saw an API method for the Javascript interface, but
> no obvious way to do this in XQuery.
>
> The reason for this is that I created a series of test triples under
> different graphs in a development cluster, and I'd like to make sure I've
> deleted all of them. So, an alternative question would be: is there a way
> to delete all triples entered from all graphs in a cluster?
>
> Thanks,
>
> -i
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Xqsync through NumberFormatException

2015-12-19 Thread Christopher Hamlin
It's a known bug in XCC that can come up when you run against a test build
of MarkLogic.

There is a fix coming, but it's not yet released.

It happens when the version number is checked, but it doesn't match the
official release format.


On Sat, Dec 19, 2015 at 4:02 AM, Jonna Marry  wrote:

> Hi ,
>
> I am executing Xqsync script in ML to copy doc from one DB to another DB.
> Same script is working in another ML box without any changes in script.
> Could you please help us in resolving this issue.
>
> *Working in ML*
>
> MarkLogic Server
>
> Enterprise Edition
>
> 7.0-5.4
>
> *Not Working in ML*
>
> MarkLogic Server
>
> Enterprise Edition
>
> 7.0-5_20151214
>
> XQSync starting: version 2011-11-14.0 on 1.6.0_04 (Java(TM) SE Runtime
> Environment)
> 2015-12-19 04:00:46.475 INFO: XCC version = 5.0-2
> 2015-12-19 04:00:46.500 INFO: starting pool of 8 threads, queue size =
> 10
> 2015-12-19 04:00:46.515 INFO: starting
> 2015-12-19 04:00:46.597 SEVERE: fatal error
> *java.lang.NumberFormatException: For input string: "5_20151214"*
> at java.lang.NumberFormatException.forInputString(Unknown Source)
> at java.lang.Integer.parseInt(Unknown Source)
> at java.lang.Integer.parseInt(Unknown Source)
> at
> com.marklogic.xcc.impl.CBMetaDataImpl.refreshServerVersion(CBMetaDataImpl.java:170)
> at
> com.marklogic.xcc.impl.CBMetaDataImpl.getServerVersionString(CBMetaDataImpl.java:122)
> at
> com.marklogic.ps.xqsync.XQSyncManager.run(XQSyncManager.java:167)
> at com.marklogic.ps.xqsync.XQSync.main(XQSync.java:81)
> 2015-12-19 04:00:46.600 INFO: halting queue
>
> Regards,
> Jonna.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Fields Not Showing In View Due To Non-Existant Field?

2015-12-09 Thread Christopher Hamlin
On Wed, Dec 9, 2015 at 8:30 AM, Ashley Peacock 
wrote:

> Hey,
>
>
>
> How do you mark the column as nullable? I assume the option is tied to the
> element range index, but I can’t see an option to set it as nullable.
>
>
>
>
>
It's when you create the column for the view, not something directly
related to the index itself.

There's an example in this subsection:

http://docs.marklogic.com/guide/sql/creating-views#id_85598
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Fields Not Showing In View Due To Non-Existant Field?

2015-12-09 Thread Christopher Hamlin
Is the d column marked as nullable?

On Wed, Dec 9, 2015 at 8:23 AM, Ashley Peacock 
wrote:

> Hey,
>
>
>
> Let’s say I have a view that shows 4 columns (a, b, c, d). If I insert two
> documents:
>
>
>
> 
> 1
>
> 2
> 3
>
> 4
>
> 
>
>
>
> AND
>
>
>
> 
> 1
>
> 2
> 3
>
> 
>
>
>
> The first document will show in the view, however the second will not as
> it does not contain the  element which seems to mean it no longer shows
> in the view. Is there any way around this? As not all of my documents
> contain the same elements, yet I still want them to show in the view (and
> just show blank/NULL etc. for the missing fields).
>
>
>
> Thanks,
>
>
>
> Ashley
>
>
>
>
>
> *Ashley Peacock*
>
> Developer II
> Elevate Credit International Limited
> P: 01284 717800 | Ext: 877 |  Elevate.co.uk 
> Amadeus House, Floral Street, Covent Garden, London WC2E 9DP
>
>
>
> Privileged and Confidential. This e-mail, and any attachments thereto, is
> intended only for use by the addressee(s) named herein and may contain
> privileged and/or confidential information. If you have received this
> e-mail in error, please notify me immediately by a return e-mail and delete
> this e-mail. You are hereby notified that any dissemination, distribution
> or copying of this e-mail and/or any attachments thereto, is strictly
> prohibited.
>
> Elevate Credit International Limited is registered in England & Wales with
> Company Number 05041905. Registered Office: 27-28 Eastcastle Street,
> London, W1W 8DH
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Christopher Hamlin
json:transform-to-json is returning a document node.  fn:concat takes a
bunch of things and casts them to xs:string.  fn:string-join takes strings
specifically.

So two possibilities:

1.  You need to change the docs to strings before doing string-join.

2.  Make sure the strings are in a sequence, not "loose" like for fn:concat.

/ch

On Tue, Nov 17, 2015 at 12:30 PM, Kari Cowan  wrote:

> fn:string-join - I thought about that – tried it but it didn’t join each
> with the comma – it also didn’t give me any error.  That would have been
> the simplest had it worked; wouldn’t need the if statement at all.   I
> thought perhaps it’s not really a string, but documents that are
> transformed to JSON from XML? (not sure, that’s still going to return as a
> string I think).  Any idea why fn:string-join didn’t work?
>
>
>
> So I tried the counter idea Gert suggested – this seems to work, as long
> as the ordering is ‘descending’ – if I switch it to ascending, it gets
> quirky – Is it using the native state not what I set?
>
>
>
> let $outputJSON:=("{"events":[",
>
> let $config := json:config("full"),
>
> $cx := map:put( $config, "whitespace", "ignore" )
>
> let $count:= fn:count($search-this-partner/event)
>
> for $events at $counter in $search-this-partner/event
>
>  order by $events/EventStartDate/@date descending
>
>   return if( $count > $counter ) then
>
>( fn:concat(json:transform-to-json( fn:doc($events/doc-uri), $config ),
> ","),"count: ", $count, "counter: ", $counter )
>
> else
>
>   ( json:transform-to-json( fn:doc($events/doc-uri), $config ), "else
> count: ", $count, "else counter: ", $counter),
>
> "]}")
>
>
>
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] $counter < i -- I might be overthinking this

2015-11-17 Thread Christopher Hamlin
Can fn:string-join help?  Join with ',', and glue on whatever you like
before or after?

On Mon, Nov 16, 2015 at 11:30 PM, Kari Cowan  wrote:

> Is there any built-in component I can reference that would indicate in the
> loop below where $counter is less than the last item in the loop?
>
>
>
> This would print the json for the return only when $counter=1, is simple
> way to know when $counter < LastItem?
>
>
>
> let $outputJSON:=("{"events":[",
>
> let $config := json:config("full"),
>
> $cx := map:put( $config, "whitespace", "ignore" )
>
> for $events at $counter in $search-this-partner/event
>
> order by $events/EventStartDate/@date ascending
>
>   return if($search-this-partner/event[$counter=1]) then
>
> fn:concat(json:transform-to-json( fn:doc($events/doc-uri), $config ),
> ",")
>
> else
>
> "foo",
>
> "]}")
>
>
>
> >>
>
> {"events":[
>
> foo
>
> Event object
>
> foo
>
> ]}
>
> --
> Learn more about ALM, visit http://www.alm.com . – ALM, an Integrated
> Media Company, is a leading provider of news and information for the legal
> and commercial real estate markets. ALM’s market-leading brands include The
> American Lawyer, Corporate Counsel, GlobeSt.com, Insight Conferences,
> Law.com, Law Journal Press, LegalTech, The National Law Journal and Real
> Estate Forum.
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] problems with verify-cert option in xdmp:http-get()

2015-11-03 Thread Christopher Hamlin
Does it work if you go to some other, well-known site?  For example,
https://mail.google.com/ or https://help.marklogic.com/?  If I go to those
it works for me (8.0-3.2).

Who signed the certificate at the endpoint?  Is that CA in the list at
Configure > Security > Certificate Authorities?  If not, then MarkLogic has
no reason to trust the certificate.  You can import a new CA if need be.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Problem with verifying SSL certificates

2015-10-28 Thread Christopher Hamlin
On Wed, Oct 28, 2015 at 12:40 PM, Short, Brendan  wrote:

> Hello all,
>
> I’m attempting to make an API call using xdml:http-get and having a
> problem with the SSL certificate verification. Here’s the code I’m using:
>
> *let* *$accountInfo* := *xdmp:http-get*(*$baseURI*,
>  
>
>  username
>  password
>
>true
>  )
>
> And here’s the error message I get:
>
> System ID: /Users/bshort/Documents/Digital objects/api
> testing/get_account_test.xquery
> Severity: error
> Description: SVC-SOCCONN: xdmp:http-get("
> https://api-publisher.mirror-image.com:443/v5/
> ",  xmlns="xdmp:http"> method="basic">nejm) -- Socket
> connect error: SSL_connect 172.16.12.139:52345-104.131.189.21:443:
> certificate verify failed (0x14090086)
> Start location: 13:0
>

Maybe obvious, but:

Does ML have the needed CA info to trust the received cert?
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Splitting XML files

2015-10-26 Thread Christopher Hamlin
Hello,

I tried looking at your input file.  It appears that you have nested Tx
elements.  According to

https://docs.marklogic.com/guide/ingestion/content-pump#id_65814

the element should only occur at one level.  It doesn't say what happens if
you have nested roots, but that could be the problem.

Regards,
Christopher Hamlin
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Transactions mgmt in REST API (ML 8.0-3)

2015-10-21 Thread Christopher Hamlin
This worked for me on v8:

curl -i -H 'Content-Type: text/plain' -d '' -X POST --anyauth --user
admin:admin http://localhost:8000/v1/transactions

Can you retry with -i?

On Wed, Oct 21, 2015 at 12:40 PM, Gilles Lenfant  wrote:

> Hi,
>
> Experimenting the transactions does not work for me as described in
> http://docs.marklogic.com/REST/POST/v1/transactions in my dev server.
>
> curl -X POST -d "" --anyauth --user admin:admin
> http://localhost:8000/v1/transactions
>
> yields this JSON response...
>
> {"errorResponse":{"statusCode":500, "status":"Internal Server Error",
> "messageCode":"INTERNAL ERROR", "message":"XDMP-AS: (err:XPTY0004)
> $txid as xs:unsignedLong -- Invalid coercion: () as xs:unsignedLong .
> See the MarkLogic server error log for further detail."}}
>
> This suggests that a "txid" should be provided when this REST query is
> supposed to provide a new "txid".
>
> Did I miss something ? Many thanks in advance for any hint !
>
> --
> Gilles Lenfant
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid connection information. - cqsh with ML7 on Amazon Linux

2015-10-08 Thread Christopher Hamlin
Haven't used it, but there is also:

https://developer.marklogic.com/code/ml-gradle
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] XDQP version mismatch between local cluster and foreign cluster

2015-10-08 Thread Christopher Hamlin
Given that you said you have 7.0-5.2, and looking at

2015-10-08 15:12:59.907 Warning: XDQPServerConnection::init(10.
245.79.90:7998-10.245.79.92:35041): XDMP-XDQPVER: XDQP version mismatch:
hostname,7000502 10.245.79.92,8000200

It sort of looks like 7.0-5.2 is trying to talk to 8.0-2.  Are you sure
about both ends being 7.0-5.2?



On Thu, Oct 8, 2015 at 10:18 AM, Sudheer Yalaverthi <
sudheer.yalaver...@db.com> wrote:

> Hi,
>
>
>
>
>
> I have since instance of primary and single instance of replica. I am
> trying to couple these two cluster but I am seeing  XDQP version mismatch
> error.
>
> I have 7.0-5.2 on the RHEL environment.
>
>
>
> Both MarkLogic versions match but I am still receiving this error. Based
> on ML documentation, I should be seeing this error only when I different
> versions of ML but that is not the case here.
>
> Any thoughts?
>
>
>
>
>
>
>
> 2015-10-08 15:12:59.907 Warning:
> XDQPServerConnection::init(10.245.79.90:7998-10.245.79.92:35041):
> XDMP-XDQPVER: XDQP version mismatch: hostname,7000502 10.245.79.92,8000200
>
> 2015-10-08 15:12:59.934 Warning:
> XDQPServerConnection::init(10.245.79.90:7998-10.245.79.92:35042):
> XDMP-XDQPVER: XDQP version mismatch: hostname,7000502 10.245.79.92,8000200
>
> 2015-10-08 15:13:00.908 Warning:
> XDQPServerConnection::init(10.245.79.90:7998-10.245.79.92:35043):
> XDMP-XDQPVER: XDQP version mismatch: hostname,7000502 10.245.79.92,8000200
>
> 2015-10-08 15:13:00.909 Warning:
> XDQPServerConnection::init(10.245.79.90:7998-10.245.79.92:35044):
> XDMP-XDQPVER: XDQP version mismatch: hostname,7000502 10.245.79.92,8000200
>
> 2015-10-08 15:13:01.907 Warning:
> XDQPServerConnection::init(10.245.79.90:7998-10.245.79.92:35045):
> XDMP-XDQPVER: XDQP version mismatch: hostname,7000502 10.245.79.92,8000200
>
> 2015-10-08 15:13:01.908 Warning:
> XDQPServerConnection::init(10.245.79.90:7998-10.245.79.92:35046):
> XDMP-XDQPVER: XDQP version mismatch: hostname,7000502 10.245.79.92,8000200
>
>
>
>
>
>
>
>
>
> Regards,
>
> Sudheer
>
>
>
>
> ---
> This communication may contain confidential and/or privileged information.
> If you are not the intended recipient (or have received this communication
> in error) please notify the sender immediately and destroy this
> communication. Any unauthorized copying, disclosure or distribution of the
> material in this communication is strictly forbidden.
>
> Deutsche Bank does not render legal or tax advice, and the information
> contained in this communication should not be regarded as such.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Best way to detect mutating operations?

2015-09-15 Thread Christopher Hamlin
In situations such as these, I find it useful to log what is happening with
an expression like

xdmp:log(fn:concat ("position #1: xact (", xdmp:transaction(), "), mode (",
xdmp:get-transaction-mode(), "), ts (",xdmp:request-timestamp(),")")),

This will log the current transaction number, the transaction mode, and the
request timestamp (or empty for query statements).


/ch

On Tue, Sep 15, 2015 at 3:31 PM, Ignacio Tripodi <
itrip...@catalystsecure.com> wrote:

> Besides the obvious code analysis by simple inspection (which can prove
> less than simple on large, complex systems), is there a reliable way to
> tell if a request to MarkLogic produced an XQuery mutating operation
> anywhere during the lifetime of that request? I'm interested to analyze if
> a particular request would be causing a document update somewhere or not.
> I'm looking at lock rates in the monitoring charts, for example, but
> they're just rates and not linked to a particular request.
> Thanks for any insight you could provide,
>
> -i
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MarkLogic7 restore fails using web dashboard

2015-09-04 Thread Christopher Hamlin
Yes, sorry, it's been expanded so much in v8, vs v7.  And you have 7
right in the subject . . .

Probably for regular operational stuff most people set up scheduled backups.

I haven't done back-up/restore specifically with xquery, but I'd
expect that it would be good for most any repeatable process.




On Thu, Sep 3, 2015 at 5:15 PM, Gulik, Ernest  wrote:
> Thank you for your response,
> This is first time I'm doing migration for ML7 product.
> Management API seems to be directed more towards ML8, is that true? Will this 
> work only with version 8?
> Due to licensing we can only migrate from v7 to v7.
>
> After digging through documentation it seems like xquery scripting is best 
> option for setting up automated backups and later restoration.
> Do you have any experience with writing any xquery scripting for backups and 
> doing restore from these backups?
> I'm wondering if I would come up with a script and use it to backup current 
> environment and restore everything in new environment I'll be at home.
> Do you have any thoughts on that?
>
> Thank you,
> Ernest G.
>
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher 
> Hamlin
> Sent: Thursday, September 03, 2015 1:21 PM
> To: MarkLogic Developer Discussion 
> Subject: Re: [MarkLogic Dev General] MarkLogic7 restore fails using web 
> dashboard
>
> I guess it's a subjective question mostly.  I don't think there is any 
> one-click solution that you are missing.
>
> If it's a one-off, you can just fix things up and get them going.  I happen 
> to do a lot of this one-off stuff, so not that experienced in building config 
> stuff, but on any project that lasts, it's nice to have something scripted.  
> Do you put in the work up front, to get something easier to use and for sure 
> repeatable?
>
> There are various ways of setting things up, including xqy scripts and Roxy.
>
> Something else to note is that the REST management API has been expanded a 
> lot:
>
> http://www.marklogic.com/what-is-marklogic/whats-new/management-api/
>
> I think samplestack at
>
> http://www.marklogic.com/what-is-marklogic/whats-new/samplestack/
>
> has a couple configurations built with gradle and with JS that might be worth 
> looking at.
>
>
>
>
> On Wed, Sep 2, 2015 at 10:49 AM, Gulik, Ernest  wrote:
>> Thank you for quick response,
>> I started to think that this is part of the problem because custom forests 
>> that were created on the old server have additional "-1" after import and 
>> there are no forests with such id that is in error.
>> If this is not the best way to backup/restore databases (schemas, forests, 
>> etc) then what is the recommended way?
>> Documentation shows a way for backing up and restoring using xquery 
>> scripting but this process seems a lot more complex than simple 
>> export/import.
>>
>>
>> Thank you,
>> Ernest Gulik
>>
>> -Original Message-
>> From: general-boun...@developer.marklogic.com
>> [mailto:general-boun...@developer.marklogic.com] On Behalf Of
>> Christopher Hamlin
>> Sent: Tuesday, September 01, 2015 5:56 PM
>> To: MarkLogic Developer Discussion 
>> Subject: Re: [MarkLogic Dev General] MarkLogic7 restore fails using
>> web dashboard
>>
>> First I would check that the forest names on the new db match those on the 
>> original.
>>
>> I don't think configuration manager takes care of creating forests that 
>> match exactly.
>>
>> On Tue, Sep 1, 2015 at 5:41 PM, Gulik, Ernest  wrote:
>>> Hello all,
>>>
>>> I’m trying to setup ML on another server by restoring from server
>>> backup but have hard time doing that here’s what I did and issue that
>>> I can’t figure it out. I hope someone can help me.
>>>
>>> I exported settings using configuration manager which created .zip package.
>>>
>>> I imported that .zip package on new host, restarted ML service.
>>>
>>> Logged into ML dashboard (8001) and navigated to Configure->
>>> Databases
>>> ->App-Services ->Backup/Restore tab,
>>>
>>> Pointed “Restore from directory” to
>>> ‘/var/opt/MarkLogic/testrestore/20150626-2008442705860’ (where I
>>> copied my data - 3.9GB).
>>>
>>> After starting restore process I get this message and logs are not
>>> really helpful because there’s nothing in there about 
>>> ‘13467990979117581242’:
>>>
>>>
>>>
>>> Operati

Re: [MarkLogic Dev General] MarkLogic7 restore fails using web dashboard

2015-09-03 Thread Christopher Hamlin
I guess it's a subjective question mostly.  I don't think there is any
one-click solution that you are missing.

If it's a one-off, you can just fix things up and get them going.  I
happen to do a lot of this one-off stuff, so not that experienced in
building config stuff, but on any project that lasts, it's nice to
have something scripted.  Do you put in the work up front, to get
something easier to use and for sure repeatable?

There are various ways of setting things up, including xqy scripts and Roxy.

Something else to note is that the REST management API has been expanded a lot:

http://www.marklogic.com/what-is-marklogic/whats-new/management-api/

I think samplestack at

http://www.marklogic.com/what-is-marklogic/whats-new/samplestack/

has a couple configurations built with gradle and with JS that might
be worth looking at.




On Wed, Sep 2, 2015 at 10:49 AM, Gulik, Ernest  wrote:
> Thank you for quick response,
> I started to think that this is part of the problem because custom forests 
> that were created on the old server have additional "-1" after import and 
> there are no forests with such id that is in error.
> If this is not the best way to backup/restore databases (schemas, forests, 
> etc) then what is the recommended way?
> Documentation shows a way for backing up and restoring using xquery scripting 
> but this process seems a lot more complex than simple export/import.
>
>
> Thank you,
> Ernest Gulik
>
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher 
> Hamlin
> Sent: Tuesday, September 01, 2015 5:56 PM
> To: MarkLogic Developer Discussion 
> Subject: Re: [MarkLogic Dev General] MarkLogic7 restore fails using web 
> dashboard
>
> First I would check that the forest names on the new db match those on the 
> original.
>
> I don't think configuration manager takes care of creating forests that match 
> exactly.
>
> On Tue, Sep 1, 2015 at 5:41 PM, Gulik, Ernest  wrote:
>> Hello all,
>>
>> I’m trying to setup ML on another server by restoring from server
>> backup but have hard time doing that here’s what I did and issue that
>> I can’t figure it out. I hope someone can help me.
>>
>> I exported settings using configuration manager which created .zip package.
>>
>> I imported that .zip package on new host, restarted ML service.
>>
>> Logged into ML dashboard (8001) and navigated to Configure-> Databases
>> ->App-Services ->Backup/Restore tab,
>>
>> Pointed “Restore from directory” to
>> ‘/var/opt/MarkLogic/testrestore/20150626-2008442705860’ (where I
>> copied my data - 3.9GB).
>>
>> After starting restore process I get this message and logs are not
>> really helpful because there’s nothing in there about ‘13467990979117581242’:
>>
>>
>>
>> Operation failed with error message: XDMP-NOFOREST:
>> xdmp:database-restore(xs:unsignedLong("13467990979117581242"),
>> "/var/opt/MarkLogic/testrestore/20150626-2008442705860", (),
>> fn:false(), ())
>> -- No forest with identifier 13467990979117581242. Check server logs.
>>
>>
>>
>> Did someone encountered such error or can point me somewhere on how to
>> solve that issue?
>>
>>
>>
>> Thank you,
>>
>> Ernest G.
>>
>>
>>
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MarkLogic7 restore fails using web dashboard

2015-09-01 Thread Christopher Hamlin
First I would check that the forest names on the new db match those on
the original.

I don't think configuration manager takes care of creating forests
that match exactly.

On Tue, Sep 1, 2015 at 5:41 PM, Gulik, Ernest  wrote:
> Hello all,
>
> I’m trying to setup ML on another server by restoring from server backup but
> have hard time doing that here’s what I did and issue that I can’t figure it
> out. I hope someone can help me.
>
> I exported settings using configuration manager which created .zip package.
>
> I imported that .zip package on new host, restarted ML service.
>
> Logged into ML dashboard (8001) and navigated to Configure-> Databases
> ->App-Services ->Backup/Restore tab,
>
> Pointed “Restore from directory” to
> ‘/var/opt/MarkLogic/testrestore/20150626-2008442705860’ (where I copied my
> data - 3.9GB).
>
> After starting restore process I get this message and logs are not really
> helpful because there’s nothing in there about ‘13467990979117581242’:
>
>
>
> Operation failed with error message: XDMP-NOFOREST:
> xdmp:database-restore(xs:unsignedLong("13467990979117581242"),
> "/var/opt/MarkLogic/testrestore/20150626-2008442705860", (), fn:false(), ())
> -- No forest with identifier 13467990979117581242. Check server logs.
>
>
>
> Did someone encountered such error or can point me somewhere on how to solve
> that issue?
>
>
>
> Thank you,
>
> Ernest G.
>
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to trobleshoot Linux Installation

2015-08-26 Thread Christopher Hamlin
Some ideas to start:

Can you get to the port if you log on to the machine itself (test with
telnet locally)?

Can you check to see if/what is listening on 8001 (maybe 'lsof -i :8000')?

Take a look at the MarkLogic access log for 8001 to see if it is
getting your requests (default on Linux:
/var/opt/MarkLogic/Logs/8001_AccessLog.txt).


On Wed, Aug 26, 2015 at 10:27 AM, Joshi, Vipan  wrote:
> I am getting “Page not found” from my local browser when hit linuxserver
> port 8001. I can ping that server from my local desktop.
>
>
>
> I have installed Marklogic and it’s dependent rpm(s).
>
> I started the marklogic and sent the  ErrorLog.txt in first email.
>
> Please guide me how to troubleshoot this.
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Error while trying to load a XML to a ML Server from network

2015-08-12 Thread Christopher Hamlin
If I understand correctly, you are trying to load a file from computer A,
into MarkLogic which is running on computer B.

If so, I would recommend using mlcp on computer A, and sending it to
MarkLogic on computer B.

You can use port 8000 on computer B, with the database parameter:

https://docs.marklogic.com/guide/ingestion/content-pump#id_69447
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Sorting and De-duping

2015-07-31 Thread Christopher Hamlin
Huh.  I guess I didn't understand what you wanted after all.  I
thought you were ordering by an attribute originally and you wanted to
keep them in order of first appearance, not just alphabetize.

And it doesn't seem right that distinct-values should care what the return does.

Anyway, glad it's working.

Regarding maps, there's the doc, and a blog post, which should pretty
much cover the subject:

http://docs.marklogic.com/guide/app-dev/hashtable

https://developer.marklogic.com/blog/im-a-map

On Fri, Jul 31, 2015 at 12:32 PM, Kari Cowan  wrote:
> If you're curious, this was the final working version of the snippet.  The 
> distinct-values function was giving me an error until I cast the return as a 
> string.
>
> Thanks for the tips.  Is there a tutorial for map:map or just RTFN?
>
>
> xquery version "1.0-ml";
> declare namespace ec = "http://www.alm.com/event-calendar";;
>
> let $directory:="/data-sources/editorial-calendar/"
> let $future-calendar-docs:=
> cts:search(
>   xdmp:directory($directory),
>   cts:and-query((
> cts:element-attribute-range-query(xs:QName("ec:MaterialsDueDate"), 
> xs:QName("date"), ">=", xs:date(fn:current-date()) ),
> cts:element-query(xs:QName("ec:approval_status"),cts:word-query("true"))
>   ))
> )
>
> for $audience in fn:distinct-values($future-calendar-docs//ec:audience)
> order by $audience
> return xs:string($audience)
>
>
>
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Kari Cowan
> Sent: Thursday, July 30, 2015 1:59 PM
> To: MarkLogic Developer Discussion 
> Subject: Re: [MarkLogic Dev General] Sorting and De-duping
>
> Thanks.  I haven't worked with the map function yet.  I was trying to use 
> distinct-values in the for loop, but get an error that my value isn't a node 
> (which is true)
>
> for $audience in xs:string(fn:distinct-values($these-docs//ec:audience))
> order by $audience
> return $audience/fn:string()
>
>>> [1.0-ml] XDMP-NOTANODE: (err:XPTY0019) $audience/fn:string(.) --
>>> "Automotive" is not a node
>
> How would I map this a cts search?
>
> xquery version "1.0-ml";
> declare namespace ec = "http://www.alm.com/event-calendar";;
> let $directory:="/data-sources/editorial-calendar/"
> let $these-docs:=
> cts:search(
>   xdmp:directory($directory),
>   cts:and-query((
> cts:element-attribute-range-query(xs:QName("ec:MaterialsDueDate"), 
> xs:QName("date"), ">=", xs:date(fn:current-date()) ),
> cts:element-query(xs:QName("ec:approval_status"),cts:word-query("true"))
>   ))
> )
>
> for $audience in $these-docs//ec:audience order by $audience  return 
> $audience/fn:string()
>
>
>
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher 
> Hamlin
> Sent: Thursday, July 30, 2015 12:46 PM
> To: MarkLogic Developer Discussion 
> Subject: Re: [MarkLogic Dev General] Sorting and De-duping
>
> Just to look ahead a little to that next question: fn:distinct-values says 
> "The order in which the sequence of values is returned is implementation 
> dependent."
>
> One way to maintain order is to go through your values in order, only pass 
> the ones that haven't been seen.  map:map is useful for that kind of side 
> effect.
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Sorting and De-duping

2015-07-30 Thread Christopher Hamlin
Just to look ahead a little to that next question: fn:distinct-values
says "The order in which the sequence of values is returned is
implementation dependent."

One way to maintain order is to go through your values in order, only
pass the ones that haven't been seen.  map:map is useful for that kind
of side effect.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Caching of results

2015-07-27 Thread Christopher Hamlin
Hello,

Caching can be explored using xdmp:query-meters:

http://docs.marklogic.com/xdmp:query-meters?q=query-meters&v=8.0&api=true

= Chris

On Mon, Jul 27, 2015 at 9:55 AM, Tyagi, Devesh  wrote:
> Hi,
>
>
> While profiling a query I noticed that first execution gives the total time
> of execution. Subsequent queries result in 0 seconds of time in execution.
> So I am assuming the results are cached for the queries. Can someone point
> out the source where I can find out more about caching.
>
>
> Regards,
>
> Devesh
>
> "This e-mail and any attachments transmitted with it are for the sole use of
> the intended recipient(s) and may contain confidential , proprietary or
> privileged information. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message. Any unauthorized review, use, disclosure, dissemination,
> forwarding, printing or copying of this e-mail or any action taken in
> reliance on this e-mail is strictly prohibited and may be unlawful."
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Where Can I learn MarkLogic Basics

2015-07-19 Thread Christopher Hamlin
On Jul 19, 2015 2:57 AM, "SNEHASISH DUTTA"  wrote:
>
> Hi,
>
> My organization is moving to MarkLogic database and I want to learn from
the scratch.
>
> Please tell me which is the best place to learn.
>

Training is free:

http://www.marklogic.com/training/
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Management API - accessing "property" in 8.0-3

2015-07-17 Thread Christopher Hamlin
Same as Dave.  I got the error, but doc looks like it should work.
Pretty sure I have a clean install.

On Fri, Jul 17, 2015 at 11:42 AM, Dave Cassel  wrote:
> Your URL is consistent with the documentation, including one of the
> examples. I see the same error with 8.0-3. Looks like a bug.
>
> --
> Dave Cassel, @dmcassel
> Technical Community Manager
> MarkLogic Corporation
> http://developer.marklogic.com/
>
>
> From:  on behalf of Anne Taylor
> 
> Reply-To: MarkLogic Developer Discussion 
> Date: Friday, July 17, 2015 at 11:20 AM
> To: "general@developer.marklogic.com" 
> Subject: [MarkLogic Dev General] Management API - accessing "property" in
> 8.0-3
>
> Hi all,
>
>
>
> I’m trying to access some properties through the management API.  If I try
> something like the following against an 8.0-2 server it works:
>
>
>
> http://servername:8002/manage/LATEST/forests/Triggers?view=counts&property=document-count
>
>
>
> but against three different 8.0-3 instances it fails with the error:
>
>
>
> Endpoint does not support query parameter: property
>
>
>
> I’ve tried various different properties and can’t get anything to work, each
> time it doesn’t seem to parse the “property” parameter.  Has the syntax
> changed; has our upgrade failed to fully complete (all three servers were
> upgraded from 8.0-2);  or is something wrong with the request?  Can anyone
> else get this to work against 8.0-3?
>
>
>
> Many thanks,
>
> Anne
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Is a cts:query looking at specific attributes only within the same element possible?

2015-07-15 Thread Christopher Hamlin
Hello,

I believe cts:element-query will constrain as you need.  Then you can
search for the element-attribute values at (or below) that element.
Doc at

https://docs.marklogic.com/cts:element-query

explains it, including needed indexes to avoid possibly excessive filtering.

I find it worthwhile to test with a small set as you show and, say,
query-meters, in order to check on false positives and index settings
(maybe element-attribute needs other position info?).  Also good to
see about indexing space, and performance at scale, and compare vs
other solutions you may consider.

= Chris



On Wed, Jul 15, 2015 at 9:37 AM, Dan Meyers  wrote:
> I feel sure it should be, and I’m just failing to make proper use of the
> system, but I’d appreciate more eyes on this.
>
> Consider the following set of (contrived, simple) documents:
>
> Doc 1:
> 
> 
> 
> 
> 
> 
>
> Doc 2:
> 
> 
> 
> 
> 
> 
>
> Doc 3:
> 
> 
> 
> 
> 
> 
>
> I want to be able to return all those documents which contain at least one
> relationship with id equal to “one” and inherited not equal to “true” (i.e.
> false or not present). So in the above example I’d expect to be returned
> docs 1 and 2. In the real world I’ll be searching across over 100 million
> documents, so I need to be able to do this via indexes and xquery not
> looping over all available documents and examining their content.
>
> With a cts:and-not-query looking for the presence of id as “one” and not
> having inherited as “true” I only get returned doc2. As I understand it,
> this is because the and-not-query is matching inherited equal to “true” in
> the second relationship of doc1 and discarding the entire doc, even though
> that relationship is not for the desired id.
>
> Is there any kind of query (with any necessary indexes) I can construct that
> will do what I want and only pay attention to the inherited field when it is
> within the same relationship element as id?
>
> An alternative we have considered is to create 2 different element types
> within the relationships parent, so that we have relationship, and
> relationship_direct (or whatever), and the query that doesn’t want to count
> inherited relationships looks only at relationship_direct elements, but that
> seems like a hacky method of doing this. We’ve also considered separate
> documents, but because of all the other data held within them and not shown
> in this basic example that would be a massive headache. If it would help, we
> could ensure the inherited attribute was always present, and set to true or
> false as necessary, rather than normally being either true or not present.
>
> How would other people go about doing this? Any ideas would be great. In
> case it matters, and there’s some new MarkLogic 8 function that does this,
> we’re currently on MarkLogic 7 in our live environment. We will be upgrading
> eventually, but not soon enough for us to be able to wait for that before we
> make this query work.
>
> Thanks
>
> Dan
>
>
>
> 
>
> http://www.bbc.co.uk
> This e-mail (and any attachments) is confidential and may contain personal
> views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in reliance
> on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
> -
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] element-word-match

2015-07-13 Thread Christopher Hamlin
On Mon, Jul 13, 2015 at 9:30 AM, Andreas Hubmer
 wrote:
> Hi,
>
>> I think in recent versions of ML it's the case that calling merge won¹t
>> necessarily merge right down to 0 deleted fragments?
> Yes, that seems to be the case. Even long after calling xdmp:merge the
> deleted fragments exist.

It won't normally discard deleted fragments right away:

https://help.marklogic.com/Knowledgebase/Article/View/193/0/unable-to-merge-all-deleted-fragments-on-forest-with-32gb-max-merge-size
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] batch delete

2015-07-10 Thread Christopher Hamlin
Should also mention, the REST management APIs are really good too, as
another option:

http://docs.marklogic.com/REST/management

On Fri, Jul 10, 2015 at 3:15 PM, cyanline llc  wrote:
> Thanks for the reply. I'm looking to delete the forest entirely. I will
> take a look at the resources you provided. Thank you
> On 07/10/2015 03:15 PM, Christopher Hamlin wrote:
>> Sounds like most of what you want would be in the admin api, and can
>> be scripted in XQuery or JavaScript:
>>
>>  http://docs.marklogic.com/guide/admin-api
>>  https://docs.marklogic.com/admin
>>
>> xdmp:forest-clear can clear forest content, if that is what you want.
>>
>> On Fri, Jul 10, 2015 at 3:04 PM, cyanline llc  wrote:
>>> Hello,
>>> Is there a method to batch delete forests? Or DBs, or Servers?
>>>
>>> During developing an app I have amassed a lot of these items and I
>>> think things would run smoother if ML was cleaned up.
>>>
>>> Thank you ahead of time.
>>> ___
>>> General mailing list
>>> General@developer.marklogic.com
>>> Manage your subscription at:
>>> http://developer.marklogic.com/mailman/listinfo/general
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] batch delete

2015-07-10 Thread Christopher Hamlin
Sounds like most of what you want would be in the admin api, and can
be scripted in XQuery or JavaScript:

http://docs.marklogic.com/guide/admin-api
https://docs.marklogic.com/admin

xdmp:forest-clear can clear forest content, if that is what you want.

On Fri, Jul 10, 2015 at 3:04 PM, cyanline llc  wrote:
> Hello,
>Is there a method to batch delete forests? Or DBs, or Servers?
>
>During developing an app I have amassed a lot of these items and I
> think things would run smoother if ML was cleaned up.
>
>Thank you ahead of time.
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xdmp:node-insert-child() throw XDMP-EXPNTREECACHEFULL error

2015-07-07 Thread Christopher Hamlin
Hi,

If you wrap your xpath (or cts:search) in xdmp:estimate you'll see how
many documents you may bring back:

collection('test')/patient/link/visit[@age =
('60岁','61岁','62岁','63岁','64岁','65岁')]

If it's too many for your memory, you can try breaking up the query
into batches.  Just looking at what you have, can you run each of 60岁,
61岁, etc. separately?  Some batch oriented tool like corb2 might help
too.

= Chris

On Mon, Jul 6, 2015 at 11:53 PM, 张晓博  wrote:
> my query is :
> xdmp:node-insert-child(collection('test')/patient/link/visit[@age =
> ('60岁','61岁','62岁','63岁','64岁','65岁')],
>  some string ...);
>
> how to change my query to void the XDMP-EXPNTREECACHEFULL error?
> thanks.
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] rang index for string element

2015-07-03 Thread Christopher Hamlin
Hi,

If you want to search for an element containing a particular string
value, you can use cts:element-value-query, and this requires no extra
indexing.  Element string values are also automatically indexed.
Inside MarkLogic Server is great for overall technical info like this:
 https://developer.marklogic.com/inside-marklogic.

You'd likely use a range index if you want to compare values (less
than, greater than), or return values (all string values for a certain
element), or return counts for values.

And, as Raja says, a more specific question can get a more specific answer.

=Chris

On Fri, Jul 3, 2015 at 9:08 AM, Chunyu Cong  wrote:
> Hello,
>
> I understand Marklogic index words automatically.
> What happens if we add range index for the string element?
>
> Is that never needed?
> Or the range index could speed up searching on string?
>
> Thanks,
> Chunyu
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Mark logic downgrade issue

2015-06-29 Thread Christopher Hamlin
Hi Mohit,

Downgrades are not supported.  More detailed discussion can be found at

https://help.marklogic.com/knowledgebase/article/View/34/0/marklogic-server-version-downgrades-are-not-supported

Regards,
Chris



On Mon, Jun 29, 2015 at 6:45 AM, Agarwal, Mohit ,Crest
 wrote:
> Hi,
> I have downgraded from ML 8 to ML 7.5 on my mac machine.
>
> I am getting the below error after downgrading.
>
> 500: Internal Server Error
> SEC-INVAMP: (rest:rewrite($config:OPTIONS, "uri"),
> xdmp:get-request-url())[1] -- Invalid amp:
> doc(http://marklogic.com/xdmp/amps/1091766101199946196)
> In /rewriter.xqy on line 11
>
> Mohit
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Can anyone tell me why the result of the second xqery is empy?

2015-06-29 Thread Christopher Hamlin
I don't know what the problem is.  But both these work for me:

for $i in collection('coll')/catalog/product/name
where fn:string ($i/../@dept) = 'WMN'
return $i

for $i in collection('coll')/catalog/product/name
let $ok := $i/../@dept = 'WMN'
where $ok
return $i

So some workarounds exist and Geert is filing a bug.

/ch
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Find the document(s) with max occurrences of an element-attribute reference

2015-06-26 Thread Christopher Hamlin
Hi Johan,

Maybe I'm not clear on what you want.

I just tried something.  I created documents in a database using

xquery version "1.0-ml";
for $i in 1 to 100
let $doc := {(1 to $i)!}
let $uri := '/'||$i||'.xml'
return xdmp:document-insert ($uri, $doc)

so for example

/1.xml =>





and

/2.xml =>






and so on.

With a file/@size element-attribute range index, the query

xquery version '1.0-ml';
let $uris := cts:uri-reference()
let $ea := cts:element-attribute-reference (xs:QName ('file'),
xs:QName ('size'),
'collation=http://marklogic.com/collation/codepoint')
return
for $tuple in cts:value-tuples(($uris, $ea),
('item-frequency','frequency-order','descending','limit=3'))
return fn:concat ($tuple[1], ' -> ', cts:frequency ($tuple))

returns

/100.xml -> 100
/99.xml -> 99
/98.xml -> 98
/97.xml -> 97
/96.xml -> 96
/95.xml -> 95
/94.xml -> 94
/93.xml -> 93
/92.xml -> 92
/91.xml -> 91

Is this close to what you want?

Regards,

Chris

On Fri, Jun 26, 2015 at 12:41 PM, Johan Mörén  wrote:
> Hi Christopher!
>
> I'm not sure where you wan't me to use these options. But i tried to add
> them to the cts:value-tuples()  but that did not return the expected result.
>
> like this
>
> ...
> for $tuple in
> cts:value-tuples(
>   (
> cts:uri-reference(),
> $sizeRef
>   ),
>   ("frequency-order","descending","limit=10")
>
> )
> ...
>
> Regards,
> Johan
>
> On Fri, Jun 26, 2015 at 5:58 PM Christopher Hamlin 
> wrote:
>>
>> If you just want something like top ten, I think it's more direct
>> possibly.
>>
>> Can you try returning frequency-order, descending, limit=10? Are those
>> options you can use?
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Find the document(s) with max occurrences of an element-attribute reference

2015-06-26 Thread Christopher Hamlin
If you just want something like top ten, I think it's more direct possibly.

Can you try returning frequency-order, descending, limit=10? Are those
options you can use?
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Generating Reports in ML

2015-06-18 Thread Christopher Hamlin
On Thu, Jun 18, 2015 at 4:55 PM, Kari Cowan  wrote:
> To be clear, I can take a single result and return it into a
> xdmp:document-insert statement – is there a method available to iteratively
> append to that document?
>

You can use the node insert calls as Danny suggested.  But if you do,
beware of multiple changes to the same document giving you
conflicting-updates errors, if you mean to make >1 change to the same
document in the same transaction.  In that case you can just create a
new document in memory with all the changes and reinsert it.  There's
also a library that lets you make changes to in-memory documents.

/ch
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] RAM considerations

2015-06-10 Thread Christopher Hamlin
Also, there is some general info available on the Support help site:

https://help.marklogic.com/knowledgebase/article/View/28/18/adding-ram-to-your-host

/ch

On Tue, Jun 9, 2015 at 7:40 AM, Jakob Fix  wrote:
> thanks Chris and Geert, I'll get in touch with support.
>
> cheers,
> Jakob.
>
> On Tue, Jun 9, 2015 at 10:19 AM, Geert Josten 
> wrote:
>>
>> There might be some db settings you wanna touch as well, but I think it
>> makes sense to reach out to support to guide you through this..
>>
>> Cheers
>>
>> On 6/9/15, 3:57 AM, "Christopher Hamlin"  wrote:
>>
>> >I should clarify:  I'm talking about the group-level cache settings,
>> >and the corresponding Huge Pages allocation.
>> >
>> >/ch
>> >
>> >On Mon, Jun 8, 2015 at 8:53 PM, Christopher Hamlin 
>> >wrote:
>> >> On Mon, Jun 8, 2015 at 7:02 PM, Jakob Fix  wrote:
>> >>> Hello,
>> >>>
>> >>> I seem to recall a rumour that said that MarkLogic will look at the
>> >>> available RAM at install time and base its future utilization on it.
>> >>>When
>> >>> more RAM is added later it will not actually be taken into account.
>> >>> Could someone please comment on this and debunk it?
>> >>
>> >> That's true.  The settings won't change.
>> >>
>> >>> Or is it really recommended to reinstall after RAM has been added?
>> >>
>> >> Of course an install on a new machine with the correct amount of RAM
>> >> would give you the new settings, but otherwise I would contact Support
>> >> for new numbers.  You shouldn't have to do anything with your existing
>> >> install.  Then you can just set the numbers in the Admin UI (no
>> >> reinstall).
>> >>
>> >> =Chris
>> >___
>> >General mailing list
>> >General@developer.marklogic.com
>> >Manage your subscription at:
>> >http://developer.marklogic.com/mailman/listinfo/general
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] SSL configuration in Marklogic -reg.,

2015-06-09 Thread Christopher Hamlin
I don't know what the requirements are.  Does COMODO tell you what is wrong?

In the admin UI, where you create the certificate template, it says:

The subject for a certificate or certificate request. You should fill
in as many of these fields as possible because individual certificate
authorities have specific requirements for which fields must have
values. If a required field is missing, a certificate authority will
typically reject your certificate request with a cryptic error message
that your request is bad.

Have you left out any fields?

There seems to be a tester at
https://comodosslstore.com/checkcsr.aspx  that might help see what's
up with the cert request.

You can import another CA on Security > Certificate Authorities page.

= Chris

On Mon, Jun 8, 2015 at 3:18 PM,   wrote:
> Hi Team,
>
>
>
> We are trying to setup SSL (https) connection on the
> Marklogic App server.
>
>
>
> We followed below steps:
>
>
>
> Create a certificate template (eg: WB-Authentication-template)
>
> Enable SSL for the App Server
>
> Generate a certificate request and send it off to a certificate authority
> for signing. The certificate request is a zip file(requests) containing
> *.csr file.
>
>
>
> Questions:
>
>
>
> 1.   Can we give any name for the template? (or)  We need to give the
> certificate signing Authority company name as template name?
>
> 2.   When we try to get it signed by “COMODO” authority, they are saying
> the certificate request is invalid?
>
> 3.   Do we need to get it signed from any specific predefined
> Authorities? (or) We can do certificate signing with any authorities?
>
>
>
> Please suggest the process to setup SSL. Are we missing something here?
> Please Suggest.
>
>
>
> Regards,
>
> Santhosh Rajasekaran
>
>
>
> This e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. If you are not the intended recipient(s), please reply to the
> sender and destroy all copies of the original message. Any unauthorized
> review, use, disclosure, dissemination, forwarding, printing or copying of
> this email, and/or any action taken in reliance on the contents of this
> e-mail is strictly prohibited and may be unlawful. Where permitted by
> applicable law, this e-mail and other e-mail communications sent to and from
> Cognizant e-mail addresses may be monitored.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] RAM considerations

2015-06-08 Thread Christopher Hamlin
I should clarify:  I'm talking about the group-level cache settings,
and the corresponding Huge Pages allocation.

/ch

On Mon, Jun 8, 2015 at 8:53 PM, Christopher Hamlin  wrote:
> On Mon, Jun 8, 2015 at 7:02 PM, Jakob Fix  wrote:
>> Hello,
>>
>> I seem to recall a rumour that said that MarkLogic will look at the
>> available RAM at install time and base its future utilization on it. When
>> more RAM is added later it will not actually be taken into account.
>> Could someone please comment on this and debunk it?
>
> That's true.  The settings won't change.
>
>> Or is it really recommended to reinstall after RAM has been added?
>
> Of course an install on a new machine with the correct amount of RAM
> would give you the new settings, but otherwise I would contact Support
> for new numbers.  You shouldn't have to do anything with your existing
> install.  Then you can just set the numbers in the Admin UI (no
> reinstall).
>
> =Chris
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] RAM considerations

2015-06-08 Thread Christopher Hamlin
On Mon, Jun 8, 2015 at 7:02 PM, Jakob Fix  wrote:
> Hello,
>
> I seem to recall a rumour that said that MarkLogic will look at the
> available RAM at install time and base its future utilization on it. When
> more RAM is added later it will not actually be taken into account.
> Could someone please comment on this and debunk it?

That's true.  The settings won't change.

> Or is it really recommended to reinstall after RAM has been added?

Of course an install on a new machine with the correct amount of RAM
would give you the new settings, but otherwise I would contact Support
for new numbers.  You shouldn't have to do anything with your existing
install.  Then you can just set the numbers in the Admin UI (no
reinstall).

=Chris
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] TaskServer: state is already successor so not updating for /alerts/email/15835948930718685389.xml

2015-06-04 Thread Christopher Hamlin
Hi,

This happens on success, when the next state is the same as the old state.

In your pipeline I see:

  
http://marklogic.com/states/sent
http://marklogic.com/states/sent

Perhaps this is what is happening:  when it is in sent, and succeeds,
it tries to move to sent, and so just doesn't move.

Not sure why this would be different after upgrade, but could be an
extra guard that was added (or, just an extra notification)?

You can check the state by looking at the properties for the doc.

=Chris

On Thu, Jun 4, 2015 at 3:40 AM, Indrajeet Verma
 wrote:
> Hi,
>
> We have alert configured in our server and when any file inserts into
> /alert/email/<> the email sent to specified user.
>
> However after upgrading ML from 6 to 8, the below messages started coming
>
> TaskServer: state is already successor so not updating for
> /alerts/email/15835948930718685389.xml
>
> The file name is unique and it can not be same any time.
>
> Could somebody help to resolve this.?
>
> I am attaching pipeline for the reference.
>
> Regards,
> Indy
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH: xdmp:parse-dateTime

2015-05-28 Thread Christopher Hamlin
On Thu, May 28, 2015 at 5:24 PM, Kari Cowan  wrote:
> Hmm, I have 8.02 on my local machine, and it still throws that error so it
> must be more recent than that version.  Either way, we’re using  v.7 in my
> dev/stage environments (where I am seeing an error), and v.6 on production.
> It may be a while I have 8 available to me on our live servers.
>
>
>
> Any other workaround you might suggest?
>

I guess the question is, what is the range of input you might see?

If you always see

English month, whitespace, month day, comma, whitespace, year

then you can get the values with something like

fn:analyze-string ('May 28, 2015',
'(\S+)\s+(\d+),\s+(\d+)')//*:group/fn:string()

and go from there (see also
http://stackoverflow.com/questions/28673035/parsing-a-date-string).
Further upscale, there is some older code at

https://github.com/marklogic/commons/blob/master/dates/date-parser.xqy

that looks capable (I haven't experience with it).

/ch
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] using collection and range in default-suggestion-source

2015-05-28 Thread Christopher Hamlin
On Thu, May 28, 2015 at 9:13 AM, Steiner, David J. (LNG-DAY)
 wrote:
> Yes, that does work.  Thanks.  Though it doesn’t really explain why adding
>  to the  doesn’t work.
>
>

I'll take a guess.  My reading of

https://docs.marklogic.com/search:search#opt-default-suggestion-source

is that it defines a lexicon source only, not a constraining query.
Adding collection should let you use the collection lexicon, so the
lexicon of all collection URIs, as a source.  I notice that the
example doesn't have any content in the collection element.

=Chris
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


  1   2   >