Re: [MarkLogic Dev General] Spawned Task Appears to Block Other Threads

2017-11-09 Thread Geert Josten
Hi Eliot, I think you kicked off your watcher job with an HTTP request, and it keeps the port open until it finishes. Only one thread can use the port at the same time. Use a different port for task response traffic, or consider running your watcher as a scheduled task. Not super robust, and prob

Re: [MarkLogic Dev General] Retrieving collections based on document uri

2017-11-09 Thread Justin Makeig
You can build a collection query dynamically from the result sequence of collection URIs that xdmp:document-get-collections() returns. For example, cts:and-query(( … cts:collection-query(xdmp:document-get-collections($uri)), … )…) On Nov 9, 2017, at 3:17 PM, Pooja Rajput mailto:pooja.raj.

[MarkLogic Dev General] Spawned Task Appears to Block Other Threads

2017-11-09 Thread Eliot Kimber
I have a system where I have a “client” ML server that submits jobs to a set of remote ML servers, checking their task queues and keeping each server’s queue at a max of 100 queued items (the remote servers could go away without notice so the client needs to be able to restart tasks and not have

Re: [MarkLogic Dev General] Retrieving collections based on document uri

2017-11-09 Thread Pooja Rajput
Thanks for the response Ron. I need to use this inside cts-query so that I can filter the type of collections as well. Hence I am looking for similar cts query. Thanks, Pooja From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens

Re: [MarkLogic Dev General] Retrieving collections based on document uri

2017-11-09 Thread Ron Hitchens
https://docs.marklogic.com/xdmp:document-get-collections Ron Hitchens r...@overstory.co.uk, +44 7879 358212 On November 9, 2017 at 11:12:18 PM, Pooja Rajput (pooja.raj...@healthbi.com) wrote: Hi Team, I need to retrieve the collections associated with particular document. All I have is do

[MarkLogic Dev General] Retrieving collections based on document uri

2017-11-09 Thread Pooja Rajput
Hi Team, I need to retrieve the collections associated with particular document. All I have is document uri. How can I retrieve this info using cts query like xdmp:Document-get-collections provides results. Any example is appreciated. Thanks Pooja ___

Re: [MarkLogic Dev General] Return nodes and text between nodes

2017-11-09 Thread Gary Larsen
Bingo! Thanks Gary From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Murray, Gregory Sent: Thursday, November 09, 2017 1:31 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Return nodes and text between n

Re: [MarkLogic Dev General] Return nodes and text between nodes

2017-11-09 Thread Murray, Gregory
In XPath, * finds elements. To get text nodes too, use $expr/node() instead. From: mailto:general-boun...@developer.marklogic.com>> on behalf of Gary Larsen mailto:gary.lar...@envisn.com>> Reply-To: MarkLogic Developer Discussion mailto:general@developer.marklogic.com>> Date: Thursday, Novembe

[MarkLogic Dev General] Return nodes and text between nodes

2017-11-09 Thread Gary Larsen
Sorry if this is a bit off topic. Trying to process both node and text children in a for loop. For some reason this escapes me. let $expr := REFOBJ1TEXT1REFOBJ2 for $x in $expr/* return $x returns: REFOBJ1 REFOBJ2 How do I access TEXT1 in a loop? Thanks, Gary

Re: [MarkLogic Dev General] [resolved] What Might Cause Documents to Silently Not Be Created?

2017-11-09 Thread Eliot Kimber
I’ve found my bug: bad assumption about the data: While the URIs of all my input documents are unique, their filenames are not and I was using just the filename as the basis for my task record URIs. I was in the process of posting my code and that led me to verify that my assumptions were corre

Re: [MarkLogic Dev General] What Might Cause Documents to Silently Not Be Created?

2017-11-09 Thread Eliot Kimber
I’m actually not doing anything with the HTTP response. I get the response but currently don’t examine it (in fact I have a FIXME in the code to add handling of non-200 response codes, but for now it’s basically fire and forget—the request to the remote server ultimately spawns a task on that se

Re: [MarkLogic Dev General] What Might Cause Documents to Silently Not Be Created?

2017-11-09 Thread Will Thompson
Eliot, When you make the remote HTTP call, are you using one of the xdmp:http-XYZ functions? Since those functions return a payload describing the response condition and don't throw exceptions for most errors, is it possible that an HTTP response error condition is not being handled, resulting