Re: [MarkLogic Dev General] A question about limiting Marklogic memory and CPU usage.

2016-11-11 Thread Danny Sokolsky
Make sure you have configured swap space appropriately:


https://docs.marklogic.com/guide/installation/intro#id_11335


-Danny

On Fri, Nov 11, 2016 at 5:32 AM, Yair Etziony 
wrote:

> Hi All
> i have a question about ML, this more of DBA or admin question, but i will
> take my shot here.
>
>  We run Marklogic on Linux server (Centos 7), there are times when we run
> big processes and the ML daemon would take all memory, in situations like
> that the Linux kernel will kill the process and this is not something we
> can accept in our prod stack.
>   the question is what would be the best practice to limit the memory and
> cpu consumption for ML daemon? ( for example using linux cgroups)
>
> Thanks in advance for any answer
>
> bests
> Y
>
> --
>
> ---
>
> Yair Etziony
>
> LambdaWerk GmbH
>
> Oranienburger Straße 87/89
>
> 10178 Berlin
>
> Phone +49 151 75938044
>
> ___
> 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] Path Range Query

2016-07-05 Thread Danny Sokolsky
Did you try cts:element-value-query?Maybe if you gave an example of your 
range queries in a search you are using it would be easier to understand what 
you mean.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Kapoor, Pragya
Sent: Monday, July 04, 2016 12:18 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Path Range Query


Hi,



Is there any way by which we can substitue cts:element-word-query( wildcarded)  
to path range queries.

Actually, my xml contains same names of elements without any namespace, so I 
wanted to run path range queries, but the wildcarded option is not present in 
these queries.



My requirement is to create a query which could work on *term*, term*



Any idea how can I achieve this?



Thanks

Pragya
"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


Re: [MarkLogic Dev General] Bulk updates (xqsync vs. mlcp)

2016-06-29 Thread Danny Sokolsky
You are correct, Hans, setting a merge timestamp does not disable merges.

The downsides to never getting rid of deleted fragments is that your database 
can grow without bound, without sensible ways to manage it.  Point-in-time 
queries are really meant for relatively short durations.   Some of the 
consequences of keeping all old versions are:


· Relevance:  relevance is calculated based on all fragments in the 
database, so if, for example, you happened to have 1,000,000 versions of a 
particular document due to a bug you had in your application code that kept 
updating the same document (or for whatever reason), that would probably make 
things in less relevant than it would otherwise.

· Manageablitly:  there is no way to manage the old versions; they are 
all always there.

· Size:  your database might get very large.

Point-in-time queries are very useful for things like:

· Pagination: if you have a requirement that many pages of search 
results give the exact same answers for a relatively period of time (for 
example, an hour, or a day), you can keep the last day around and query those 
at a point in time.

· Publishing a new version of documents:  If you want to load a new 
version of documents (say a magazine or similar) and test it in your production 
system while still having the old version be production, you can set the merge 
timestamp, make the users of the old version query at a point in time, load the 
new versions, and test the new stuff at the current timestamp.  There are lots 
of other ways to do this, but point in time is one way.

It might be tempting to treat point-in-time queries for generic versioning, but 
it is usually not what you want.

Does that help to clarify?

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Hans Hübner
Sent: Wednesday, June 29, 2016 12:19 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Bulk updates (xqsync vs. mlcp)

Justin,

thank you for the additional documentation pointer.  From what I read, I 
understand that merging is a useful operation and that merges should not be 
disabled.  I can agree to that, but as far as I have understood, the 
point-in-time feature does not require that we disable merges.  It just 
requires that the merge timestamp is set to the earliest point back in time 
where we want to be able to look back to.  Does setting the merge timestamp 
automatically disable the merges?

What I am still missing is why the "Inside MarkLogic" document describes how 
MVCC timestamps can be used to implement "Time Travel" and the "Application 
Developer's Guide" describe point-in-time queries if you (assuming that you 
speak for MarkLogic) advise against using them.  The "Application Developer's 
Guide" in particular describes how such queries work, in detail, and it does 
not mention that one should avoid the technique.

Is the documentation accurate?  Under what circumstances do you recommend using 
the point-in-time technique described in the guide?  Does the point-in-time 
query technique only work if merges are disabled?

Hans

On Wed, Jun 29, 2016 at 7:40 PM, Justin Makeig 
> wrote:
Can you elaborate what you mean by "maintain the health of a database"?  If 
we'd decide that we never want to delete any data in a certain MarkLogic 
database so that we can roll back to any point in time, what would be the down 
sides?  How would the database become unhealthy?

Please take a look at the docs on merging, specifically the section, "Merges 
Are Good" . Merging is 
the way that MarkLogic manages its internal data to support efficient and 
consistent ingest and query I/O. It is an internal process and completely 
orthogonal to how you version your documents.

What you describe sounds more like temporal versioning. Please take a look at 
MarkLogic's bitemporal APIs . 
With bitemporal management you maintain an immutable copy of the entire history 
of your data that you can query at any point in time. The APIs do all of the 
sophisticated work maintaining versions securely. The "bi" in bitemporal allows 
you to query the valid time of the document (e.g. a trade was effective on 
2016-06-01) as you knew it at any point in time (e.g. the trade wasn't recorded 
until 2016-06-02 and then it was corrected on 2016-06-05).

Justin


On Jun 28, 2016, at 9:55 PM, Hans Hübner 
> wrote:

On Tue, Jun 28, 2016 at 10:36 PM, Justin Makeig 
> wrote:
> as we want to be able to use the point-in-time query feature to track 
> document changes over time

Point-in-time queries  
are not 

Re: [MarkLogic Dev General] Mysterious, Dramatic Query Slowdown on Multi-Node Cluster

2016-06-16 Thread Danny Sokolsky
Hi Ron,

It is hard to say for sure, but there have been many bug fixes since 8.0-3.2 
that can account for some or all of this.

Do you have an environment where you can try out the latest (8.0-5.4)?

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens
Sent: Thursday, June 16, 2016 1:18 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Mysterious, Dramatic Query Slowdown on 
Multi-Node Cluster


   We’re seeing a very odd phenomenon on a client project here in the UK.  
Queries (as in read-only, no updates) slow down dramatically (from 1.2 seconds 
to 30-40 seconds or longer) while “Jobs” are running that do relatively light 
updates.  But only on multi-node clusters (3 node in this case).

Details:
MarkLogic 8.0-3.2
Production (pre-launch): A three node cluster running on Linux in AWS JVM app 
nodes (also in AWS) that perform different tasks, taking to the same ML cluster

QA is a single E+D MarkLogic node in AWS

   The operational scenario is this.

o Prod cluster (3 nodes) has about 14+ million documents (articles and books).
o Some number of “API app nodes” which present a REST API dedicated to queries 
o Some number of “worker bee” nodes that process batch jobs for ingestion and 
content enrichment

   The intention is that the worker bees handle the slow, lumpy work of 
processing and validating content before ingesting it into ML.  There is a job 
processing framework that is used on the worker bees to queue, throttle and 
process jobs asynchronously.


   The API nodes respond to queries from the web app front end and other 
clients within the system to do searches, fetch documents, etc.  These, for the 
most part, are pure queries that don’t do any updates.

   The issue we’ve bumped up against is this: We have a worker bee job that 
enriches content by, for a particular content document (such as an article), 
taking each associated binary and submitting it to a thumbnail service.  A 
thread then polls the service until the results are ready.  Those results are 
then written to the content document with URIs of the thumbnail images.

   In the course of processing these jobs, this is what happens (several can 
run at once, but we see this problem even with only one running:

   o A job is pulled off the queue.  The queue is just a bunch of job XML 
documents in ML.
   o The job’s state is updated to running in its XML doc
   o Code starts running in the JVM to process the job
   o During execution, messages can be logged for the job, which results in a 
node insert to the job XML doc
   o The thumbnail job reads a list of binary references from the content doc
   o For each one it issues a request to an external service, then starts a 
polling thread to check for good completion
  o There can be up to 10 of these polling threads going at once
  o They are waiting most of the time, not talking to ML
   o Messages can be logged to the job doc in the previous step, but the 
content doc is not touched
   o When the thumbnail result is ready, then the results are inserted into the 
content doc in ML
   o The job finishes up and updates the state of the job doc

   There is some lock contention for the job doc from multiple threads logging 
messages, but it’s not normally significant.  We see the deadlocks logged by ML 
at debug level and they seem to resolve within a few milliseconds as expected 
and the updates always complete quickly.

   When the results come back and the content doc is updated, there can be 
contention there as well.  Some jitter is introduced to prevent the pollers 
from all waking up at once, but again this shouldn’t matter even of they do.

   The odd phenomenon is that while one of these jobs is running (spending most 
of it’s time waiting, about 4-5 seconds between polls) on one of the worker bee 
nodes, a query sent from one of the API JVM nodes will take many tens of 
seconds to complete.  Once the job has finished, then query times will return 
to normal (a few milliseconds to 1-2 seconds depending on the specifics of the 
query).

   So the mystery is this: why would a pure query apparently block for a long 
time in this scenario.  Queries should run lock free, so even if there is lock 
content happening with the thumbnail job, queries should not be held up.  
MarkLogic is not busy at all, nothing else is going on.

   This doesn’t happen on a single node, which makes me suspect something to do 
with cross-node lock propagation.  But like I said, logging doesn’t indicate 
any sort of pathological lock storm or anything like that.

   If someone can give me some assurance that the latest ML release will solve 
this problem I’d be happy to recommend that to the client.  But I’ve reviewed 
all the documented bug fixes since 8.0-3 and nothing seems relevant.

   This is a rather urgent problem since all this thumbnail processing must the 

Re: [MarkLogic Dev General] Marklogic Issue with Ligature

2016-06-09 Thread Danny Sokolsky
If you want both to match in this case, why not just create a thesaurus and do 
an expand on your query?

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher Hamlin
Sent: Thursday, June 09, 2016 5:28 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Marklogic Issue with Ligature

On Thu, Jun 9, 2016 at 12:48 AM, Mohapatra, Amrita (LNG-CON) 
> 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] Regarading REST API

2016-05-27 Thread Danny Sokolsky
Here is a link to the doc for creating a REST instance:

http://docs.marklogic.com/guide/rest-dev/service#id_12021

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ram shaw
Sent: Friday, May 27, 2016 4:29 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Regarading REST API

Hi Akshay,

  In order to communicate with a MarkLogic database through the 
REST API, a REST API instance for the database needs to first exist.
To create a REST API instance, a POST request can be sent to the /rest-apis 
service on port 8002, with REST API instance configuration information in XML 
or JSON.
here is the config file -

{
  "rest-api": {
"name": "8060-patents",
"database": "patents",
"port": "8060",
"forests-per-host": 1
  }
}

curl --anyauth --user ram:pass123 -X POST -d@"location-of-file" -i -H 
"Content-type: application/json" http://localhost:8002/v1/rest-apis

Thanks,
Ram


On Fri, May 27, 2016 at 4:14 PM, Geert Josten 
> wrote:
Hi Akshay,

These answers weren’t of any help?

http://stackoverflow.com/questions/37469976/from-where-rest-api-is-downloaded?utm_source=twitterfeed_medium=twitter

Cheers,
Geert

From: 
>
 on behalf of akshay gupta 
>
Reply-To: akshay gupta 
>, MarkLogic 
Developer Discussion 
>
Date: Friday, May 27, 2016 at 12:23 PM
To: "general@developer.marklogic.com" 
>
Subject: [MarkLogic Dev General] Regarading REST API

Hi

I want to install REST API in my local machine.In my machine Mrklogic is server 
is install.Please tell me how and where I can install REST API console.

Regards
Akshay Gupta

___
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] start and end time xquery

2016-05-01 Thread Danny Sokolsky
Try xdmp:elapsed-time().

From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Asit Nautiyal 
[asitnauti...@outlook.com]
Sent: Sunday, May 01, 2016 12:01 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] start and end time xquery


Hi Pragya,



Use xdmp:log() function at the start and end of your code execution.




From: general-boun...@developer.marklogic.com 
 on behalf of Kapoor, Pragya 

Sent: Wednesday, April 27, 2016 9:00 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] start and end time xquery


Hi,


I need to find out the start and end time of the function executed in xquery.


For example when I click on the link find Collections( this is an xquery in 
which html is also embedded), this calls another xqy file on which the code for 
finding new collections is written.


Now, I need to find the start and end time for this function.

For this, I tried using fn:current-dateTime() at the start and end of this 
function and saving these values in an xml which is in turn stored in db.


But since it is a single transaction, both start and end time is same.


I think, for finding endTime we can use xdmp:elapsed-time and add that to  
fn:current-dateTime(). but how to add time to dateTime, to get again the 
dateTime format?


Some other approach is also welcomed.


Thanks

Pragya


"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


Re: [MarkLogic Dev General] how is ID reported by xdmp:host() created?

2016-03-24 Thread Danny Sokolsky
It is the ID for the host in the config files.  That is a random number ID 
created when that host joined the cluster.

If you do a fresh installation on the same machine, you will get a new ID.  If 
you uninstall and then reinstall a new version of MarkLogic (or even the same 
version), then the ID will not change (because it uses the same config files).

Now if you remove that host from the cluster, then later add the host back in, 
I believe you will get a different ID.

I would recommend verifying this, but that is how I think it works.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of neil bradley
Sent: Thursday, March 24, 2016 2:21 PM
To: MarkLogic Forum
Subject: [MarkLogic Dev General] how is ID reported by xdmp:host() created?


Hi,

Does anyone know how MarkLogic determines the host ID that is accessed by 
xdmp:host()?  Does it use information from the server or is it just a random 
number?

The reason I am asking is that I am thinking of using the host ID as part of a 
software licensing scheme. But I need to know how "reliable" it will be.

I  believe it is a more reliable identifier than the host name, because the 
host name can be changed, but the ID remains the same. Can you tell me if I 
removed MarkLogic from a server, then re-installed it, would it have the same 
ID?


Regards,

Neil.

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


Re: [MarkLogic Dev General] ARM platform? Be a BIG

2016-01-25 Thread Danny Sokolsky
You could put the Node.js client on a Raspberry Pi, then have that talk to a 
MarkLogic Server sitting in the cloud.  That seems like a more sensible 
architecture to me.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Jakob Fix
Sent: Sunday, January 24, 2016 3:49 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] ARM platform? Be a BIG

Ok, so no mobile strategy to fall back on in case of an offline-first scenario? 
(CouchDB has PouchDB ...)

No, not trolling, just curious. :-)


cheers,
Jakob.

On Sun, Jan 24, 2016 at 5:54 AM, David Lee 
> wrote:
When raspberry pi implements docker ( using a x86/64 instruction set) ML might 
run on that, it would have be a BIG pie ...
I haven't followed the pi's lately...what's the biggest and fastest you can get 
? (Ram, cpu cores, speed, storage. Networking )

Sent from my iPad
David A Lee))

d...@marklogic.com


On Jan 23, 2016, at 5:19 PM, Jakob Fix 
> wrote:
Hmm, was that not the right moment to ask this question? Or the right place?

I really can see the Raspberry PI clusters of ML machines ... if only there was 
an ARM-architecture version of MarkLogic Server!

cheers,
Jakob.

On Thu, Jan 21, 2016 at 2:21 PM, Jakob Fix 
> wrote:
Hello,

I've been wondering whether MarkLogic will/may be/is available for the ARM 
platform .

cheers,
Jakob.

___
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] CPF pre-commit action?

2016-01-18 Thread Danny Sokolsky
And if your properties are only being used by cpf, then the last step can skip 
moving over the properties to the prod database, thus saving you those 
fragments in that database.

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Geert Josten
Sent: Monday, January 18, 2016 11:38 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] CPF pre-commit action?

Hi Will,

It doesn¹t have to be that much more complicated. Just add a ¹staging¹ 
database, put your CPF there, and insert docs into that. Add one extra state 
and pipeline action at the end of your chain that copies the final docs into a 
different database, duplicating any properties..

It would become slightly more complicated if there are linked docs that needs 
to be copied as well, but as long as you keep db uris the same, you don¹t need 
to touch the contents of any of the docs..

Kind regards,
Geert

On 1/18/16, 6:33 PM, "general-boun...@developer.marklogic.com on behalf of Will 
Thompson" <general-boun...@developer.marklogic.com on behalf of 
wthomp...@oconnors.com> wrote:

>Geert,
>
>I hadn't considered that, but it would definitely achieve the desired 
>behavior. Thanks for the suggestion. It would add a lot more complexity 
>to the pipeline, but its sounds feasible.
>
>-Will
>
>> On Jan 15, 2016, at 1:38 PM, Geert Josten 
>><geert.jos...@marklogic.com>
>>wrote:
>> 
>> Have you considered taking an approach similar to Info Studio: insert  
>>unprocessed docs in an separate database in which you have all the CPF  
>>pipelines you need. Not until finishing of processing it gets copied 
>>into  the target database. Info Studio was using the Fab database for 
>>that  purpose..
>> 
>> Cheers
>> 
>> On 1/15/16, 5:06 PM, "general-boun...@developer.marklogic.com on 
>>behalf of  Will Thompson" <general-boun...@developer.marklogic.com on 
>>behalf of  wthomp...@oconnors.com> wrote:
>> 
>>> Geert,
>>> 
>>> We're using CPF because some steps may necessitate human 
>>>intervention, in  which case they go into a queue, get resolved, a 
>>>state change occurs, and  the pipeline marches on. But are you 
>>>suggesting a pre-commit trigger to  supplement the existing CPF 
>>>pipeline?
>>> 
>>> Danny,
>>> 
>>> The main issue for us is user experience. For example, in most cases  
>>>document X will already exist in the database and users can see it as  
>>>part of the application. We want to replace document X with an 
>>>updated  version and not have it appear visible to users until it has 
>>>been  transformed. Hiding it in a collection would hide it from users 
>>>as well.
>>> I said "version" so maybe DLS seems like a good fit? But I'm still 
>>>unsure  of how to begin the pipeline with the document in a 
>>>checked-out state.
>>> 
>>> We do have a solution to this, which is essentially: the application 
>>> takes care of it. But I wanted to see if it were possible to push 
>>> that logic back into CPF and simplify our API such that other 
>>> applications could utilize the pipeline with basic insert and delete 
>>> operations.
>>> 
>>> Thanks,
>>> 
>>> Will
>>> 
>>> 
>>>> On Jan 15, 2016, at 5:26 AM, Geert Josten 
>>>> <geert.jos...@marklogic.com>
>>>> wrote:
>>>> 
>>>> Or how about KISS: just use one pre-commit trigger that does all 
>>>> the transformation/processing in one blow..
>>>> 
>>>> Kind regards,
>>>> Geert
>>>> 
>>>> On 1/15/16, 12:42 AM, "general-boun...@developer.marklogic.com on 
>>>>behalf  of Danny Sokolsky" <general-boun...@developer.marklogic.com 
>>>>on behalf of  danny.sokol...@marklogic.com> wrote:
>>>> 
>>>>> Hi Will,
>>>>> 
>>>>> I can't think of a way to do this without modifying the core cpf 
>>>>>code.
>>>>> For some of the status-change-handling pipeline steps, there are  
>>>>>pre-commit triggers, but those are for cpf bookkeeping mostly, I  
>>>>>believe.
>>>>> And I would not recommend changing that code.
>>>>> 
>>>>> But I would question why you would want to do this.  CPF is 
>>>>>designed to  be resilient and to allow you to have multiple steps 
>>>>>in your pipeline.
>>>>> Why not

Re: [MarkLogic Dev General] CPF pre-commit action?

2016-01-14 Thread Danny Sokolsky
Hi Will,

I can't think of a way to do this without modifying the core cpf code.For 
some of the status-change-handling pipeline steps, there are pre-commit 
triggers, but those are for cpf bookkeeping mostly, I believe.  And I would not 
recommend changing that code.

But I would question why you would want to do this.  CPF is designed to be 
resilient and to allow you to have multiple steps in your pipeline.  Why not 
make a step that does the transform its own step?  If you do not want the 
document to be visible until it is transformed, then put it in some collection 
initially that is not seen by your application, and then take it out of that 
collection when you are done with the transform (or something similar to that).

Is it just because you want to have one less step in your pipeline that you 
want to do this?

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Will Thompson
Sent: Thursday, January 14, 2016 1:06 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] CPF pre-commit action?

Is it possible to configure a CPF pipeline such that when a document is 
inserted, transformations are first executed on the document in a pre-commit 
stage, and if those complete successfully, then the transformation result is 
what's finally committed at that URI? And any remaining pipeline could carry on 
without the pre-transformed data ever being visible to the database?

-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] cts:values scoring

2016-01-06 Thread Danny Sokolsky
Hi Will,

The scores are used for the truncate=N and other options that use a cts:query.  
In those cases, the score will be used to find the top n fragments to 
limit|skip|sample|truncate.

If you want relevance order, I believe you have to do a cts:search.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of William Sawyer
Sent: Wednesday, January 06, 2016 3:29 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] cts:values scoring

I have a fact fragment created in the database every time an article is viewed, 
 for example:


   12345
   read
   userIdHere
   dateTimeHere


I am wanting to display a distinct list of the most recent viewed documents.  I 
found the documentation for cts:values has options for scoring so I got really 
excited about using cts:values with a date range query with linear slope 
scoring to produce both a distinct list ordered by most recent.

Example:
cts:values(
cts:element-reference(xs:QName('doc-id'), 
("type=string","collation=http://marklogic.com/collation/;)),
(),
(
  "limit=6",
 "descending",
 "score-logtfidf"
),
cts:and-query((
cts:element-range-query(xs:QName('date'), "<=", 
fn:current-dateTime(), ("score-function=reciprocal", "slope-factor=2"), 16),
cts:element-range-query(xs:QName('user'), "=", 
"currentUser", "collation=http://marklogic.com/collation/;),
cts:element-range-query(xs:QName('type'), '=', "read", 
"collation=http://marklogic.com/collation/;)
))
)

The problem is cts:values always returns the values in item order or frequency 
order. There is no option to use score order, which makes me ask the question 
why can you specify how it scores?  I know there are other ways to get my 
desired result.  But it would be a really nice feature to allow cts:values to 
return in score order.

Thanks,
-Will


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


Re: [MarkLogic Dev General] XDMP-EXTVAR with xdmp:spawn-function and external variables

2015-12-14 Thread Danny Sokolsky
Yes, this is a bug.  We are already tracking it internally, but it is not yet 
fixed.

Thanks,
-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Andreas Hubmer
Sent: Monday, December 14, 2015 8:45 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] XDMP-EXTVAR with xdmp:spawn-function and 
external variables

Hi,

It seems that I've found a bug concerning spawned functions and external 
variables.

In a module with an external variable I spawn a function. The spawned function 
calls another function which fails with XDMP-EXTVAR when accessing the external 
variable.
Here is a small example (main.xqy):
xquery version "1.0-ml";
declare variable $param as xs:string external;

declare function local:func() {
xdmp:log("value: " || $param)
};

xdmp:spawn-function(function() { local:func() })


I call main.xqy using the following snippet:
xquery version "1.0-ml";
xdmp:invoke("main.xqy", (xs:QName("param"), "foo"))

This leads to the following error:

XDMP-EXTVAR: (err:XPDY0002) declare variable $param as xs:string external;  -- 
Undefined external variable fn:QName("","param")
I've also found out that accessing the external variable directly in the 
spawned function works. Working version of main.xqy:
xquery version "1.0-ml";
declare variable $param as xs:string external;

xdmp:spawn-function(function() { xdmp:log("value: " || $param) })

Regards,
Andreas

--
Andreas Hubmer
IT Consultant

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


Re: [MarkLogic Dev General] Retrieve a multipart/form-data file as XML nodes

2015-11-26 Thread Danny Sokolsky
I am not sure, but don't you need to decode the multipart form data?

http://docs.marklogic.com/xdmp:multipart-decode

-Danny


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Florent Georges 
[li...@fgeorges.org]
Sent: Thursday, November 26, 2015 12:55 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Retrieve a multipart/form-data file as XML 
nodes

Hi Geert,

Exactly the same than with text/xml, unfortunately.

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 26 November 2015 at 21:42, Geert Josten wrote:
> What happens if you mark it with Content-Type: application/xml?
>
> Cheers,
> Geert
>
> On 11/26/15, 9:08 PM, "general-boun...@developer.marklogic.com on behalf
> of Florent Georges"  li...@fgeorges.org> wrote:
>
>>Hi,
>>
>>I have a problem with a form, that I could narrow down to the
>>following.  It is a POST of type multipart/form data, sending one file
>>part:
>>
>>--ed0cb8f98262
>>Content-Disposition: form-data; name="file"; filename="example.xml"
>>Content-Type: text/xml
>>
>>World!
>>
>>--ed0cb8f98262--
>>
>>When I use `xdmp:get-request-field('file')` to get te value, it is
>>returned as a document node containing one text node.  If I change
>>`text/plain` to `application/octet-stream`, the value is a binary
>>node.
>>
>>I would have expected a document node with an element `hello`.  The
>>following query reproduces the problem (accessing and outputing a few
>>key values, to double-check my environment):
>>
>>xquery version "1.0-ml";
>>
>>import module namespace admin = "http://marklogic.com/xdmp/admin;
>>   at "/MarkLogic/admin.xqy";
>>
>>declare namespace xdmp = "http://marklogic.com/xdmp;;
>>declare namespace mt   = "http://marklogic.com/xdmp/mimetypes;;
>>
>>declare function local:type-from-filename($name as xs:string) as
>>xs:string*
>>{
>>   let $ext   := fn:tokenize($name, '\.')[fn:last()]
>>   let $types := admin:mimetypes-get(admin:get-configuration())
>>   return
>>  $types[mt:extensions/data() = $ext]/mt:name
>>};
>>
>>
>>{
>>   for $name in xdmp:get-request-field-names()
>>   let $value:= xdmp:get-request-field($name)
>>   let $filename := xdmp:get-request-field-filename($name)
>>   return
>>  
>> { $name }
>> { $value/node() instance of text() }
>> { $value/node() instance of binary() }
>> { $filename }
>> {
>>xdmp:get-request-field-content-type($name) }
>> {
>>if ( $value instance of binary() ) then
>>   ...binary...
>>else
>>   { $value }
>> }
>>  
>>}
>>
>>
>>When called with the following CURL command (just put the above query
>>on a HTTP app server, and adapt the user, password, and endpoint
>>below):
>>
>>curl -u user:pwd --digest \
>>-F "file=@.../example.xml;type=text/xml" \
>>http://localhost:8010/test/tools/fields
>>
>>it returns the following:
>>
>>
>>   
>>  file
>>  true
>>  false
>>  example.xml
>>  text/xml
>>  helloWorld!/hello 
>>   
>>
>>
>>
>>When called with the following CURL command (note the different
>>type=):
>>
>>curl -u user:pwd --digest \
>>-F "file=@.../example.xml;type=application/octet-stream" \
>>http://localhost:8010/test/tools/fields
>>
>>it returns the following:
>>
>>
>>   
>>  file
>>  false
>>  false
>>  example.xml
>>  application/octet-stream
>>  ...binary...
>>   
>>
>>
>>Did I miss something?  Shouldn't I get an XML document node?
>>
>>Posted on SO as well, at http://stackoverflow.com/questions/33946268/.
>>
>>Regards,
>>
>>--
>>Florent Georges
>>http://fgeorges.org/
>>http://h2oconsulting.be/
>>___
>>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] SEARCH-BADORDERBY

2015-11-25 Thread Danny Sokolsky
Ashley, for your element range index you created on insert_timestamp, what is 
the type you selected?  Based on the options node you posted, it should be 
dateTime.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Indrajeet Verma
Sent: Wednesday, November 25, 2015 10:09 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] SEARCH-BADORDERBY

As per my understanding, ML8 onwards, whatever element you use for sorting that 
should have range index.

On Wed, Nov 25, 2015 at 11:37 PM, Indrajeet Verma 
> wrote:
Hey,

I have faced this type of issue while upgrading to ML8 and I solved it creating 
range index only. Did you check collation

Could you give some more details with an example? I could try to help you.

Regards,
Indy

On Wed, Nov 25, 2015 at 11:22 PM, Ashley Peacock 
> wrote:
Hey,

Yup I think so, I created an element range index with the namespace field left 
blank and the local name as insert_timestamp.

Ashley

Sent from my iPhone




[cid:image001.jpg@01D12771.9DAC0860]


[cid:image002.png@01D12771.9DAC0860]


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


On 25 Nov 2015, at 17:40, Indrajeet Verma 
> wrote:
Have you created range index on element "insert_timestamp" type of dateTime and 
without namespace?

Regards,
Indy

On Wed, Nov 25, 2015 at 9:44 PM, Ashley Peacock 
> wrote:
Just to add to the below, I removed the index I added and re-ran the 
check-options and it comes up with a suggestion for an index… which is the 
exact index I had added. I re-added it, re-ran the check and nothing comes back 
suggesting I added the right index.

I restarted the MarkLogic service, and even after that I still get the same 
response from the API as per below so somewhat stumped!

Ashley







[cid:image002.png@01D12771.9DAC0860]


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


From: 
general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.com]
 On Behalf Of Ashley Peacock
Sent: 25 November 2015 15:44
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] SEARCH-BADORDERBY

Hey,

I have added the following search option:

http://marklogic.com/appservices/search;>Order by the timestamp, 
descending

If I then query using that search option, I get the following result:

{"errorResponse":{"statusCode":400, "status":"Bad Request", 
"messageCode":"SEARCH-BADORDERBY", "message":"SEARCH-BADORDERBY: (err:FOER) 
Indexes are required to support element, element-attribute, json-property, or 
field sort specifications."}}

I’ve added an element range index to the field it’s querying on (and it’s 
re-indexed), and it still throws the same error. It said in the docs I could 
check the index required using:

search:check-options(
http://marklogic.com/appservices/search;>Order by the timestamp, 
descending,
true()
)

But that yielded no result (“your query returned an empty sequence”) which 
makes me think the index is correct… yet it still throws the same error.

Does anyone have any ideas?

Thanks,

Ashley







Re: [MarkLogic Dev General] error in fn:concate

2015-10-20 Thread Danny Sokolsky
And  you should really create a sequence of strings instead of a sequence of 
elements.  For example:

fn:string-join(/catalog/book/ comments/comment/Text/fn:string(),"")

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Etanchaud Fabrice
Sent: Tuesday, October 20, 2015 4:08 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] error in fn:concate

Hi,

For that purpose, you should use string-join :

http://www.xqueryfunctions.com/xq/fn_concat.html

http://www.xqueryfunctions.com/xq/fn_string-join.html

for concat does not allow sequences as argument.

Best regards,
Fabrice

De : general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] De la part de Anoop Khetan
Envoyé : mardi 20 octobre 2015 12:51
À : general@developer.marklogic.com
Objet : [MarkLogic Dev General] error in fn:concate

Hi All,

I am using similar XML as below, it has multiple  tags, but I need to 
fn:concat of such XMLs which has abc.

Could anyone help me, how to phrase this in fn:concat  which will only populate 
abc.

fn:concat (/catalog/book/ comments/comment/Text)

Error which I am getting is : arg is not of Type xs:anyAtomic



   
  Gambardella, Matthew
  XML Developer's Guide
  Computer
  44.95
  2000-10-01
  An in-depth look at creating applications with 
XML.
  
 
   abc
 
 
   123
 
 
   Abc123
 
 
   abc@123
 
 
   




 CAUTION - Disclaimer *

This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely

for the use of the addressee(s). If you are not the intended recipient, please

notify the sender by e-mail and delete the original message. Further, you are 
not

to copy, disclose, or distribute this e-mail or its contents to any other 
person and

any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken

every reasonable precaution to minimize this risk, but is not liable for any 
damage

you may sustain as a result of any virus in this e-mail. You should carry out 
your

own virus checks before opening the e-mail or attachment. Infosys reserves the

right to monitor and review the content of all messages sent to or from this 
e-mail

address. Messages sent to or from this e-mail address may be stored on the

Infosys e-mail system.

***INFOSYS End of Disclaimer INFOSYS***


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


Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: (err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

2015-10-20 Thread Danny Sokolsky
It looks like your function has a syntax error in it:

let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
  xdmp:database-backup(
(:xdmp:database-forests(xdmp:database($dbname)), $s3bucket ):)
xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )


It is missing the return after the let statements.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Tuesday, October 20, 2015 2:26 PM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER) - when installing rest-api extension for backups in MarkLogic 7

Hello everyone,
There's simple xquery function for backups that works pretty great.
I wanted to automate it, knowing that we can install new extensions.
My code, error and command can be found on 
stackoverflow.
I didn't want to create another copy of my post.
If anyone has some suggestions as to what could be causing 
RESTAPI-INVALIDCONTENT: (err:FOER)
I would greatly appreciate it.
Is such thing even supported in ML7?
Digging through bunch of other functions under /opt/MarkLogic seems like this 
should work
but I can't seem to find anything about that anywhere in documentation.

Thank you,
Ernest Gulik

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


Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: (err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

2015-10-20 Thread Danny Sokolsky
Additionally, there is no need to import the admin library.

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Tuesday, October 20, 2015 2:40 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER) - when installing rest-api extension for backups in MarkLogic 7

It looks like your function has a syntax error in it:

let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
  xdmp:database-backup(
(:xdmp:database-forests(xdmp:database($dbname)), $s3bucket ):)
xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )


It is missing the return after the let statements.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Tuesday, October 20, 2015 2:26 PM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER) - when installing rest-api extension for backups in MarkLogic 7

Hello everyone,
There's simple xquery function for backups that works pretty great.
I wanted to automate it, knowing that we can install new extensions.
My code, error and command can be found on 
stackoverflow<http://stackoverflow.com/questions/33246818/marklogic-7-database-backup-with-rest-api>.
I didn't want to create another copy of my post.
If anyone has some suggestions as to what could be causing 
RESTAPI-INVALIDCONTENT: (err:FOER)
I would greatly appreciate it.
Is such thing even supported in ML7?
Digging through bunch of other functions under /opt/MarkLogic seems like this 
should work
but I can't seem to find anything about that anywhere in documentation.

Thank you,
Ernest Gulik

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


Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: (err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

2015-10-20 Thread Danny Sokolsky
That return is in the wrong place.  It should be after the let statements:

{
  let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
return
  xdmp:database-backup(
xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )
};

I'm not sure what that last expression is.  If you want to return a document 
node, then you need a comma before it.

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Tuesday, October 20, 2015 3:13 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER) - when installing rest-api extension for backups in MarkLogic 7

Thank you for a quick reply.
I commented out import of admin library,
Added simple return line, so the code looks like this:


{
  let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
  xdmp:database-backup(
xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )
  return document { "Done"}
};

But still the same error on trying to install it.
Is there something else that should be returned here?

Ernest Gulik

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Tuesday, October 20, 2015 4:45 PM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER) - when installing rest-api extension for backups in MarkLogic 7

Additionally, there is no need to import the admin library.

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Tuesday, October 20, 2015 2:40 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER) - when installing rest-api extension for backups in MarkLogic 7

It looks like your function has a syntax error in it:

let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
  xdmp:database-backup(
(:xdmp:database-forests(xdmp:database($dbname)), $s3bucket ):)
xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )


It is missing the return after the let statements.

-Danny

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Tuesday, October 20, 2015 2:26 PM
To: general@developer.marklogic.com<mailto:general@developer.marklogic.com>
Subject: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER) - when installing rest-api extension for backups in MarkLogic 7

Hello everyone,
There's simple xquery function for backups that works pretty great.
I wanted to automate it, knowing that we can install new extensions.
My code, error and command can be found on 
stackoverflow<http://stackoverflow.com/questions/33246818/marklogic-7-database-backup-with-rest-api>.
I didn't want to create another copy of my post.
If anyone has some suggestions as to what could be causing 
RESTAPI-INVALIDCONTENT: (err:FOER)
I would greatly appreciate it.
Is such thing even supported in ML7?
Digging through bunch of other functions under /opt/MarkLogic seems like this 
should work
but I can't seem to find anything about that anywhere in documentation.

Thank you,
Ernest Gulik

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


Re: [MarkLogic Dev General] Data out of sync

2015-10-15 Thread Danny Sokolsky
I think you want to do an fn:doc of the URI, not an xdmp:directory.  
xdmp:directory returns all of the documents in that directory, and since that 
is not a directory, there ar no documents in the directory and it returns 
nothing.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gary Larsen
Sent: Thursday, October 15, 2015 11:40 AM
To: 'General MarkLogic Developer Discussion'
Subject: [MarkLogic Dev General] Data out of sync

Ran into a case where database data seems to be jumbled.  This query returns a 
path to a document:

let $find := "CAMID(default:u:authid=3667487167)/folder[@name='My 
Folders']/report[@name='A Test1 - Order Summary']"
let $cq :=
cts:and-query((
  cts:collection-query('content'),
  cts:element-value-query(xs:QName('searchPath'), $find)
))
for $c in cts:search(doc(), $cq, 'unfiltered')  return xdmp:node-uri($c)
which returns:   
/db/netvisn/content/sub120/i01E150D89282419FBAD072EB4992D289.xml

But this query has no results:

xdmp:directory('/db/netvisn/content/sub120/i01E150D89282419FBAD072EB4992D289.xml')

Ran a reindex on the database but this did not help.  I was thinking about 
doing an export and import but in some folders the documents have a collection 
assigned and not sure if that can be imported.

Any ideas what may be going on?   This is a v5 or v6 database as I've been 
reluctant to upgrade and reindex, and things were working great.

Thanks,
Gary

___
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 Danny Sokolsky
If what you want to do is script admin tasks, I would recommend using the REST 
API:

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

You can then call that from a shell script using curl or something similar, 
including all of your favorite scripting languages.  The REST api has all of 
the best practices built in.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 7:23 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Thank you for all your responses.
Installation is straight from ML ec2 template, so nothing complicated.
I was trying to figure it out how to script db backups (and other maintenance 
tasks) using command line.
Scripted, because I have a little more control/monitoring in that way.
I have few xqueries that are working fine from qconsole but I want to do as 
less manual tasks as possible.

I might just play around curl with POST and authentication and see how that 
goes since cqsh is not maintain anymore.
Is there command line tool for MarkLogic that is maintained and working? :)
What built-in tools I could use to automate backups, user creation & assigning 
roles, renaming forest?
These exact tasks I'm doing with xqueries (super simple) and just wanted them 
automated.


Ernest Gulik

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Geert Josten
Sent: Thursday, October 08, 2015 1:47 AM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

A simple curl --anyauth --user {user}:{pass} http://localhost:8001 might be a 
good test as well.

Are you sure you are running the command from the same server on which you 
installed MarkLogic? You can typically check that using something like `sudo 
service MarkLogic status`. That will also tell you whether MarkLogic service is 
up and running.

Kind regards,
Geert

From: 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of Danny Sokolsky 
<danny.sokol...@marklogic.com<mailto:danny.sokol...@marklogic.com>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: Thursday, October 8, 2015 at 12:51 AM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Also, cqsh is a super-old project that has not been touched in a very long time.

What is it you are trying to do?  You might try some of the built-in marklogic 
tools or a newer project.

-Danny

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of David Lee
Sent: Wednesday, October 07, 2015 3:36 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

You do not want to use the elb, just checking you were not.
What your issue is could be many things , as many as there are ways to 
configure AWS x ML

If you provide some details on how exactly Howe you installed ML, ec2, and what 
your ec2 configuration is like,( vpc, network interfaces, using cluster manager 
or not , mounted devices  )  plus any errors or success logs from 
/var/log/messages and ErrorLog.txt , results from the admin GUI that may help.






Sent from my iPad
David A Lee
d...@marklogic.com<mailto:d...@marklogic.com>


On Oct 7, 2015, at 2:55 PM, Gulik, Ernest 
<egu...@aha.org<mailto:egu...@aha.org>> wrote:
Thank you for the quick reply.
Not to ELB,
I'm connecting to private ip address of ec2.
I deployed ML on ec2, downloaded & configured cqsh and followed the guide to 
execute the command.
I can't imagine that this would have to be done through ELB since daemon is 
listening on 0.0.0.0.



Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of David Lee
Sent: Wednesday, October 07, 2015 4:45 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux


are you connecting to the elb or the ec2 up?

Sent from my iPhone

On Oct 7, 2015, at 2:16 PM, Gulik, Ernest 
<egu.

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

2015-10-08 Thread Danny Sokolsky
There are a lot more REST calls in MarkLogic 8.  A good excuse to upgrade :)

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 3:33 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

This post is for ML8 not ML7.
If there are new calls in guide for ML8 then will they work in ML7 and 
documentation is simply not updated?
Should just ignore it and focus on documentation for ML8 guide even though I'm 
working on ML 7?

Ernest Gulik

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, October 08, 2015 5:27 PM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Here is how to backup using REST:

http://docs.marklogic.com/REST/POST/manage/v2/databases/%5Bid-or-name%5D#BackupDB

I'm not sure about renaming a forest.

-Danny

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 3:01 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

I'm going through documentation and it doesn't seem like it's possible to 
simply rename forest.
There are tons of options (clear | merge | restart | attach | detach | retire | 
employ | delete) but no simple rename like I have this xquery:


xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin;
  at "/MarkLogic/admin.xqy";

let $config := admin:forest-rename(admin:get-configuration(), 
98869316759288, "forest-name")
return admin:save-configuration($config)

Is that true that you can't rename forest using REST API?
It doesn't seem like that there's a corresponding REST API call to xquery 
function: forest-rename or maybe I'm missing something?
I thought that maybe this will just work and based on "PUT 
/manage/v2/forests/{id|name}/properties" I tried:

$ cat forest-name.xml
http://marklogic.com/manage;>
 blaa


$ curl --anyauth --user user:password -X PUT -d @./forest-name.xml -i -H 
"Content-type: application/xml" 
http://127.0.0.1:8002/manage/v2/forests/forest-name/properties
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", 
nonce="16f0b33722bdc4ec775e5afca46da21d", opaque="16f244e1594b02d7"
Content-type: application/xml
Server: MarkLogic
Content-Length: 173
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 400 Bad Request
Content-type: application/xml
Server: MarkLogic
Content-Length: 311
Connection: Keep-Alive
Keep-Alive: timeout=5

http://marklogic.com/manage;>
  400
  Bad Request
  MANAGE-INVALIDPAYLOAD
  MANAGE-INVALIDPAYLOAD: (err:FOER) Payload has errors in 
structure, content-type or values. Cannot validate payload.


User/password is correct because this call works fine:

$ curl -s --anyauth --user user:password -X GET -H "Accept: application/xml" 
http://localhost:8002/manage/v2/forests/forest-name

I tried all 8** ports and localhost as well. I'm stumped.
It doesn't seem like there are API calls for issuing backups of databases. 
(Creating, deleting but not simply backup).
Is it possible to use our xqueries as input to REST API calls, for example?
    -d @xquery-file.file  http:///manage/xquery



Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 1:14 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Nice,
This seems very promising.
I'll dig into that then.
I have to say that I'm surprised from the speed of responses here, really!
I really appreciate your support. This is awesome!
Thank you!


Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, October 08, 2015 1:01 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection inf

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

2015-10-08 Thread Danny Sokolsky
You can always create a resourse extension in MarkLogic 7 to fill in the gaps 
or to do custom things:

http://docs.marklogic.com/7.0/guide/rest-dev/extensions

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 3:40 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Upgrade is not an option here, so I guess we can't fully automate 
Administrative tasks in ML 7.


Ernest Gulik

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, October 08, 2015 5:35 PM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

There are a lot more REST calls in MarkLogic 8.  A good excuse to upgrade :)

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 3:33 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

This post is for ML8 not ML7.
If there are new calls in guide for ML8 then will they work in ML7 and 
documentation is simply not updated?
Should just ignore it and focus on documentation for ML8 guide even though I'm 
working on ML 7?

Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, October 08, 2015 5:27 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Here is how to backup using REST:

http://docs.marklogic.com/REST/POST/manage/v2/databases/%5Bid-or-name%5D#BackupDB

I'm not sure about renaming a forest.

-Danny

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 3:01 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

I'm going through documentation and it doesn't seem like it's possible to 
simply rename forest.
There are tons of options (clear | merge | restart | attach | detach | retire | 
employ | delete) but no simple rename like I have this xquery:


xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin;
  at "/MarkLogic/admin.xqy";

let $config := admin:forest-rename(admin:get-configuration(), 
98869316759288, "forest-name")
return admin:save-configuration($config)

Is that true that you can't rename forest using REST API?
It doesn't seem like that there's a corresponding REST API call to xquery 
function: forest-rename or maybe I'm missing something?
I thought that maybe this will just work and based on "PUT 
/manage/v2/forests/{id|name}/properties" I tried:

$ cat forest-name.xml
http://marklogic.com/manage;>
 blaa


$ curl --anyauth --user user:password -X PUT -d @./forest-name.xml -i -H 
"Content-type: application/xml" 
http://127.0.0.1:8002/manage/v2/forests/forest-name/properties
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", 
nonce="16f0b33722bdc4ec775e5afca46da21d", opaque="16f244e1594b02d7"
Content-type: application/xml
Server: MarkLogic
Content-Length: 173
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 400 Bad Request
Content-type: application/xml
Server: MarkLogic
Content-Length: 311
Connection: Keep-Alive
Keep-Alive: timeout=5

http://marklogic.com/manage;>
  400
  Bad Request
  MANAGE-INVALIDPAYLOAD
  MANAGE-INVALIDPAYLOAD: (err:FOER) Payload has errors in 
structure, content-type or values. Cannot validate payload.


User/password is correct because this call works fine:

$ curl -s --anyauth --user user:password -X GET -H "Accept: application/xml" 
http://localhost:8002/manage/v2/forests/forest-name

I tried all 8** ports and localhost as well. I'm stumped.
It doesn't seem like there are API calls for issuing backups of databases. 
(Creating, deleting but not simply backup).
Is it possible to use our xqueries as input to REST API calls, for example?
    -d @xquery-file.file  http://

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

2015-10-08 Thread Danny Sokolsky
Here is how to backup using REST:

http://docs.marklogic.com/REST/POST/manage/v2/databases/%5Bid-or-name%5D#BackupDB

I'm not sure about renaming a forest.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 3:01 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

I'm going through documentation and it doesn't seem like it's possible to 
simply rename forest.
There are tons of options (clear | merge | restart | attach | detach | retire | 
employ | delete) but no simple rename like I have this xquery:


xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin;
  at "/MarkLogic/admin.xqy";

let $config := admin:forest-rename(admin:get-configuration(), 
98869316759288, "forest-name")
return admin:save-configuration($config)

Is that true that you can't rename forest using REST API?
It doesn't seem like that there's a corresponding REST API call to xquery 
function: forest-rename or maybe I'm missing something?
I thought that maybe this will just work and based on "PUT 
/manage/v2/forests/{id|name}/properties" I tried:

$ cat forest-name.xml
http://marklogic.com/manage;>
 blaa


$ curl --anyauth --user user:password -X PUT -d @./forest-name.xml -i -H 
"Content-type: application/xml" 
http://127.0.0.1:8002/manage/v2/forests/forest-name/properties
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", 
nonce="16f0b33722bdc4ec775e5afca46da21d", opaque="16f244e1594b02d7"
Content-type: application/xml
Server: MarkLogic
Content-Length: 173
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 400 Bad Request
Content-type: application/xml
Server: MarkLogic
Content-Length: 311
Connection: Keep-Alive
Keep-Alive: timeout=5

http://marklogic.com/manage;>
  400
  Bad Request
  MANAGE-INVALIDPAYLOAD
  MANAGE-INVALIDPAYLOAD: (err:FOER) Payload has errors in 
structure, content-type or values. Cannot validate payload.


User/password is correct because this call works fine:

$ curl -s --anyauth --user user:password -X GET -H "Accept: application/xml" 
http://localhost:8002/manage/v2/forests/forest-name

I tried all 8** ports and localhost as well. I'm stumped.
It doesn't seem like there are API calls for issuing backups of databases. 
(Creating, deleting but not simply backup).
Is it possible to use our xqueries as input to REST API calls, for example?
    -d @xquery-file.file  http:///manage/xquery




Ernest Gulik

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 1:14 PM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Nice,
This seems very promising.
I'll dig into that then.
I have to say that I'm surprised from the speed of responses here, really!
I really appreciate your support. This is awesome!
Thank you!


Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, October 08, 2015 1:01 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

If what you want to do is script admin tasks, I would recommend using the REST 
API:

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

You can then call that from a shell script using curl or something similar, 
including all of your favorite scripting languages.  The REST api has all of 
the best practices built in.

-Danny

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 7:23 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Thank you for all your responses.
Installation is straight from ML ec2 template, so nothing complicated.
I was trying to figure it out how to script db backups (and other maintenance 
tasks) using command line.
Scripted, because I have a little more control/monitoring in that way.
I have few xqueries that are working fine from qconsole but I want to do as 
less manual tasks as possible.

I might just play around curl with POST and auth

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

2015-10-07 Thread Danny Sokolsky
Also, cqsh is a super-old project that has not been touched in a very long time.

What is it you are trying to do?  You might try some of the built-in marklogic 
tools or a newer project.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of David Lee
Sent: Wednesday, October 07, 2015 3:36 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

You do not want to use the elb, just checking you were not.
What your issue is could be many things , as many as there are ways to 
configure AWS x ML

If you provide some details on how exactly Howe you installed ML, ec2, and what 
your ec2 configuration is like,( vpc, network interfaces, using cluster manager 
or not , mounted devices  )  plus any errors or success logs from 
/var/log/messages and ErrorLog.txt , results from the admin GUI that may help.






Sent from my iPad
David A Lee
d...@marklogic.com


On Oct 7, 2015, at 2:55 PM, Gulik, Ernest 
> wrote:
Thank you for the quick reply.
Not to ELB,
I'm connecting to private ip address of ec2.
I deployed ML on ec2, downloaded & configured cqsh and followed the guide to 
execute the command.
I can't imagine that this would have to be done through ELB since daemon is 
listening on 0.0.0.0.



Ernest Gulik

From: 
general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of David Lee
Sent: Wednesday, October 07, 2015 4:45 PM
To: MarkLogic Developer Discussion 
>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux


are you connecting to the elb or the ec2 up?

Sent from my iPhone

On Oct 7, 2015, at 2:16 PM, Gulik, Ernest 
> wrote:
Hi All,
I'm trying to test cqsh tool with ML7 on Amazon Linux ec2 but for some reason I 
get invalid connection Error and did try all combinations that I can came up 
with but still nothing.
Normally I can access query console on port 8000 but not through this cli:

$ cqsh -u  -p  -H  -P 8000
Failed to connect to Mark Logic. Invalid connection information.
Error: Connection failed
Goodbye.

I tried localhost, loopback ip and all ports 8001-..9 ports that are used by 
the application but no luck.
Can someone point me as to what could be the issue here?


Thank you,
Ernest Gulik

___
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] path range index

2015-08-18 Thread Danny Sokolsky
Hi Paul,

Try cts:values:

http://docs.marklogic.com/cts:values

You can use it for any kind of range index.  You pass it a cts:reference for 
the path index:

http://docs.marklogic.com/cts:path-reference

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Paul M
Sent: Tuesday, August 18, 2015 10:28 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] path range index

Suppose I want all the values for a specific path range index.
Normally, I would use cts:element-values and cts:frequencey on a range index. 
How would I do this on a path range index, if possible.


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


Re: [MarkLogic Dev General] How to force a user to change password if the last password change date is more than 90days

2015-08-14 Thread Danny Sokolsky
There is an api sec:user-set-password-extra and the corresponding getter:

http://docs.marklogic.com/sec:user-set-password-extra

http://docs.marklogic.com/sec:user-get-password-extra

That allows you to squirrel away information in the password document stored in 
the secutity database.  You can use this to key some logic off of.  For 
example, you can put the current date in the sec:password-extra element, then 
write a plugin that tests for how long it has been.  I don't have any code that 
does that off the top of my head, but I think you should be able to write that.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Sudheer Yalaverthi
Sent: Friday, August 14, 2015 11:32 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] How to force a user to change password if the 
last password change date is more than 90days

Hi,

On my application server, I would like to enforce a password change for every 
90days. If a user tries to access the app server or any resources on this 
server, I would like to be able to show a message that password is expired 
(though there is no password expiry in MarkLogic)  as last change date is more 
than 90days.

MarkLogic by default does not capture the last password change date but I 
captured it using a password plug-in with an element password-lastchangedon as 
child to password- extra element.
I would like to use the authentication scheme as basic but still be able to 
validate this value whenever a user tries to login.

Plug-ins registered under http://marklogic.com/xdmp/security/password-check are 
invoked only when passwords are updated.
Is there a way I can achieve to validate the last change date with basic scheme 
of authentication whenever a user tries to login to the app server?




Regards,
Sudheer Yalaverthi



---
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


Re: [MarkLogic Dev General] 32 bit server installation

2015-08-11 Thread Danny Sokolsky
MarkLogic requires a 64-bit platform in 6.0 and later versions.

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of SNEHASISH DUTTA
Sent: Tuesday, August 11, 2015 7:57 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] 32 bit server installation

Hi All,

I need an help, earlier I saw 32 bit MarkLogic server was available with 
version 6.
I couldn't find it out @ the website.

I have an urgen requirement please let me know from where I can download 
MarkLogic 32bit version.

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


Re: [MarkLogic Dev General] Supported character encodings

2015-08-06 Thread Danny Sokolsky
You can specify a character encodings in that encoding-option with any of the 
encodings documented here:

http://docs.marklogic.com/guide/search-dev/encodings_collations#id_40354

Auto attempts to guess the encoding, but sometimes it can be ambiguous so it 
might not get it right.

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of 
juergen.ritschka-kohl
Sent: Thursday, August 06, 2015 7:12 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Supported character encodings



Hi,

one of our customer wants to have a list of supported encodings for the 
xdmp:document-get - Function.
The encoding-option is set to “auto” and now he wants to know which encodings 
are supported. We have documents in English, German and French.

Is there somewhere such a list - we were not able to find a complete list in 
the web.

Many thanks
Jürgen

--
Ing. Jürgen Ritschka-Kohl
Principal Consultant

EBCONT enterprise technologies GmbH
Millennium Tower
Handelskai 94-96
1200 Wien

Mobil: +43 664 60651599
Fax: +43 2772 512 69-9
Email: 
juergen.ritschka-k...@ebcont.commailto:juergen.ritschka-k...@ebcont-et.com
Web: http://www.ebcont.comhttp://www.ebcont-et.com/

OUR TEAM IS YOUR SUCCESS


HG St. Pölten - FN 293731 h
UID: ATU63444589



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


Re: [MarkLogic Dev General] How to escape ${} in document-insert

2015-08-03 Thread Danny Sokolsky
You can escape curly brackets in XQuery with another of the same type of curly 
brackets.  For example:

let $s := foo${{bar}}/foo
return
xdmp:document-insert(/test.xml, $s);

doc(/test.xml)

=
?xml version=1.0 encoding=UTF-8?
foo${bar}/foo

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Jenny Wang
Sent: Monday, August 03, 2015 2:33 PM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] How to escape ${} in document-insert


Classification: Public
I need to insert a document to ML, the document has something like 
${error_message} which ML takes it as a defined variable. How can I escape this?


Jenny



---
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


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

2015-07-30 Thread Danny Sokolsky
The result of your search is a sequence of documents.  I think you want to 
xpath down to audience for each document in your FLOWR.  Something like:

for $audience in $these-docs//ec:audience
order by $audience/@audience
return $audience/fn:string()

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Kari Cowan
Sent: Thursday, July 30, 2015 11:44 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Sorting and De-duping

I have a query that returns a group of records.

I want to display a sorted list of results of a node called 'audience' - there 
can be multiple audience nodes in a document.

Here's a snippet and result list, to put it in context.

Am I missing something obvious?


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 $audiences in $these-docs
order by fn:data($audiences//ec:audience/@audience)
return $audiences//ec:audience/text()



Consulting
Entertainment
Food and Beverage
Consulting
Health Care/Medical
Insurance
Automotive
Real Estate
Transportation/Aviation
Education
Food and Beverage
Health Care/Medical


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


Re: [MarkLogic Dev General] ML 8 Error Handler Non-Execution | Unauthorized User

2015-07-28 Thread Danny Sokolsky
Have you looked at your rewriter too?  Maybe the 401 is for the rewriter, not 
the error handler?

Another clue might come from the AccessLog for that app server.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Rahul Gupta
Sent: Tuesday, July 28, 2015 9:55 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] ML 8 Error Handler Non-Execution | 
Unauthorized User

Hi,

I am currently migrating my ML 6.0-5.3 code to ML 8.0-3 and I found that 
error-handler for the App-server is not being executed when an unauthorized 
user logs in. I did some research and came to this link:
https://docs.marklogic.com/guide/app-dev/appserver-control#id_84264

But this link has no change as compared to ML 6 documentation and it was doing 
custom error handling for an unauthorized-user.
https://docs.marklogic.com/6.0/guide/app-dev/appserver-control#id_84264

[cid:image001.png@01D0C926.73134F90]

And in error-handler.xqy, it is written like as follows:

let $error as element(e:error) :=
  if ( fn:exists($error:errors) ) then
local:handle-thrown-exception()
  else
local:handle-general-error()

Also, the app-server default user is assigned with admin role and default error 
format in ML 8 as xml tried using html, json, compatible. Hence it has the 
execute permissions too. Still Not working... Can anyone please suggest how to 
throw custom message for an unauthorized user from the error handler mechanism.

Currently I am getting is:

error-response xmlns='http://marklogic.com/xdmp/error'
 status-code401/status-code
 statusUnauthorized/status
 message401 Unauthorized/message
/error-response

Thanks,
Rahul
___
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-14 Thread Danny Sokolsky
Thanks Andreas, and thanks Geert.

Another way to get around this is to pass an empty and-query to the word 
lexicon call.  Something like:

cts:element-words(xs:QName(title), , (), cts:and-query( () ) )

That is not needed for range index lexicon calls, but appears to be needed for 
word lexicon calls in order to filter out deleted fragments when running as a 
user with the admin role.

I filed a bug on this end for this behavior as I don't think you should need to 
do that.  At any rate, pass in the empty and-query (which matches everything) 
and that will solve your issue.

Thanks,
-Danny 

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Andreas Hubmer
Sent: Tuesday, July 14, 2015 12:27 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] element-word-match

Hi,

In my applications I never use the admin role. But in the unit tests it is 
acceptable for me because there I it would often mean more work to switch users 
between setup/tearDown and the actual tests (the application user does not have 
all the rights needed for the test setup). My security model is tested in 
separate integration tests with the application user.

I've boiled the problem down to the following steps:
1) create an element word lexicon for title
2) Insert and afterwards delete a document:
xquery version 1.0-ml;
xdmp:document-insert(/tmp.xml, 
                document
                        titlepuzzling/title            
                /document, 
                xdmp:permission(some-non-admin-role, read))
;
xdmp:document-delete(/tmp.xml)
3) Run a lexicon query (cts:element-words or cts:element-word-match for *):
cts:element-words(xs:QName(title))

Geert, as you said, the problem concerns only the admin user. Running the 
lexicon query with some-non-admin-role returned an empty sequence.

In my unit tests I'll try to use xdmp:merge with the current request timestamp 
as workaround. This should help at least on the Linux cluster. But on my local 
Windows machine merging did not help.

I guess the reason for this anomaly is performance for the admin role. But for 
me it is unexpected behaviour. Performance should not outplay correctness.

That said, thanks a lot for your support!

Best regards,
Andreas


2015-07-14 1:07 GMT+02:00 Danny Sokolsky danny.sokol...@marklogic.com:
I don’t think that it should make a difference running as admin.  I think that 
used to be the case but it has worked that way for quite a while.
 
Andreas, do you have a simple test case you can share that shows this?
 
Thanks,
-Danny
 
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Geert Josten
Sent: Monday, July 13, 2015 11:26 AM
To: MarkLogic Developer Discussion

Subject: Re: [MarkLogic Dev General] element-word-match
 
I can’t tell exactly either, but your observations could be right that it only 
occurs with word and value lexicon lookups. Those start with values, and only 
look at fragments later (if you provide a cts:query for instance). A cts:search 
starts with fragments, so easier to ignore deleted fragments from the start..
 
Again, this is a rare anomaly, only observed with admin user. Normal 
applications should never run with admin user. It is a good practice to always 
look for a customized security model that hands out as little privileges as 
possible to users directly..
 
Cheers,
Geert
 
From: general-boun...@developer.marklogic.com on behalf of Andreas Hubmer 
andreas.hub...@ebcont.com
Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
Date: Monday, July 13, 2015 at 5:26 PM
To: MarkLogic Developer Discussion general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] element-word-match
 
Can you elaborate on Deleted fragments are only visible to admin ? In what 
case are deleted fragments visible to the admin? 
So far I haven't seen deleted fragments in query results, except for the 
lexicon lookup with cts:element-word-match. In two additional tests I've just 
seen that 
* words of deleted fragments are returned by cts:element-words
* words of deleted fragments are not considered in estimations of search result 
sizes: xdmp:estimate(cts:search(doc(), 
cts:element-word-query(xs:QName(title), Test), unfiltered))
 
So, in the case of an unfiltered query deleted fragments are not visible any 
more, but in the case of lexicon lookups the deleted fragments seem to be 
visible. This is still puzzling to me.
 
Cheers,
Andreas
 
2015-07-13 16:14 GMT+02:00 Geert Josten geert.jos...@marklogic.com:
Deleted fragments are only visible to admin, as security is bypassed for that 
user. That also gives you a slight performance gain. As a general rule of 
thumb, never run tests as admin..
 
Cheers,
Geert
 
From: general-boun...@developer.marklogic.com on behalf of Andreas Hubmer 
andreas.hub...@ebcont.com
Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
Date

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

2015-07-13 Thread Danny Sokolsky
I don't think that it should make a difference running as admin.  I think that 
used to be the case but it has worked that way for quite a while.

Andreas, do you have a simple test case you can share that shows this?

Thanks,
-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Geert Josten
Sent: Monday, July 13, 2015 11:26 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] element-word-match

I can't tell exactly either, but your observations could be right that it only 
occurs with word and value lexicon lookups. Those start with values, and only 
look at fragments later (if you provide a cts:query for instance). A cts:search 
starts with fragments, so easier to ignore deleted fragments from the start..

Again, this is a rare anomaly, only observed with admin user. Normal 
applications should never run with admin user. It is a good practice to always 
look for a customized security model that hands out as little privileges as 
possible to users directly..

Cheers,
Geert

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 on behalf of Andreas Hubmer 
andreas.hub...@ebcont.commailto:andreas.hub...@ebcont.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Monday, July 13, 2015 at 5:26 PM
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] element-word-match

Can you elaborate on Deleted fragments are only visible to admin ? In what 
case are deleted fragments visible to the admin?
So far I haven't seen deleted fragments in query results, except for the 
lexicon lookup with cts:element-word-match. In two additional tests I've just 
seen that
* words of deleted fragments are returned by cts:element-words
* words of deleted fragments are not considered in estimations of search result 
sizes: xdmp:estimate(cts:search(doc(), 
cts:element-word-query(xs:QName(title), Test), unfiltered))

So, in the case of an unfiltered query deleted fragments are not visible any 
more, but in the case of lexicon lookups the deleted fragments seem to be 
visible. This is still puzzling to me.

Cheers,
Andreas

2015-07-13 16:14 GMT+02:00 Geert Josten 
geert.jos...@marklogic.commailto:geert.jos...@marklogic.com:
Deleted fragments are only visible to admin, as security is bypassed for that 
user. That also gives you a slight performance gain. As a general rule of 
thumb, never run tests as admin..

Cheers,
Geert

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 on behalf of Andreas Hubmer 
andreas.hub...@ebcont.commailto:andreas.hub...@ebcont.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Monday, July 13, 2015 at 4:05 PM
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] element-word-match

xdmp:merge with merge-timestamp{xdmp:request-timestamp()}/merge-timestamp 
does not make a difference on my local Windows machine. Afterwards there are 
still deleted fragments in the database.

I've also tested it on a Linux cluster and there xdmp:merge with 
merge-timestamp{xdmp:request-timestamp()}/merge-timestamp does indeed 
remove the deleted fragments. Afterwards cts:element-word-match returns the 
expected empty list.

Nevertheless I am surprised that cts:element-word-match returns values from 
deleted fragments.

Cheers,
Andreas

2015-07-13 15:42 GMT+02:00 Christopher Hamlin 
cbham...@gmail.commailto:cbham...@gmail.com:
On Mon, Jul 13, 2015 at 9:30 AM, Andreas Hubmer
andreas.hub...@ebcont.commailto:andreas.hub...@ebcont.com 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.commailto:General@developer.marklogic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general



--
Andreas Hubmer
IT Consultant

EBCONT enterprise technologies GmbH
Millennium Tower
Handelskai 94-96
A-1200 Vienna

Mobile: +43 664 60651861tel:%2B43%20664%2060651861
Fax: +43 2772 512 69-9
Email: andreas.hub...@ebcont.commailto:andreas.hub...@ebcont.com
Web: http://www.ebcont.com

OUR TEAM IS YOUR SUCCESS

UID-Nr. ATU68135644
HG St.Pölten - FN 399978 d

___
General mailing list

Re: [MarkLogic Dev General] Generating Reports in ML

2015-06-18 Thread Danny Sokolsky
If you already have a document, you can use something like 
xdmp:node-insert-after to insert a sibling node.

Or if you only have less than 1000 records, then it is probably small enough 
to just do that all in one go by using xdmp:document-insert.   Just be 
careful-generally speaking, you do not want to do the search and the update in 
the same transaction (because it will create a read lock on all of the 
documents you are searching).  Do the search gathering your results, and then 
hand that off to another request to do the insert.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Kari Cowan
Sent: Thursday, June 18, 2015 1:56 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Generating Reports in ML

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?

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Kari Cowan
Sent: Thursday, June 18, 2015 8:47 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Generating Reports in ML

I have a query that returns a set of results for a single record.  I want to 
loop through all records (under 1000 records), and create a spreadsheet or 
document.

Assume I could do a search on cts:search(xdmp:directory(/olympus/scope-xml/), 
and then a value query on a node called Coporate_Profile_ID  - that would 
return the id's I want below.

How would I then create the report? (tips on efficient code tips to return the 
id's are appreciated as well)

Below is my query and sample results for 1 record.  Any suggestions?


xquery version 1.0-ml;

declare namespace olympus = http://www.alm.com/olympus;;
declare namespace this = this;
import module namespace scope=http://alm.com/modules/scope; at 
olympus/modules/scope.xqy;
import module namespace pacer = http://alm.com/modules/pacer; at 
olympus/modules/pacer.xqy;

(:450075101|450040301|450033801|450025401:)

let $id:=450025401
let $sub-ids:=  scope:build-id-sub-list($id)
let $cases:=pacer:get-cases($sub-ids,)
let $profile:=scope:fetch-profile($id,,0,-1,0,0,,,)

let $fields:=$profile//(
Coporate_Profile_ID|
Main_Details/Company_Name|
Main_Details/No_of_Subsidiaries)


let $subsidiaries:=$profile//Subsidiaries
let $subs:=
for $sub in $subsidiaries/Subsidiary
let $name:=$sub/Subsidiary_name
let $id:=$sub/Subsidiary_Profile_ID
let $count:=pacer:get-cases($id/text(),)/@total

return Subsidiary{$name}{$id}case-count{$count}/case-count/Subsidiary

return Result
{$fields}
{$subs}
/Result


..
Result
Coporate_Profile_ID450025401/Coporate_Profile_ID
Company_NameAOL Inc./Company_Name
No_of_Subsidiaries13/No_of_Subsidiaries
Coporate_Profile_ID450025401/Coporate_Profile_ID
Coporate_Profile_ID/Coporate_Profile_ID
Subsidiary
Subsidiary_nameAdap.tv, Inc/Subsidiary_name
Subsidiary_Profile_ID450025404/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameAOL Advertising Inc/Subsidiary_name
Subsidiary_Profile_ID450025405/Subsidiary_Profile_ID
case-count total=2/case-count
/Subsidiary
Subsidiary
Subsidiary_nameAOL Advertising Inc/Subsidiary_name
Subsidiary_Profile_ID450025405/Subsidiary_Profile_ID
case-count total=2/case-count
/Subsidiary
Subsidiary
Subsidiary_nameAOL Canada Corp/Subsidiary_name
Subsidiary_Profile_ID450025406/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameAOL Holdings (Lux) S. r.l/Subsidiary_name
Subsidiary_Profile_ID450025409/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameAOL Internet Services Holdings Inc/Subsidiary_name
Subsidiary_Profile_ID450025407/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameAOL Israel Ltd/Subsidiary_name
Subsidiary_Profile_ID450025427/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameConvertro, Inc/Subsidiary_name
Subsidiary_Profile_ID450025428/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameGravity.com, Inc/Subsidiary_name
Subsidiary_Profile_ID450025429/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameMapQuest, Inc/Subsidiary_name
Subsidiary_Profile_ID450025410/Subsidiary_Profile_ID
case-count total=2/case-count
/Subsidiary
Subsidiary
Subsidiary_nameTechCrunch, Inc/Subsidiary_name
Subsidiary_Profile_ID450025414/Subsidiary_Profile_ID
case-count total=0/case-count
/Subsidiary
Subsidiary
Subsidiary_nameTheHuffingtonPost.com, Inc/Subsidiary_name
Subsidiary_Profile_ID450025415/Subsidiary_Profile_ID
case-count total=2/case-count
/Subsidiary
Subsidiary
Subsidiary_nameVidible, Inc./Subsidiary_name
Subsidiary_Profile_ID450025430/Subsidiary_Profile_ID
case-count total=0/case-count

Re: [MarkLogic Dev General] Migrating from ML 4.x to ML 8

2015-06-18 Thread Danny Sokolsky
Hi Fred,

I think doing this on a separate system that you can test outside of your old 
system is a good idea.

There are sort of 2 paths I can think of for you to choose from here.


1)  On your new system, start with 4.x and recreate your old system first, 
including all of the configuration and security database setup, and then 
upgrade.  If by 4.x you mean 4.2, the upgrade would be 4.2 - 4.2.latest - 
5.0.latest - 8.0.3 (or latest at the time).  If you do this, I would recommend 
turning reindexing off in your content database(s) before moving from 4.x, and 
then enabling it when you are running 8.

or


2)  Recreating your configuration on the new 8.0 machine (all of your 
databases, app servers, forests, users, custom roles, custom privileges, and so 
on).  Then restore your databases to the new system, then reindex.

The advantage of doing 1) is that it is easier to recreate your configuration.  
The advantage of 2) is that is it less upgrade steps (not that the upgrade 
steps are hard, they are not hard).  If your system is relatively simple, I 
would try 2) and see how that goes.

Is this a cluster or a single node?  If it is a cluster, you will need to 
recreate the host configurations as well.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Fred Seaton
Sent: Thursday, June 18, 2015 3:00 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Migrating from ML 4.x to ML 8

Hi,

We're in the process of migrating from MarkLogic 4.x to 8.x.  We're not 
interested in doing it in place, so I'm setting up a new server with 8.x and am 
planning to migrate the databases from the old server to the new.  Is there a 
documented set of procedures for doing this?  I've read about backup and 
restore, as well as the incompatibilities between the versions, but not much 
more.

Can anyone give me some guidance?

Thanks.

--
Fred Seaton
UNIX System Admin
Digital Library Development Center, University of Chicago Library



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


Re: [MarkLogic Dev General] Create Http Server Tutorial

2015-06-05 Thread Danny Sokolsky
Thanks for pointing that out Martin.

What you really want to do is put your application code somewhere outside of 
where the server is installed.  MarkLogic will look relative to the 
installation directory, but the best practice is to put your code either 
somewhere else on the filesystem (for example, in a directory named 
/space/mycode or c:/space/mycode) or in a modules datatbase.

That was just an error in the doc.  And the doc is fixed now:

http://docs.marklogic.com/guide/getting-started/xquery#id_70912

Thanks,
-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Martin Vollmix
Sent: Friday, June 05, 2015 2:55 AM
To: 'MarkLogic Developer Discussion'
Subject: Re: [MarkLogic Dev General] Create Http Server Tutorial

Hi Geert,

I tried various variations on my one, but not this one.

Now it works as expected. Thanks for taking care. Maybe the tutorial should be 
a little bit less vague about this. :)

Thanks

Martin

Von: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] Im Auftrag von Geert Josten
Gesendet: Freitag, 5. Juni 2015 11:50
An: MarkLogic Developer Discussion
Betreff: Re: [MarkLogic Dev General] Create Http Server Tutorial

Hi Martin,

Maybe the tutorial is a little vague about this, but if the full path of your 
load.xqy is C:\Program Files\MarkLogic\Apps\Test\load.xqy, then your Root 
should be Apps/Test, and the http url to it would be 
http://localhost:8005/load.xqy. I hope that clears things up for you..

Cheers,
Geert

From: Martin Vollmix voll...@hotmail.commailto:voll...@hotmail.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Friday, June 5, 2015 at 11:32 AM
To: 'MarkLogic Developer Discussion' 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] Create Http Server Tutorial

Hi Geert,

In the Create http Server Dialog: I just typed in Test like described in the 
tutorial.

I created a Test Directory in C:\Program Files\MarkLogic\Apps as described in 
the tutorial.

In the newly created Test Directory I put the xqy files into this directory

Thanks

Martin

Von: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] Im Auftrag von Geert Josten
Gesendet: Freitag, 5. Juni 2015 10:06
An: MarkLogic Developer Discussion
Betreff: Re: [MarkLogic Dev General] Create Http Server Tutorial

Hi Martin,

What did you specify as Root in your app server, and at which filesystem path 
did you put your load.xqy?

Cheers,
Geert

From: Martin Vollmer (hotmail) 
voll...@hotmail.commailto:voll...@hotmail.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Friday, June 5, 2015 at 9:32 AM
To: general@developer.marklogic.commailto:general@developer.marklogic.com 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: [MarkLogic Dev General] Create Http Server Tutorial

Dear MarkLogic Devs,

I started to create a http Server in MarkLogic 8 on Windows exactly following 
the steps in here:

http://docs.marklogic.com/guide/getting-started/xquery#id_70912

But when I try to call the xqy Files via http://localhost:8005/Test/load.xqy I 
always get a 404. I tried it on two different machines.

BTW I can access the xqy file when I am using 
http://localhost:8000/Test/load.xqy but then the Doc is stored in the 
AppServices DB.

Any Hints?

Martin Vollmer
Staufener Str. 6
81245 München
Tel.:   +49 89 354 5283
Mobil:   +49 176 993 994 38

___
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 Danny Sokolsky
Hi Kari,

I also see the different behavior on 7 and the latest 8.  There is a bug fix in 
my code not yet released, which is likely why it is working for me on the 
latest 8.

The problem is with the Month names.  There is a note in the documentation 
saying this does not always parse the month names.

The only workaround I can think of is to substitute in the month number for the 
month name, as that seems to work on 7.0-5.  But that might get you past the 
problem.

For example, this works on 7.0-5.1:

let $startdateTime := 05 28 2015
return
xdmp:parse-dateTime([M1] [D1] [Y0001], $startdateTime, en)

=
2015-05-28T00:00:00-07:00

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Kari Cowan
Sent: Thursday, May 28, 2015 2:24 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH: 
xdmp:parse-dateTime

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?

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, May 28, 2015 1:50 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH: 
xdmp:parse-dateTime

There are a number of bugs that have been fixed on xdmp:parse-dateTime since 
6.0-3.

This works in a recent 8.0 build:

xquery version 1.0-ml;

let $startdateTime:=May 28, 2015
return
fn:format-dateTime((xdmp:parse-dateTime([MNn] [D1], [Y0001],
xs:string( $startdateTime ) )), [Y0001]-[M01]-[D01] )



ð  2015-05-28

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Kari Cowan
Sent: Thursday, May 28, 2015 12:38 PM
To: general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH: xdmp:parse-dateTime

Ok, so my date input below is May 28, 2015, but my script below says my 
pattern doesn't match. I think it should but according to the comment in 
https://docs.marklogic.com/xdmp:parse-dateTime, as of 6.0-3.1 this function 
does not round-trip non-numeric values. For example 
format-dateTime(current-dateTime(), '[MN]') = JUNE but 
xdmp:parse-dateTime('[MN]', 'JUNE') throws XDMP-PATTERNVALUEMISMATCH.

I need to convert a date like May 28, 2015 to something like 2015-05-28 so 
that I can use it to compare dates as a part of a query.  What am I missing?  
Here's a scriptlet that illustrates the issue.



xquery version 1.0-ml;
declare namespace html = http://www.w3.org/1999/xhtml;;
declare namespace local=this;

declare function local:convert-date($startdateTime as xs:string) as node()*{
fn:format-dateTime((xdmp:parse-dateTime([MNn] 
[D1], [Y0001],
  xs:string( 
$startdateTime ) )),
  
[Y0001]-[M01]-[D01] )
};

declare variable $startdateTime as xs:string external;

let $startdateTime:=May 28, 2015

(:
return $startdateTime
:)

let $this-start-date:= local:convert-date($startdateTime)

  return $this-start-date




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.

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


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

2015-05-28 Thread Danny Sokolsky
There are a number of bugs that have been fixed on xdmp:parse-dateTime since 
6.0-3.

This works in a recent 8.0 build:

xquery version 1.0-ml;

let $startdateTime:=May 28, 2015
return
fn:format-dateTime((xdmp:parse-dateTime([MNn] [D1], [Y0001],
xs:string( $startdateTime ) )), [Y0001]-[M01]-[D01] )



ð  2015-05-28

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Kari Cowan
Sent: Thursday, May 28, 2015 12:38 PM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH: xdmp:parse-dateTime

Ok, so my date input below is May 28, 2015, but my script below says my 
pattern doesn't match. I think it should but according to the comment in 
https://docs.marklogic.com/xdmp:parse-dateTime, as of 6.0-3.1 this function 
does not round-trip non-numeric values. For example 
format-dateTime(current-dateTime(), '[MN]') = JUNE but 
xdmp:parse-dateTime('[MN]', 'JUNE') throws XDMP-PATTERNVALUEMISMATCH.

I need to convert a date like May 28, 2015 to something like 2015-05-28 so 
that I can use it to compare dates as a part of a query.  What am I missing?  
Here's a scriptlet that illustrates the issue.



xquery version 1.0-ml;
declare namespace html = http://www.w3.org/1999/xhtml;;
declare namespace local=this;

declare function local:convert-date($startdateTime as xs:string) as node()*{
fn:format-dateTime((xdmp:parse-dateTime([MNn] 
[D1], [Y0001],
  xs:string( 
$startdateTime ) )),
  
[Y0001]-[M01]-[D01] )
};

declare variable $startdateTime as xs:string external;

let $startdateTime:=May 28, 2015

(:
return $startdateTime
:)

let $this-start-date:= local:convert-date($startdateTime)

  return $this-start-date




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


Re: [MarkLogic Dev General] cts:element-values and fragment-frequency with multiple element names

2015-05-26 Thread Danny Sokolsky
When you specify multiple QNames, it just ORs them together, so this is what I 
would expect.



From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Andreas Hubmer
Sent: Tuesday, May 26, 2015 9:18 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] cts:element-values and fragment-frequency 
with multiple element names

Hi there,

Can anybody tell me whether this is a bug or a feature?

Thanks,
Andreas

2015-05-13 17:08 GMT+02:00 Andreas Hubmer 
andreas.hub...@ebcont.commailto:andreas.hub...@ebcont.com:
Hi,

cts:frequency returns unexpected values when called on an item retrieved with 
cts:element-values on multiple elements and the option fragment-frequency.

Let me give an example:
xquery version 1.0-ml;
(: an element range index is needed for both elements a and b :)
xdmp:document-insert(/test.xml,
  root
aA/a
aA/a
bA/b
  /root)
;
for $val in cts:element-values((xs:QName(a), xs:QName(b)), (), 
fragment-frequency)
  return $val || :  || cts:frequency($val)

I would expect that the fragment frequency of the value A is 1. But the 
result is 2 because MarkLogic seems to count the frequencies of the two 
elements a and b separately and return the sum.
When using item frequency the result is 3, as expected.

Is this a bug or a feature? In case of the latter it would be nice to document 
this behavior.

As a workaround, to get the real fragment frequency I will use a field range 
index and cts:field-values

Regards,
Andreas

--
Andreas Hubmer
IT Consultant

Email: andreas.hub...@ebcont.commailto:andreas.hub...@ebcont.com
Web: http://www.ebcont.com

OUR TEAM IS YOUR SUCCESS

UID-Nr. ATU68135644
HG St.Pölten - FN 399978 d

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


Re: [MarkLogic Dev General] bulk delete xquery syntax

2015-05-11 Thread Danny Sokolsky
Your save-configuration call has to wrap the config returned in your flwor 
expression.  Something like:

admin:save-configuration(
  admin:appserver-delete($config,admin:appserver-get-id($config, $groupid, 
secure2_app)) )

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of cyanline llc
Sent: Monday, May 11, 2015 11:40 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] bulk delete  xquery syntax

Hi,
  Getting started with XQuery so that I can bulk delete a bunch of applications 
and associated files, but stuck on xquery syntax error. And, I'm also 
wondering, can I make this call and delete more than 1 app server 
simultaneously? As well as the app-server's associated DB, modules, and forests?

  This is the code I'm trying to run, and I found it in the link below:

  xquery version 1.0-ml;

  import module namespace admin = 
http://marklogic.com/xdmp/admin;http://marklogic.com/xdmp/admin
  at /MarkLogic/admin.xqy;

  let $config := admin:get-configuration()
  let $groupid := admin:group-get-id($config, Default)
  return
  admin:appserver-delete($config,admin:appserver-get-id($config, $groupid, 
secure2_app))
  admin:save-configuration($config)

  (: returns the new configuration element -- use admin:save-configuration
 to save the changes to the configuration or pass the configuration
 to other Admin API functions to make other changes.  :)

- https://docs.marklogic.com/7.0/admin:appserver-delete

  and, the error:
[1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, 
unexpected QName_, expecting $end or SemiColon_
Stack Trace
At line 10 column 2:

In xdmp:eval( xquery version quot;1.0-mlquot;;#10;#10; import module 
na..., (), options 
xmlns=xdmp:evalisolationdifferent-transaction/isolationignore-ampstrue/i.../options)
8. return
9. admin:appserver-delete($config,admin:appserver-get-id($config, $groupid, 
secure2_app))
10. admin:save-configuration($config)
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] wildcarded search with cts:field-value-query

2015-05-11 Thread Danny Sokolsky
And you should be able to express that with the value query by making your 
wildcarded expression something like:

dev* *

The first star means matches zero or more chars in that word, and the second * 
means matches zero or more words in the value.  So that could match the 
following values:

developer world
devops

but would not match:

a developer’s world

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Lanz
Sent: Monday, May 11, 2015 7:54 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] wildcarded search with 
cts:field-value-query

Hi Florent,

Thanks I understand the difference, actually we want to match word (and part of 
word) wherever they it is located in the value of the field.
The cts:field-word-query is the right option in our case.

Regards
Lancelot

On Mon, May 11, 2015 at 1:11 PM, Florent Georges 
li...@fgeorges.orgmailto:li...@fgeorges.org wrote:
  Hi Lancelot,

  Is the text you try to match the entire value of the element it is
part of?  Like the difference between:

titleDevelopment is .../title

and:

titleThe development is .../title

  In the first case, it will match both queries (thanks to the
wildcard at the end of the search term).  In the second case, it will
match only the word search (which matches words as in a search
engine), not the value search (which matches elements values, like
entire values).

  Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 11 May 2015 at 12:47, Lanz wrote:
 hi all,

 I'm facing an issue using cts:field-value-query with wildcarded search in ML
 7.0-5
 Following search should match any field starting with 'dev' like
 development, etc.

 let $term := 'dev'
 return
 cts:search(
 fn:collection()/l:manifestation[l:issn],
 cts:field-value-query(
 'field-quick-search',
 $term || '*',
('case-insensitive', 'diacritic-insensitive', 'unstemmed',
 'wildcarded')
 )
)
 But its returns nothing

 Fields 'field-quick-search' seems to be well configured to work with
 wildcarded search:
 Name: field-quick-search
 Path: *:title, *:subTitle, *:doiSuffix, *:code, *:userCode, *:issn, @id
 Includes: work, expression, manifestation
 Excludes (nothing)
 Index Settings: +word, +fast phrase, +fast case sensitive, +fast diacritic
 sensitive, +trailing wildcard, +three character, +two character

 The same search with cts:field-word-query works :
 let $term := 'dev'
 return
 cts:search(
 fn:collection()/l:manifestation[l:issn],
 cts:field-word-query(
 'field-quick-search',
 $term || '*',
('case-insensitive', 'diacritic-insensitive', 'unstemmed',
 'wildcarded')
 )
)

 Any thoughts on what I might be doing wrong?
 Thanks
 Lancelot

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

___
General mailing list
General@developer.marklogic.commailto: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] Preserving document collection membership

2015-04-16 Thread Danny Sokolsky
I think this really has to do with what the webdav client is doing.  If you 
look in the access log for the webdav server, you can see what requests it is 
making.  Most webdav clients will make an update by inserting a new document.  
When you insert a new document, it will put all of the collections and 
permissions as the defaults.  So the real way to fix this I think is to have 
the webdav client do something different.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Geert Josten
Sent: Thursday, April 16, 2015 11:35 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Preserving document collection membership

Looks like it is an old RFE that is listed as fixed. Let me ask internally..

Cheers

From: Danny Sinang d.sin...@gmail.commailto:d.sin...@gmail.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Thursday, April 16, 2015 at 8:25 PM
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] Preserving document collection membership

Would this feature be a good RFE then ?

On Thu, Apr 16, 2015 at 2:18 PM, Geert Josten 
geert.jos...@marklogic.commailto:geert.jos...@marklogic.com wrote:
Hi Danny,

Not directly no. You are expected to specify collections at each update. There 
are drawbacks, and benefits to that. I think easiest way out for you is to make 
sure that the user you are using to connect to MarkLogic, has default 
collections assigned, either directly, or inherited from some role.

Cheers,
Geert

From: Danny Sinang d.sin...@gmail.commailto:d.sin...@gmail.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Thursday, April 16, 2015 at 7:11 PM
To: general 
General@developer.marklogic.commailto:General@developer.marklogic.com
Subject: [MarkLogic Dev General] Preserving document collection membership

We sometimes modify XML docs in ML by hand (via WebDav  / Oxygen)  and discover 
later on that that XML doc is no longer part of its previous collection(s).

Is there a way to tell ML to preserve collection membership when changed via 
the said method ?

Regards,
Danny



___
General mailing list
General@developer.marklogic.commailto: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] Scheduled Task to run batch file.

2015-04-13 Thread Danny Sokolsky
Hi Gene,

I would try making that mimtype map to text instead of binary; a bat file seems 
to me would be a text document.

Although I am not 100% sure I understand the environment that is running.  If 
that does not work, you might give more details about how the document is being 
fetched from MarkLogic.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Thomas, Elroy E 
(CGI Federal)
Sent: Monday, April 13, 2015 11:40 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Scheduled Task to run batch file.

I see linux shell scripts (.sh) have a mimetype in MarkLogic 7, but I don't see 
one for windows batch files (.bat).
I am testing being able to run a shell script weekly to stop and start a 
MarkLogic plugin for New Relic.

I am testing the process on my windows laptop and plan to implement it in our 
production Linux environment.

I tried adding application/bat mimetype as binary, but I still get 
XDMP-NOEXECUTE errors.


Gene Thomas
MarkLogic Deployment  Operations Engineer
VDC-HIM Project | CGI Federal | T: 619-947-6507 | C 619-496-7766
www.cgi.comhttp://www.cgi.com/

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


Re: [MarkLogic Dev General] WebDAV - can't view files

2015-04-08 Thread Danny Sokolsky
Hi Robert,

Here are a few thoughts:


* Can you tell us what errors it is getting?  For the webdav server, 
set log uncaught errors to true, then your errors will show up in ErrorLog.txt.

* Did you have automatic directory creation set on the database 
*before* you loaded your content?  The directories need to exist for webdav to 
see them.  If they are not there, you can create them manually.

* What WebDAV client are you using?  The Windows WebDAV client does 
some strange things.

* You say your WebDAV root is / -- do your URIs all start with / ?

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Robert De Vivo
Sent: Wednesday, April 08, 2015 2:48 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] WebDAV - can't view files

Yep, it is configured for automatic directory creation.

From: Geert Josten [mailto:geert.jos...@marklogic.com]
Sent: Wednesday, April 08, 2015 2:53 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] WebDAV - can't view files

Hi Bob,

Is your content database configured to automatic directory creation? The 
default is manual, and the WebDAV server needs the directories..

Cheers,
Geert

From: Robert De Vivo rdev...@virtify.commailto:rdev...@virtify.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Wednesday, April 8, 2015 at 7:38 PM
To: general@developer.marklogic.commailto:general@developer.marklogic.com 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: [MarkLogic Dev General] WebDAV - can't view files

I've set up a WebDAV server for my MarkLogic database (created from an AWS 
Marketplace image), and I can connect to it and upload files from Windows, but 
I cannot view any files from the WebDAV client.  As soon as I drag a file into 
the client folder, it disappears and the folder appears empty again.  I can see 
that the file was uploaded successfully in the Query Console.

My WebDAV server is set up using / as the directory root, and I've tried both 
basic and application-level authentication.  I am connecting as the admin user, 
so I should have permission to see all documents.  I have also tried connecting 
via Oxygen XML Editor, but I see the same behavior: the WebDAV node is empty 
when I try to open a file from my MarkLogic connection.

What could I be doing wrong?

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


Re: [MarkLogic Dev General] Path Range Index

2015-04-08 Thread Danny Sokolsky
Hi Abhishek,

If you are seeing errors upon reindexing, it probably means you have some data 
that does not match the type for your range index.  If that is the case, you 
need to fix the data so it matches your type.Either that or just ignore the 
errors and those documents will not match your query for that value.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of 
abhishek.srivas...@cognizant.com
Sent: Wednesday, April 08, 2015 5:44 PM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Path Range Index

Hi All

My document model looks like below

Subject Area1

data
element1 active='2014-02-01T00:00:00' 
inactive='-12-31T00:00:00'A/element1
element1 active='2013-01-01T00:00:00' 
inactive='2014-01-31T00:00:00'B/element1
key  active='2013-01-01T00:00:00' inactive='-12-31T00:00:00'key0/key
data

Subject Area2
data
 element2 active='2011-02-01T00:00:00' 
inactive='-12-31T00:00:00'AA/element2
element2 active='2010-01-01T00:00:00' 
inactive='2011-01-31T00:00:00'BB/element2
key  active='2013-01-01T00:00:00' inactive='-12-31T00:00:00'key0/key
data

I need to join document of Subject Area1 document to Subject Area2 document 
based on key/ and fetch element2/ value where 
@inactive=-12-31T00:00:00. I can't run cts:search because both the volume 
by count and size is extremely high.

I tried achieving through cts:values over path reference and created path range 
index over ./data/element2[@inactive='-12-31T00:00:00'] but its throwing me 
exception while re-indexing that item @inactive is dataTime data type and not 
comparable with string.

Is there any way to create path range index with dataTime data type as 
attribute value or is there any better way to address this.

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


Re: [MarkLogic Dev General] Very puzzling bug in wildcard search results

2015-03-11 Thread Danny Sokolsky
Also, make sure you have the proper wildcard indexes in both places:

http://docs.marklogic.com/guide/search-dev/wildcard#id_14163

Do you have the codepoint word lexicon in both places?

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Wednesday, March 11, 2015 4:16 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Very puzzling bug in wildcard search 
results

You might try 7.0-5, released on Friday. I believe at least one wildcard bug 
was fixed. Reindexing is a good idea too.

Failing those, xdmp:plan or xdmp:query-trace might show some useful debugging 
info.

-- Mike

 On 11 Mar 2015, at 11:22 , David Sewell dsew...@virginia.edu wrote:
 
 I'm trying to figure out what could possibly account for buggy results 
 for wildcard searches in certain fringe cases (running MarkLogic 7.0-4.3).
 
 I have two servers running on the same data set of 166K documents, 
 with identical host, database and app server settings so far as I can 
 determine (for anything related to word query at least). Ordinarily, 
 wildcard searches on words return the exact same number of matches on both 
 hosts. For example:
 
   H1  H2
 democra*   15791579
 demo*  43544354
 dem*  16866   16866
 
 But there are certain word stems that produce buggy results on H2, 
 matching all documents when they shouldn't. Actually I should say 
 word stem because the buggy results all involve words starting in rel. 
 For example:
 
   H1  H2
 religions*   138 138
 religion*   2448  166618
 relig*  3810  166618
 reli*  14608  166618
 rel*   39888   39888
 re*   150890  166618
 relia*  1084  166618
 relie*  8306  166618
 relo*156  166618
 relm*  3   3
 
 I have tried unsuccesfully to find other letter sequences that exhibit 
 the bug in a wildcard search or that give different result counts for 
 H2. So far it's only certain rel- examples.
 
 My next step will be a forced reindex of the database on H2 to see if 
 that helps, but before I do that I wonder if anyone has a clue what 
 might account for this behavior.
 
 Even odder, on two entirely different systems running an entirely 
 different MarkLogic software instance, rel- searches are also 
 showing discrepancies, though I haven't researched that one as 
 thoroughly. Some deep-level indexing bug, possibly?
 
 David
 
 --
 David Sewell, Editorial and Technical Manager ROTUNDA, The University 
 of Virginia Press PO Box 400314, 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
 http://developer.marklogic.com/mailman/listinfo/general
 

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] docs.marklogic.com

2015-03-11 Thread Danny Sokolsky
This was an issue for a little while on Saturday.  It is fixed.

Thanks,
-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Shannon
Sent: Saturday, March 07, 2015 9:01 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] docs.marklogic.com

Hi,

docs.marklogic.com seems to be malfunctioning — is there another way to look up 
the API docs for XQuery/XSLT functions? The link to download docs is a 404.

Thanks
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] cts.search v cts:search

2015-03-03 Thread Danny Sokolsky
You can xpath down the results in JavaScript.  In your case, you end up 
returning the whole document anyway I think because you are walking up the tree 
from //word.

This is not quite what you want to do, but it is similar (and requires a range 
index on concepts/@year)

var res = new Array();
for (var x of cts.search(cts.elementWordQuery(xs.QName(word), 
  tenant for life, [exact]),
cts.indexOrder(
  cts.elementAttributeReference(
xs.QName(concepts), xs.QName(year) {
res.push(x.xpath(.//word));
};
res;

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Tuesday, March 03, 2015 12:46 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] cts.search v cts:search

Just guessing, but it might be pretty difficult to allow searchable expression 
arguments within a JavaScript evaluation environment. It might mean extending 
JavaScript syntax, or passing in the searchable expression as a string.

Speaking of strings, one workaround would be to do that bit in XQuery and call 
the XQuery from JavaScript. You could pass in a string that holds the 
searchable expression, and use that to build a cts:search expression, then call 
xdmp:value.

But if that sounds familiar, maybe it's because that's pretty much what 
search:resolve-nodes already does. You should be able to require() the search 
API module into your server-side JavaScript code and call it from there.

-- Mike

 On 3 Mar 2015, at 11:56 , Steiner, David J. (LNG-DAY) 
 david.j.stei...@elsevier.com wrote:
 
 I’m trying to implement a search in javascript.  In xquery, with cts:search 
 you can specify an element to be searched and returned, such as: 
 cts:search(//element.
 
 The javascript cts.search doesn’t seem to have this ability.  Is there a way 
 to affect this in javascript?  I really don’t want the whole doc coming back, 
 just the element.  Yes, the element is a fragment.
 
 Here’s the XQuery I’m trying to replicate in javascript:
 
 for $hit in  cts:search(//word,
 cts:element-word-query(
   xs:QName(word),
   tenant for life,
   exact))
 order by fn:data($hit/../@year)
 return
  
 XML documents looks like this:
 concepts year=1865
 word count=8tenant for life/word word count=5decree of 
 court/word word count=4fourth part/word … /concepts
  
  
 Thanks,
 David
 
  
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] xs:yearMonthDuration in 1.0-ml

2015-02-19 Thread Danny Sokolsky
I'm not sure if this helps, but here is something similar using a technique 
like the functx function does:

http://www.xqueryfunctions.com/xq/functx_yearmonthduration.html


xquery version 1.0-ml;

let $date1 := xs:dateTime(xs:date(2015-03-27))
let $date2 := xs:dateTime(xs:date(2024-03-27))
let $test :=  xs:duration($date2 - $date1)
let $years := fn:round(fn:days-from-duration($test) div 365)
let $months := fn:round((fn:days-from-duration($test) div 365) div 12)
return
 ( xs:yearMonthDuration('P1M') * $months +
xs:yearMonthDuration('P1Y') * $years)

But duration math is strange so I might be doing something wrong.

-Danny


-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Florent Georges
Sent: Thursday, February 19, 2015 4:26 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] xs:yearMonthDuration in 1.0-ml

  That function never found its way from the working drafts to the 
recommendation.  You can achieve something similar by using the following (yes, 
by using the average number of days in a month, which is fragile and works fine 
only for large numbers of days, over several
years):

let $days   := xs:dayTimeDuration(-P3278D) div xs:dayTimeDuration('P1D')
let $months := $days idiv 30.4368499167
return
  $months * xs:yearMonthDuration('P1M')

  Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 20 February 2015 at 01:02, William Sawyer wrote:
 I have two dates I am trying to subtract and get a xs:yearMonthDuration.  In
 0.9-ml there is a function you can call but in 1.0-ml the documentation
 says to subtract the dates.  But how do I specify that I want a
 xs:yearMonthDuration instead of a xs:dayTimeDuration.
 MarkLogic Version: 7.0-2.3

 Thanks,
 -Will


 xquery version 1.0-ml;

 let $date1 := xs:dateTime(xs:date(2015-03-27))
 let $date2 := xs:dateTime(xs:date(2024-03-27))
 let $test := $date1 - $date2
 return $test
 ***
 xs:dayTimeDuration(-P3288D)


 xquery version 0.9-ml

 let $date1 := xs:dateTime(xs:date(2015-03-27))
 let $date2 := xs:dateTime(xs:date(2024-03-27))
 let $test := fn:subtract-dateTimes-yielding-yearMonthDuration($date1,
 $date2)
 return $test
 **
 xs:yearMonthDuration(-P8Y11M)

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Query on Search with double quotes “”

2015-02-06 Thread Danny Sokolsky
Also, what are your index settings?  What is the exact query?

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Charles Greer
Sent: Friday, February 06, 2015 4:05 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Query on Search with double quotes “”

Hello there,

This is curious sounding to me.  Can you share the document?
This is a situation where filtered/unfiltered might have an effect on search 
matches.
As I recall, the results will be different depending on filtering, and also 
depending on
whether you've enabled word positions.

Charles


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of ShaikUmmerFaruk D 
[shaikummerfaru...@infosys.com]
Sent: Friday, February 06, 2015 5:01 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Query on Search with double quotes “”
HI,

I give the search term enclosed in double closed as “text for search”.

Most of the documents retrieved contain the exact search term. But I also get 
the documents that has “text for” in one line and “search” in some other line.

Can anyone throw some light on this ?

Regards,
Shaik Ummer Faruk D.


 CAUTION - Disclaimer *

This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely

for the use of the addressee(s). If you are not the intended recipient, please

notify the sender by e-mail and delete the original message. Further, you are 
not

to copy, disclose, or distribute this e-mail or its contents to any other 
person and

any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken

every reasonable precaution to minimize this risk, but is not liable for any 
damage

you may sustain as a result of any virus in this e-mail. You should carry out 
your

own virus checks before opening the e-mail or attachment. Infosys reserves the

right to monitor and review the content of all messages sent to or from this 
e-mail

address. Messages sent to or from this e-mail address may be stored on the

Infosys e-mail system.

***INFOSYS End of Disclaimer INFOSYS***


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MLJAM: Socket receive error timeout

2015-01-31 Thread Danny Sokolsky
You can try adding an xdmp:set-request-time-limit to increase the time limit 
for that query.  Try something like this:



xdmp:set-request-time-limit(600),

xdmp:http-post(http://localhost:8080/mljam/mljam/local/eval;)



-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Vipitha Kapildas
Sent: Saturday, January 31, 2015 6:15 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] MLJAM: Socket receive error timeout


Hi,

I am integrating java code inside MarkLogic to convert some EBCDIC files to 
ASCII using MLJAM. Apache Tomcat 7.0 is being used as the server. The code is 
running fine for small files, but for huge file processing, MarkLogic is 
throwing an error as

SVC-SOCRECV: xdmp:http-post(http://localhost:8080/mljam/mljam/local/eval;, 
adminadmin) -- Socket receive error: wait 10.78.14.16:63085-10.76.81.81:8080: 
Timeout (decodeResponseLine1)



As per my understanding, I need to increase the socket receive timeout period 
for the Apache server.

Please guide with the steps as how to do it if I am not wrong.



Thanks,

Vipitha




 CAUTION - Disclaimer *

This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely

for the use of the addressee(s). If you are not the intended recipient, please

notify the sender by e-mail and delete the original message. Further, you are 
not

to copy, disclose, or distribute this e-mail or its contents to any other 
person and

any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken

every reasonable precaution to minimize this risk, but is not liable for any 
damage

you may sustain as a result of any virus in this e-mail. You should carry out 
your

own virus checks before opening the e-mail or attachment. Infosys reserves the

right to monitor and review the content of all messages sent to or from this 
e-mail

address. Messages sent to or from this e-mail address may be stored on the

Infosys e-mail system.

***INFOSYS End of Disclaimer INFOSYS***


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] XDMP-PLACEKEYSLOCKING: …Fast locking cannot be used with place keys.

2015-01-31 Thread Danny Sokolsky
Hi Ardal,

Remove the forests element from your options node and that error will go away.

Since we introduced the latest forest placement algorithms in MarkLogic 7, most 
of the time it is a bad idea to choose your own forest.

I thought setting locking to strict for that database would make this work, 
however, so I am not too sure why that did not work.  Are you sure you set that 
for the database where you are loading this document?

At any rate, you probably do not need the forest placement key in there, so I 
would just remove it.

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ardal Powell
Sent: Saturday, January 31, 2015 4:56 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] XDMP-PLACEKEYSLOCKING: …Fast locking cannot be 
used with place keys.

Hi all,

I'm getting the above error on running an xdmp:document-load in one of the 
modules in the MarkLogic Dev II course. All the other modules run OK. 

The error persists after locking on the databases, top-sopngs-dev, ...modules, 
and ...triggers is set to Strict.

The offending lines are:

for $d in 
xdmp:filesystem-directory(/home/ardal/mls-developer-2/top-songs-dev/content/songs/)//dir:entry

return xdmp:document-load($d//dir:pathname,
options xmlns=xdmp:document-load
uri/songs/{fn:string($d//dir:filename)}/uri
collections.../collections
forests
 
forest{xdmp:forest(top-songs-dev-01)}/forest
/forests
/options

Any help appreciated.

Thanks,
Ardal
___
Ardal Powell
ard...@me.com
518.779.6188











___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] ERR_EMPTY_RESPONSE from security-install.xqy

2015-01-26 Thread Danny Sokolsky
As David indicated, MarkLogic does not have a debian package, but many people 
have installed it the way you are.

A few other things to look at:

Is there anything in the log file (/var/opt/MarkLogic/Logs/ErrorLog.txt)?

What is the user in the /etc/sysconfig/MarkLogic script, and does that user 
exist on your system (it is daemon by default)?

Are the files in the data directory (/var/opt/MarkLogic) owned by the above 
user?

What user are the processes running as.  For example, the output of:

ps -ef | grep MarkLogic

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ardal Powell
Sent: Monday, January 26, 2015 2:53 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] ERR_EMPTY_RESPONSE from 
security-install.xqy

Hi David, nice to see you here!

I used alien as well: everything went smoothly with:

sudo alien --to-deb --verbose {MarkLogic ... .rpm}
sudo dpkg -i {the resulting .deb file}
sudo /etc/init.d/MarkLogic start

The script at /etc/sysconfig/MarkLogic  seems to point to the correct 
installation and data directories, viz.:

# where MarkLogic is installed
export MARKLOGIC_INSTALL_DIR=/opt/MarkLogic

# where MarkLogic keeps its data
export MARKLOGIC_DATA_DIR=/var/opt/MarkLogic

So a bit of a puzzle.

Ardal

On Jan 26, 2015, at 5:06 AM, David Ennis wrote:


HI Ardal.

I note that you are installing this in a VM using Ubuntu.

I don't think that MarkLogic has a debian package available.  I uaually use 
alien to convert them when testing on debian based systems.

Could you explain how you went about installing MarkLogic on a debian based 
system?  Perhaps there is something about that. (for instance, there is a 
sysconfig file that gets created that might be overlooked if installed 'by 
hand'- not sure if that could be the issue, for instance)




Kind Regards,
David Ennis


David Ennis
Content Engineer

[HintTech] http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[http://www.hinttech.com]http://www.hinttech.com/ 
[http://www.hinttech.com/signature/Twitter_HintTech.png] 
https://twitter.com/HintTech  
[http://www.hinttech.com/signature/Facebook_HintTech.png] 
http://www.facebook.com/HintTech  
[http://www.hinttech.com/signature/Linkedin_HintTech.png] 
http://www.linkedin.com/company/HintTech

On 26 January 2015 at 10:50, Ardal Powell ard...@me.commailto:ard...@me.com 
wrote:
Thanks, Danny. I'm quite sure MarkLogic has not been installed before: it's a 
brand new droplet.

I went ahead and reinstalled the data directory, but the same thing happened on 
trying to create a new admin user. The server took about a minute to return the 
error.

I noticed that some of the .xqy in the data directory has permissions as low as 
600, so I set the whole directory to 777 to see what would happen. The only 
difference was the server returned the error more quickly.

Also, the system was writing stuff to disk before the CHMOD because 
/var/opt/MarkLogic/Forests/Last-Login/Security/Journals contains the following:

A 0 byte file, Journal1-1970010100-0-18446744073709551615-0

A file named Label with contents:
?xml version=1.0 encoding=UTF-8?
forest-label 
xmlns=http://marklogic.com/xdmp/forest/label;version83886849/versionpublic-lock0/public-lockprivate-lock0/private-lockcheckpoint-FSN10/checkpoint-FSNcheckpoint-offset8416/checkpoint-offsetcheckpoint-sequence-key9457306095252104859/checkpoint-sequence-keybackup-time0/backup-timerestore-time0/restore-timemaster-forest12488019828191884476/master-forestmaster-precise-time14222648032855250/master-precise-timemaster-FSN10/master-FSNmaster-sequence-key9457306095252104859/master-sequence-keywas-synchronized-flagfalse/was-synchronized-flagforeign-master-cluster16048579413085239693/foreign-master-clusterforeign-master-database5988134361757721166/foreign-master-databaseforeign-master-forest12488019828191884476/foreign-master-forestforeign-master-precise-time14222648032855250/foreign-master-precise-timeforeign-master-FSN10/foreign-master-FSNforeign-master-sequence-key9457306095252104859/foreign-master-sequence-keyforeign-fast-query-timestamp18446744073709551615/foreign-fast-query-timestampmin-query-timestamp0/min-query-timestampconfigured-master-forest12488019828191884476/configured-master-forestrollback-timestamp18446744073709551615/rollback-timestamplag-limit0/lag-limitdatabase-key5988134361757721166/database-keyjournal-archive-path/word-size8/word-sizedisk-megabytes0/disk-megabytesfragment-count2/fragment-countpartition-key0/partition-keyplatformlinux/platformarchitecturex86_64/architecture/forest-label

Thanks again,
Ardal


On Jan 25, 2015, at 10:25 PM, Danny Sokolsky wrote:


Hi Ardal,

Did the admin interface  prompt you for the name of an admin username and 
password

Re: [MarkLogic Dev General] ERR_EMPTY_RESPONSE from security-install.xqy

2015-01-26 Thread Danny Sokolsky
Well, it seems like the issue is that your data directory is not owned by 
daemon.  It should have daemon as the owner and the group.

I am not sure why, something about your setup.

All I can think of is to shut down the server and recursively change the owner 
and group of /var/opt/MarkLogic to daemon.

What is going on is that the installation creates a bunch of directories and 
files, and they should be owned and grouped as daemon.  Since they are not, 
your process, which is run as daemon, is not able to write to them.

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ardal Powell
Sent: Monday, January 26, 2015 2:03 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] ERR_EMPTY_RESPONSE from 
security-install.xqy

Thanks again, Danny.

My responses in your text below.

Ardal

On Jan 26, 2015, at 12:14 PM, Danny Sokolsky wrote:


As David indicated, MarkLogic does not have a debian package, but many people 
have installed it the way you are.

A few other things to look at:

Is there anything in the log file (/var/opt/MarkLogic/Logs/ErrorLog.txt)?

Yes. A lot of lines like these:
...
2015-01-26 06:28:11.422 Info: Mounted forest Modules locally on 
/var/opt/MarkLogic/Forests/Modules read write (vda1 ext4 rw,errors=remount-ro)
2015-01-26 06:28:36.282 Info: Unmounted forest Extensions
...
2015-01-26 06:30:00.806 Error: UsageMeterTask::run: SEC-ROLEDNE: 
Role does not exist: sec:role-name = manage-user
Segmentation fault in thread 139680590857984 addr 0xc
fork: Cannot allocate memory
...
2015-01-26 06:32:00.231 Error: UsageMeterTask::run: SEC-ROLEDNE: 
Role does not exist: sec:role-name = manage-user
2015-01-26 06:33:00.254 Info: PerfMeterTask::cleanOldData: deleting 
: 0
2015-01-26 06:34:00.329 Error: PerfMeterTask::run: SEC-ROLEDNE: 
Role does not exist: sec:role-name = manage-user
...
2015-01-26 08:59:00.510 Error: PerfMeterTask::run: SEC-ROLEDNE: 
Role does not exist: sec:role-name = manage-user
2015-01-26 09:00:00.494 Error: UsageMeterTask::run: SEC-ROLEDNE: 
Role does not exist: sec:role-name = manage-user
...


What is the user in the /etc/sysconfig/MarkLogic script, and does that user 
exist on your system (it is daemon by default)?

# the user MarkLogic runs as
export MARKLOGIC_USER=daemon

Are the files in the data directory (/var/opt/MarkLogic) owned by the above 
user?

No, owner and group are both given as 1


What user are the processes running as.  For example, the output of:

ps -ef | grep MarkLogic

ardal@plink:~$ ps -ef | grep MarkLogic
root  1444 1  0 16:49 ?00:00:00 /opt/MarkLogic/bin/MarkLogic
daemon1445  1444  0 16:49 ?00:00:02 /opt/MarkLogic/bin/MarkLogic
ardal 1869  1544  0 16:56 pts/000:00:00 grep --color=auto MarkLogic

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com]On Behalf Of Ardal Powell
Sent: Monday, January 26, 2015 2:53 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] ERR_EMPTY_RESPONSE from 
security-install.xqy

Hi David, nice to see you here!

I used alien as well: everything went smoothly with:

sudo alien --to-deb --verbose {MarkLogic ... .rpm}
sudo dpkg -i {the resulting .deb file}
sudo /etc/init.d/MarkLogic start

The script at /etc/sysconfig/MarkLogic  seems to point to the correct 
installation and data directories, viz.:

# where MarkLogic is installed
export MARKLOGIC_INSTALL_DIR=/opt/MarkLogic

# where MarkLogic keeps its data
export MARKLOGIC_DATA_DIR=/var/opt/MarkLogic

So a bit of a puzzle.

Ardal

On Jan 26, 2015, at 5:06 AM, David Ennis wrote:



HI Ardal.

I note that you are installing this in a VM using Ubuntu.

I don't think that MarkLogic has a debian package available.  I uaually use 
alien to convert them when testing on debian based systems.

Could you explain how you went about installing MarkLogic on a debian based 
system?  Perhaps there is something about that. (for instance, there is a 
sysconfig file that gets created that might be overlooked if installed 'by 
hand'- not sure if that could be the issue, for instance)




Kind Regards,
David Ennis


David Ennis
Content Engineer

[HintTech] http://www.hinttech.com/
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[http://www.hinttech.com]http://www.hinttech.com/ 
[http://www.hinttech.com/signature/Twitter_HintTech.png] 
https://twitter.com/HintTech  
[http://www.hinttech.com/signature/Facebook_HintTech.png] 
http://www.facebook.com/HintTech  
[http://www.hinttech.com/signature/Linkedin_HintTech.png] 
http

Re: [MarkLogic Dev General] Searching Standalone Properties Documents

2015-01-19 Thread Danny Sokolsky
Or you can use xdmp:document-properties() for your searchable expression (1st 
param to cts:search).

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Justin Makeig
Sent: Monday, January 19, 2015 9:39 AM
To: neil bradley; MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Searching Standalone Properties Documents

Can you say a little more about what you're trying to accomplish? While it's 
possible to work with stand-alone properties (e.g. 
http://docs.marklogic.com/cts:properties-query), it's not a well trodden 
path. You'd be much better off if you can reformulate your implementation using 
tried and true document fragments.

Justin

 On Jan 19, 2015, at 9:28 AM, neil bradley n...@bradley.co.uk wrote:
 
 Hi, I am having a problem working out how (if it is possible) to use 
 cts:search to find specific STANDALONE properties documents 
 (properties that are not associated with an actual document).
 
 Every formulation of an XPath that I try either fails to find anything 
 that I know it should find, or says its UNREACHABLE.
 
 It does not surprise me that doc() does not work, because there IS no 
 document, and that collection() also does not work for a similar 
 reason.
 
 I had hoped I could do something like:
 
  /property::*
 
 But that is not working.
 
 So, anyone know if its possible, and if so what kind of XPath I need?
 
 Regards,
 
 Neil.
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] function index in MarkLogic?

2015-01-08 Thread Danny Sokolsky
If you look in the Admin Interface on the screens where you create range 
indexes, there is a collation builder there.  That can help you.  Using the 
collation builder, it looks like this will be case and diacritic insensitive as 
well as space insensitive:


http://marklogic.com/collation/en/S1/T0020/AS

Let’s check that in XQuery:

xquery version 1.0-ml;

declare default collation http://marklogic.com/collation/en/S1/T0020/AS;;

houston eq HOUSTON,
houston eq HOUSTON ,
   houston eq HOUSTON  

=
true 
true
true

So that seems to work for space and caps.

Here is the doc on collations:

http://docs.marklogic.com/guide/search-dev/encodings_collations?hq=collation#id_40354

They are very powerful.

As for the wildcards, I would guess that would work well.  I would recommend 
the following indexes for wildcards:

Word positions

word searches
three character word searches
word positions
word lexicon in the codepoint collation
three character word positions

See http://docs.marklogic.com/guide/search-dev/wildcard#id_14163 for more info.

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Alexei Betin
Sent: Thursday, January 08, 2015 5:27 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] function index in MarkLogic?

So is there a way to create such case, whitespace and punctuation insensitive 
index? I tried using http://marklogic.com/collation/S1 as Geert suggested and 
that worked as far as capitalization goes (but it does not work e.g. for 
whitespace – ‘Houston ‘ would still be a miss). 

In addition, I had to specify the S1 collation at the app server level - 
ideally, I would want it to be at the field/index level. 

At any rate, handling capitalization/whitespace is only a small part of the 
story, other use cases include matching on a substring as in
substring( ZipCode, 1, 3 ) = “921”
(would wildcard search be faster than substring?) or a phonetic match as in
spell:double-metaphone( substring-before( Email, '@' )  )[1] = “aptn”

So for an ultimate solution, I am now looking at CPF/triggers as Justin 
suggested…

Thanks!





Alexei Betin

Principal Architect; Big Data
P: (817) 928-1643 | Elevate.com
4150 International Plaza, Suite 300
Fort Worth, TX 76109

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. 

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Paul Hoehne
Sent: Thursday, January 08, 2015 5:04 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] function index in MarkLogic?

So one reason to do this, in the example given, is that (hypothetically) a city 
field in an address might have:

HOUSTON, houston, Houston, HOuston, etc.

Rather than using a computed field, you would use a case insensitive, maybe 
whitespace and punctuation insensitive index, so
NEW YORK
NEW   YORK
New YORK
New York
new york
etc, would all be considered ‘equal.’ in terms of the index.  

While this doesn’t cover every instance where you might want a function index, 
it handles those cases where you’re worried about the case of the text, 
punctuation, or spaces.  


On Jan 8, 2015, at 2:47 PM, Alexei Betin abe...@elevate.com wrote:

Hello,
 
Does MarkLogic has something similar to “function index” as exists in other 
databases such as Oracle? For example, in Oracle one can create a function 
index on a value of UPPER(field_name) as follows:

CREATE INDEX cities_fn_idx ON cities (UPPER(name));
which ensures that a query like the one below is efficient and not using the 
full table scan:
SELECT name FROM cities WHERE UPPER(name) = 'HOUSTON';
 
I’d like to do something similar with MarkLogic which could help speed up, e.g. 
the following simple query (which currently runs prohibitively slow despite an 
index on /A/City):
 
collection()/A/[upper-case( City ) = 'HOUSTON']
 
upper-case() is only an example, I am looking for a solution that would 
accommodate any function/transformation that derives a value to be used in a 
query condition from an existing element.
 
Clearly, one solution would be to pre-compute the derived field, add it to all 
the documents in the collection, and create an index on the derived field – 
this is possible, but I want to make sure I am not missing a solution that does 
not require data modification (such as a “function index”).
 
Thanks,
 
image005.jpg
image006.jpg


Alexei Betin

Principal Architect; Big Data
P: (817) 928-1643 | Elevate.com
4150 International Plaza, Suite 300
Fort Worth, TX 76109
 
Privileged and Confidential. 

Re: [MarkLogic Dev General] How to escape ? character in searches

2014-12-17 Thread Danny Sokolsky
You can make that query unwildcarded.  For example:

cts:word-query(drug?, unwildcarded)

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sinang
Sent: Wednesday, December 17, 2014 2:33 PM
To: general
Subject: [MarkLogic Dev General] How to escape ? character in searches

We've got wildcarded searching enabled.

So looking for drug? yields results containing drug, and drug),.

How do I escape the ? character so MarkLogic yields results that only contain 
drug? ?

Regards,
Danny


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] ways to execute xQuery against MarkLogic

2014-12-15 Thread Danny Sokolsky
Hi Alexei,

The most common way to evaluate xquery modules is to create an HTTP App Server, 
put the code as xqy files under the app server root, and then hit the URL with 
a browser or with a tool like curl.  For example, suppose you have an HTTP App 
Server you have set up with a root of /space/appserver, listening on port 9876.

Now create a file called /space/appserver/hello.xqy with the following content:

hello

Now with curl or with a browser, go to http://localhost:9876/hello.xqy

It will prompt you to authenticate, and after that you will get the response of 
the string hello back.

Is that what you were asking?

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Alexei Betin
Sent: Monday, December 15, 2014 5:37 PM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] ways to execute xQuery against MarkLogic

Hello,

I've been experimenting with xQuery syntax using MarkLogic Query console and 
I've been quite happy with the results so far, but now I'd like to make sure I 
understand all the options for using xQuery against MarkLogic in an client 
application:

From documentation, one sure way to execute xQueries would be using XCC API 
(Java or .Net) against XDBC interface, but I am a bit confused about whether 
there're any other / language-independent options, e.g.:

Is it possible to execute xQuery directly using REST API?

If not, is it possible by storing .xqy on MarkLogic and wrapping it into a REST 
API extension and then having the client call the extension?

Is it possible to wrap xQuery into a MarkLogic (RESTful) web-service and then 
have client access the web-service then instead of passing xQuery directly? If 
so, would it be different from creating a REST API extension?

Is there a command-line xQuery client tool?

Any advice along with pointers to documentation/examples for the possible 
options is most welcome!

Thanks,

[Forward Slash]

[Elevate]

Alexei Betin

Principal Architect; Big Data
P: (817) 928-1643 | Elevate.comhttp://www.elevate.com
4150 International Plaza, Suite 300
Fort Worth, TX 76109


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.


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Is it possible to add range index from command line without bootstrap?

2014-12-09 Thread Danny Sokolsky
Hi Jenny,

Yes, you can script any configuration change using the Admin API.  Here is an 
example of adding an index:

http://docs.marklogic.com/guide/admin-api/configure#id_80248

You could create a service in XQuery and call it from the command line (for 
example, using curl).

Also, you would not need to reload the content if reindexing is enabled.  With 
reindexing on, the needed content would reindex automatically.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Jenny Wang
Sent: Tuesday, December 09, 2014 2:02 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Is it possible to add range index from command 
line without bootstrap?


Classification: Public
I'm working on an automation scenario which consists of two steps: first ingest 
some data with a missing range index, this will result in some invalid 
documents in MarkLogic. Then after adding the range index, I'll need to 
reingest the data saved in MarkLogic and verify valid documents are generated. 
Is there a way to add a range index without removing documents in the database? 
Note that I have to do it from command line, so adding the index from UI 
doesn't solve my problem.


Jenny




---
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
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Marklogic node replace of same node results in inconsistent output

2014-12-08 Thread Danny Sokolsky
Hi Frank,

Or how about if you do a language-sensitive search.  For example:

let $doc  :=
a
 b id=car
   c xml:lang=encar/c
   c xml:lang=nlauto/c
   c xml:lang=frvoiture/c
 /b
 b id=house
   c xml:lang=enhouse/c
   c xml:lang=nlhuis/c
   c xml:lang=frmaison/c
 /b
 b id= child
   c xml:lang=enchild/c
   c xml:lang=nlkind/c
   c xml:lang=frenfant/c
 /b
 /a   
return $doc//c[cts:contains(., cts:or-query((
 cts:word-query(auto, lang=nl),
 cts:word-query(kind, lang=nl))) )]
=
c xml:lang=nlauto/c
c xml:lang=nlkind/c

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher Hamlin
Sent: Monday, December 08, 2014 10:14 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Marklogic node replace of same node 
results in inconsistent output

Hi Frank,

Not exactly sure if it's what you want, but maybe helps you get closer:

 for $x in $doc/b/c[@xml:lang eqnl]
 where $x/fn:string() = fn:tokenize('auto, kind', ',')
 return
 $x/../@id/fn:string()

returns 'car'.

I changed it so it compares the string value of $x with a list of strings from 
tokenize.  Note that I'm using = instead of eq.  That lets you use a sequence 
compare.  Also the return now returns the @id attribute node.

- Chris
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Marklogic node replace of same node results in inconsistent output

2014-12-08 Thread Danny Sokolsky
You already know how to do that.  Just do something like this (passing a 
sequence into a word-query treats each item as an or):

let $s := (fn:tokenize(auto, kind, ,))
let $doc  :=
a
 b id=car
   c xml:lang=encar/c
   c xml:lang=nlauto/c
   c xml:lang=frvoiture/c
 /b
 b id=house
   c xml:lang=enhouse/c
   c xml:lang=nlhuis/c
   c xml:lang=frmaison/c
 /b
 b id= child
   c xml:lang=enchild/c
   c xml:lang=nlkind/c
   c xml:lang=frenfant/c
 /b
 /a   
return $doc//c[cts:contains(., cts:word-query($s, lang=nl) )]

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Frank Mortier
Sent: Monday, December 08, 2014 10:38 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Marklogic node replace of same node 
results in inconsistent output

Thanks 

Danny, I need to get from the string ('auto, kind') to ('auto', 'kind').

Chris, it should return 'car' and 'child'.

Tim, does not work, returns only  the first id 'car'

Rob, same answer as for Danny.




-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: 08 December 2014 19:15
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Marklogic node replace of same node 
results in inconsistent output

Hi Frank,

Or how about if you do a language-sensitive search.  For example:

let $doc  :=
a
 b id=car
   c xml:lang=encar/c
   c xml:lang=nlauto/c
   c xml:lang=frvoiture/c
 /b
 b id=house
   c xml:lang=enhouse/c
   c xml:lang=nlhuis/c
   c xml:lang=frmaison/c
 /b
 b id= child
   c xml:lang=enchild/c
   c xml:lang=nlkind/c
   c xml:lang=frenfant/c
 /b
 /a   
return $doc//c[cts:contains(., cts:or-query((
 cts:word-query(auto, lang=nl),
 cts:word-query(kind, lang=nl))) )] = c 
xml:lang=nlauto/c c xml:lang=nlkind/c

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Christopher Hamlin
Sent: Monday, December 08, 2014 10:14 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Marklogic node replace of same node 
results in inconsistent output

Hi Frank,

Not exactly sure if it's what you want, but maybe helps you get closer:

 for $x in $doc/b/c[@xml:lang eqnl]
 where $x/fn:string() = fn:tokenize('auto, kind', ',')
 return
 $x/../@id/fn:string()

returns 'car'.

I changed it so it compares the string value of $x with a list of strings from 
tokenize.  Note that I'm using = instead of eq.  That lets you use a sequence 
compare.  Also the return now returns the @id attribute node.

- Chris
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Does reindexing always automatically run on the complete contents of each database after an upgrade from ML6 to ML7?

2014-10-29 Thread Danny Sokolsky
If you have reindexing enabled for the database, reindexing is always running 
on that database, meaning that at certain points in the server's uptime (for 
example, start up, configuration changes), the database checks to see if 
there are any fragments to reindex.  If there are, it reindexes a batch of 
fragments at a time, then checks again and repeats this process until there are 
no fragments to reindex left.  Then it won't check again until one those points 
occurs for it to check again.

Now when you upgrade to MarkLogic 7 from MarkLogic 6, it should see that no 
fragments need reindexing, and that process should be pretty quick (usually a 
few seconds or less).

If you don't want it to do this, you can disable reindexing for the database.

As always, it is good to test this on a test system to make sure your setup is 
behaving this way.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Tim
Sent: Wednesday, October 29, 2014 12:51 PM
To: 'MarkLogic Developer Discussion'
Subject: [MarkLogic Dev General] Does reindexing always automatically run on 
the complete contents of each database after an upgrade from ML6 to ML7?

The subject says it all!
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to tell if restart required?

2014-10-23 Thread Danny Sokolsky
One other (low-tech) idea is to look at the list of cod tasks and do some 
static analysis on your code.  There are relatively few cold tasks, and most of 
the cold tasks are app-server related (like removing ports and so forth).

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Whitby, Rob
Sent: Thursday, October 23, 2014 8:39 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] How to tell if restart required?

Hi Ken,

Yep I saw in xdmp:host-status there is a timestamp for those config files. But 
I think this method will just tell me if there is a change - not if it requires 
a restart.

My plan at the moment is to add the host ids returned from 
admin:save-configuration-without-restart()  to a map in a server field.

Thanks
Rob

From: Ken Tune ken.t...@marklogic.commailto:ken.t...@marklogic.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Thursday, 23 October 2014 16:24
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] How to tell if restart required?

Rob

All the 'cold' changes affect either all hosts in a group or none ( with the 
exception of mimetypes, which is global )

http://docs.marklogic.com/guide/admin/hotcold#chapter

so you could possibly experiment with looking at the last write time of the 
relevant configuration file  ( i.e. groups.xml / mimetypes.xml ), via 
xdmp:filesystem-directory ( e.g. groups.xml ) and comparing that with the last 
restart time ( via xdmp:host-status )

Ken Tune


From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Dave Cassel
Sent: 23 October 2014 16:09
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] How to tell if restart required?

I just ran a quick test to see whether re-running 
admin:save-configuration-without-restart() with the results of 
admin:get-config() would give you that list, but it doesn't. I think your 
options are to write the list of servers that need restart into the database or 
handle it at the client level (have your calls return the list and output or 
track that).

--
Dave Cassel
Developer Community Manager
MarkLogic Corporationhttp://www.marklogic.com/
Cell:  +1-484-798-8720




From: Whitby, Rob rob.whi...@springer.commailto:rob.whi...@springer.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Thursday, October 23, 2014 at 10:44 AM
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: [MarkLogic Dev General] How to tell if restart required?

Hi,

I¹m using admin:save-configuration-without-restart() in setup scripts, I
know it returns a list of hosts that require a restart, but would like to
get that information independently, so I can run a bunch of scripts and
then check what needs restarting. Something like
admin:get-hosts-requiring-restart(). I was hoping it would be in
xdmp:host-status() but seems not.

Thanks
Rob





___
General mailing list
General@developer.marklogic.commailto:General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Surprising slowness of cts:uri-match

2014-10-22 Thread Danny Sokolsky
Hi Rachel,

Can you pass a cts:query into your cts:uri-match call?

How many forests do you have?  More forests might help depending upon what you 
are doing.

But if all of your URIs in your db follow this pattern, ultimately it is going 
to have to search through a lot of URIs.  You could make your URI space a 
little more selective which might speed it up.  Maybe the strings in your URIs 
are all very similar (the URI match is essentially a string compare)?

What kind of hardware are you running on?  The speed of your memory and cpu can 
be a factor here too.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Rachel Wilson
Sent: Wednesday, October 22, 2014 9:05 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Surprising slowness of cts:uri-match

Hi,

I was wondering if anyone had a reply to this.

We're digging even deeper into improving our performance for an API and in 
several places (because we use it liberally) cts:uri-match ends up being the 
bottleneck.  We are happy to redesign our data and queries where we can to 
avoid it, but it continues to surprise us that this is the case because we 
thought the uris are indexed and the function is designed to use wildcards 
because it's a matcher.

A typical call would be

   let $uris := cts:uri-match(/project/ || $projectId ||/jobs/*,

But we're most surprised by this one, we used as a test, because there aren't 
even any wildcards.

   let $thereShouldBeOnlyOne := cts:uri-match(/project/ || $projectId || 
/content/ || $contentId)

Some insight into the inner workings of that function would be great


From: Rachel Wilson rachel.wil...@bbc.co.ukmailto:rachel.wil...@bbc.co.uk
Date: Thursday, 16 October 2014 17:25
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Surprising slowness of cts:uri-match

In our experience cts:uri-match is surprisingly slow.  For example when 
profiling a pretty complicated query taking 0.7 seconds, the single 
cts:uri-match() call takes 70-80% of the total time.  (Shallow% and Deep% being 
the same)

But we thought it should be reading the URI lexicon and so in a database with 
only 483,475 docs should be lightening fast.   We've had to stop using 
cts:uri-match calls in loops for this reason.

Are there any match patterns to be avoided perhaps?  Wildcards in the middle of 
the pattern, rather than trailing wildcards for example?
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] word query

2014-10-16 Thread Danny Sokolsky
Have you tried this on 7.0-4?  There are some bugs fixed in this area there—it 
is worth a try.

What I recommend you do is create a simple test case using a simple cts:search 
with a cts:query that shows the issue, then post that here with the exact 
config info for it.  Otherwise we are just guessing.  The details are very 
important to understanding what is going on.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Girish Kulkarni
Sent: Thursday, October 16, 2014 9:39 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] word query

i am using word-constraint-query in my structured query and i see that when i 
exclude the enrichedDateTime , it does work in the sense i dont see any results 
when i search for the timestamp search i was seeing earlier. Now my only 
problem is i don't see other fields being searched. Well to be more specific i 
see that the results returned show total = 20 but i don't see anything being 
returned . As soon as i add the top level field fix in the inclusion list i 
start seeing the 20 results.

Girish

On Wed, Oct 15, 2014 at 4:09 PM, Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com wrote:
Depending on what those structured queries are, they might not be word queries. 
 Excluding an element in the word query field does not mean you cannot query 
it, it just means that a cts:word-query will not see it.  For example, you can 
still see it in an element-word-query.

You say your reindexing started; did it complete?

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of Girish Kulkarni
Sent: Wednesday, October 15, 2014 3:59 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] word query

As soon as i make changes to the word query , my database starts re-indexing.

We use marklogic 7.0-3 and we are using REST based structured queries. The 
query passes in a bunch of constraints and options , however i am just testing 
before and after scenario's based upon changes to the word query.

Girish

On Wed, Oct 15, 2014 at 3:55 PM, Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com wrote:
Did you reindex your database after changing the word query field?

Exactly what query are you running?

What version of MarkLogic are you using (xdmp:version() ).

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of Girish Kulkarni
Sent: Wednesday, October 15, 2014 3:48 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] word query

I had some fileds in my xml document like enrichedDateTime which i didnt want 
to index and search upon. When i added this in the word query exclusion list 
for some reason my search result isn't returning back this document at all even 
when i searched for other field like content. However when i added the  root 
field name fix to my inclusion list i do see the document back again. I had 
already set the include root flag to true but seems like for some reason i am 
un-able to search for other fields in the document. Any ideas why this could be 
happening ?

fix
content some content goes here /content
enrichedDateTime2014-09-30T16:32:27.424443-07:00/enrichedDateTime
/fix



Girish Kulkarni

___
General mailing list
General@developer.marklogic.commailto:General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general



--
Girish Kulkarni

___
General mailing list
General@developer.marklogic.commailto:General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general



--
Girish Kulkarni
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] word query

2014-10-15 Thread Danny Sokolsky
Did you reindex your database after changing the word query field?

Exactly what query are you running?

What version of MarkLogic are you using (xdmp:version() ).

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Girish Kulkarni
Sent: Wednesday, October 15, 2014 3:48 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] word query

I had some fileds in my xml document like enrichedDateTime which i didnt want 
to index and search upon. When i added this in the word query exclusion list 
for some reason my search result isn't returning back this document at all even 
when i searched for other field like content. However when i added the  root 
field name fix to my inclusion list i do see the document back again. I had 
already set the include root flag to true but seems like for some reason i am 
un-able to search for other fields in the document. Any ideas why this could be 
happening ?

fix
content some content goes here /content
enrichedDateTime2014-09-30T16:32:27.424443-07:00/enrichedDateTime
/fix



Girish Kulkarni
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] word query

2014-10-15 Thread Danny Sokolsky
Depending on what those structured queries are, they might not be word queries. 
 Excluding an element in the word query field does not mean you cannot query 
it, it just means that a cts:word-query will not see it.  For example, you can 
still see it in an element-word-query.

You say your reindexing started; did it complete?

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Girish Kulkarni
Sent: Wednesday, October 15, 2014 3:59 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] word query

As soon as i make changes to the word query , my database starts re-indexing.

We use marklogic 7.0-3 and we are using REST based structured queries. The 
query passes in a bunch of constraints and options , however i am just testing 
before and after scenario's based upon changes to the word query.

Girish

On Wed, Oct 15, 2014 at 3:55 PM, Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com wrote:
Did you reindex your database after changing the word query field?

Exactly what query are you running?

What version of MarkLogic are you using (xdmp:version() ).

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of Girish Kulkarni
Sent: Wednesday, October 15, 2014 3:48 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] word query

I had some fileds in my xml document like enrichedDateTime which i didnt want 
to index and search upon. When i added this in the word query exclusion list 
for some reason my search result isn't returning back this document at all even 
when i searched for other field like content. However when i added the  root 
field name fix to my inclusion list i do see the document back again. I had 
already set the include root flag to true but seems like for some reason i am 
un-able to search for other fields in the document. Any ideas why this could be 
happening ?

fix
content some content goes here /content
enrichedDateTime2014-09-30T16:32:27.424443-07:00/enrichedDateTime
/fix



Girish Kulkarni

___
General mailing list
General@developer.marklogic.commailto:General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general



--
Girish Kulkarni
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How to optimize the REST API Bulk Ingestion Performance?

2014-10-14 Thread Danny Sokolsky
Hi Gary,

A few thoughts here.  You are using 7.0-4 on this?

What are you comparing it to on the Oracle side?  In MarkLogic, the content 
will be all indexed and searchable.  Is that true on the orcl side too?

What indexes to you have enabled?  Maybe you do not need them all (or maybe you 
should put the equivalent indexing on the orcl side)?

Have you tried tweaking the batch size?  I would try a smaller number, say 50 
or 100.

Have you analyzed where you are spending the time?  In the c# code?  In the 
code loading the doc on MarkLogic?

Do you have multiple threads loading from your .net program?  If you are not 
maxing out your cpu on the MarkLogic side, you probably have room for more 
parallelization.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gary Russo
Sent: Tuesday, October 14, 2014 9:21 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] How to optimize the REST API Bulk Ingestion 
Performance?

MarkLogic Bulk ingestion processing is slower than an equivalent Oracle 
ingestion process.

The MarkLogic ingestion takes 30 minutes. An Oracle equivalent only takes 7 
minutes.

I'm using the REST API to bulk ingest multiple documents as described here. = 
http://docs.marklogic.com/guide/rest-dev/bulk#id_54649

Notes:

* C# code is used to call the MarkLogic Bulk Ingest REST API.

* Document batch size used is 500.

* Average doc size is 1 KB.

* JSON Conversion and Validation logic occurs in the C# code.


Any thoughts on how to optimize the MarkLogic bulk ingest to make it as fast as 
Oracle's 7 minute load time?


Thanks,
Gary R


Gary Russo
Enterprise NoSQL Developer
http://garyrusso.wordpress.com

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Adding new fields

2014-10-14 Thread Danny Sokolsky
You can turn reindexing off during peak times to minimize the impact.  It will 
pick up where you left off when you turn it back on.  Another thing you can do 
is to leave reindexing off, but just rewrite the documents that you want to 
(for example, do a document-insert of a document with its previous content as 
what to insert)—that will have the effect of reindexing just those documents.

If you use the path to specify your field, you can use any path that returns 
true from cts:valid-index-path:

http://docs.marklogic.com/cts:valid-index-path

I am not really understanding how your field can affect every document but you 
only want it in some of the documents.  Maybe the field is not selective enough 
(the path field might help there)?

Also, there are several bug fixes in 7.0-4 wrt fields, so planning and testing 
an upgrade might be a good idea.

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of vi...@tilaton.fi
Sent: Monday, October 13, 2014 11:43 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Adding new fields

Hi,

The indexes do not include the root element. Unfortunately we need to index an 
element that exists in all documents - the only thing that differs is the 
attribute value. (The field index settings are tweaked for specific purposes in 
each case, result from having different full text search requirements for 
specific document sets.)

As this is built on top of another product, we need to have the element named 
like it is in there, and the element is found in all documents. When I look at 
the database status right after adding one such field, I can see that the 
forests are all reindexing totalling millions of docs to go. With new tiered 
hardware this is completed in order of hours, sometimes takes over a day 
though, and with old hardware it took in order of weeks to add one. Our 
monitoring also reveals that it really spikes the usable disk bandwidth, so it 
is definitely working a lot. (My guess is that it selects all the docs with the 
element, but is not intelligent enough to limit using the attribute value too.)

Indexes that include only elements that can be found from a fraction of 
documents are not a problem. Is there some indexing option that I can turn on 
so that ML can index only the docs that have a specific attribute value in the 
given element? Now it seems only capable of querying the docs that have the 
element

This may also be a design issue, but unfortunately I'm unable to do any big 
changes to the way we do things in the codebase I've inherited.

We're running 7.0-2.3 btw, if that matters.

Ville

-- Original Message --
From: Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Sent: 14.10.2014 0:41:51
Subject: Re: [MarkLogic Dev General] Adding new fields

Hi Ville,

I don’t know of a way to tell MarkLogic to trust you in this case, and you 
should not need it to.  If you do not have any content to reindex, and if 
reindexing is enabled, it should not rewrite all of the content.  It will query 
all of the content to see if it needs reindexing, which will not be free but 
should not be too expensive, but I would not expect a full reindex to happen.  
In that case you should see some messages in the log about reindexing that 
database and a little later another message saying you reindexes 0 fragments 
(in fact, you will see these messages each time the config files change).

You mention your fields are doing includes.  I would recommend using paths for 
your fields instead.  Also, make sure your fields are not including the root, 
as that is almost never the correct way to do it.  Are you using 7.0-4 for 
this?  If not, try upgrading.

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of vi...@tilaton.fimailto:vi...@tilaton.fi
Sent: Monday, October 13, 2014 12:58 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Adding new fields

Hi,

when developing applications with ML as the database, we need to add new 
indexes regularly to deliver new features. We often (probably 95%) of the time 
add new indexes that will not hit any content in the database currently, but 
know that eventually will when new content is added.

As we have terabytes / millions of docs of content, these reindex operations 
can be costly and take considerable time to run.

So finally to the question: given that we're adding a new field that has one 
include, it seems that ML goes through all documents in the database (include 
limits by element and attribute value) - is there a way to tell ML that hey, we 
know, and we take the responsibility, that the database currently does

Re: [MarkLogic Dev General] Adding new fields

2014-10-14 Thread Danny Sokolsky
One other thing here:  if you have the reindexer off, you can ask the system 
how many fragments need reindexing using the “preview-reindexer” option in 
xdmp:forest-counts.  For example:

xdmp:forest-counts(xdmp:database-forests(xdmp:database(Documents)), (), 
preview-reindexer)

This will query the database and calculate the number of fragments needing 
reindexing, returning a report.

-Danny

From: Danny Sokolsky
Sent: Tuesday, October 14, 2014 11:14 AM
To: 'vi...@tilaton.fi'; 'MarkLogic Developer Discussion'
Subject: RE: [MarkLogic Dev General] Adding new fields

You can turn reindexing off during peak times to minimize the impact.  It will 
pick up where you left off when you turn it back on.  Another thing you can do 
is to leave reindexing off, but just rewrite the documents that you want to 
(for example, do a document-insert of a document with its previous content as 
what to insert)—that will have the effect of reindexing just those documents.

If you use the path to specify your field, you can use any path that returns 
true from cts:valid-index-path:

http://docs.marklogic.com/cts:valid-index-path

I am not really understanding how your field can affect every document but you 
only want it in some of the documents.  Maybe the field is not selective enough 
(the path field might help there)?

Also, there are several bug fixes in 7.0-4 wrt fields, so planning and testing 
an upgrade might be a good idea.

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of vi...@tilaton.fi
Sent: Monday, October 13, 2014 11:43 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Adding new fields

Hi,

The indexes do not include the root element. Unfortunately we need to index an 
element that exists in all documents - the only thing that differs is the 
attribute value. (The field index settings are tweaked for specific purposes in 
each case, result from having different full text search requirements for 
specific document sets.)

As this is built on top of another product, we need to have the element named 
like it is in there, and the element is found in all documents. When I look at 
the database status right after adding one such field, I can see that the 
forests are all reindexing totalling millions of docs to go. With new tiered 
hardware this is completed in order of hours, sometimes takes over a day 
though, and with old hardware it took in order of weeks to add one. Our 
monitoring also reveals that it really spikes the usable disk bandwidth, so it 
is definitely working a lot. (My guess is that it selects all the docs with the 
element, but is not intelligent enough to limit using the attribute value too.)

Indexes that include only elements that can be found from a fraction of 
documents are not a problem. Is there some indexing option that I can turn on 
so that ML can index only the docs that have a specific attribute value in the 
given element? Now it seems only capable of querying the docs that have the 
element

This may also be a design issue, but unfortunately I'm unable to do any big 
changes to the way we do things in the codebase I've inherited.

We're running 7.0-2.3 btw, if that matters.

Ville

-- Original Message --
From: Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Sent: 14.10.2014 0:41:51
Subject: Re: [MarkLogic Dev General] Adding new fields

Hi Ville,

I don’t know of a way to tell MarkLogic to trust you in this case, and you 
should not need it to.  If you do not have any content to reindex, and if 
reindexing is enabled, it should not rewrite all of the content.  It will query 
all of the content to see if it needs reindexing, which will not be free but 
should not be too expensive, but I would not expect a full reindex to happen.  
In that case you should see some messages in the log about reindexing that 
database and a little later another message saying you reindexes 0 fragments 
(in fact, you will see these messages each time the config files change).

You mention your fields are doing includes.  I would recommend using paths for 
your fields instead.  Also, make sure your fields are not including the root, 
as that is almost never the correct way to do it.  Are you using 7.0-4 for 
this?  If not, try upgrading.

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of vi...@tilaton.fimailto:vi...@tilaton.fi
Sent: Monday, October 13, 2014 12:58 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Adding new fields

Hi,

when developing applications with ML as the database, we need to add new 
indexes regularly to deliver new features. We often (probably 95%) of the time

Re: [MarkLogic Dev General] CTS Path restrictions

2014-10-13 Thread Danny Sokolsky
Hi Dom,

First off, please use the latest MarkLogic 7 (7.0-4 right now) as your 
base-line, as it has a lot of bug fixes since 7.0-1.

In MarkLogic 7, you can specify a path for what is indexed as your field.  This 
is a way more precise way than the old include/exclude way (which is still 
there, really only for compatibility purposes).  Here is a little info on it:

http://docs.marklogic.com/guide/admin/fields#id_23934

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Dominic Beesley
Sent: Monday, October 13, 2014 5:01 AM
To: 'MarkLogic Developer Discussion'
Subject: Re: [MarkLogic Dev General] CTS Path restrictions

Thanks Danny,

We're moving to 7 at the moment and I'm using 7.0-1 as the base-line version 
though I've not seen anything in the documentation that is any different to 4.2 
which was my previous base-line version.

I'm not sure what mean by a path field - do you mean a pre-built attribute or 
something or is there another type of lexicon or index that I've missed?

My main issue now is that it seems that iterating through the result set to 
move from the meta/field element up to the root auth element to return the id 
is relatively slow. On some searches I can us cts:uris to just get the uris 
which kind of works but then I lost the relevance score...

Cheers

Dom


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: 12 October 2014 20:19
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] CTS Path restrictions

Hi Dominic,

It sounds like you got this working somewhat, but here are a few observations.

You did not say what version of MarkLogic this is or what index settings you 
have.  For this type of search to resolve accurately unfiltered, you would need 
to have word positions and element positions enabled on the db config.  Also, 
newer versions of MarkLogic have a lot of improvements in this area.

Another thing that might be worth trying here is to create a path field 
containing the data you are interested.  That is likely to be more efficient.

-Danny


From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [general-boun...@developer.marklogic.com] on behalf of Dominic Beesley 
[domi...@brahms.demon.co.uk]
Sent: Sunday, October 12, 2014 3:35 AM
To: 'MarkLogic Developer Discussion'
Subject: Re: [MarkLogic Dev General] CTS Path restrictions
I've partially answered my own questions...(I think)

for $r in cts:search(doc('domtest.xml')/d/auth,
  cts:element-query(xs:QName('meta'), cts:element-query(xs:QName('field'),
  cts:and-query((
cts:element-attribute-value-query(xs:QName('field'), 
xs:QName('type'), 'title')
  , cts:word-query('queries')
  ))

  ))
  , ('filtered', 'checked')
)
return
  res id='{ $r/@id }' score='{ cts:score($r) }' /

Will match the word queries in field[@type='title']

And

for $r in cts:search(doc('domtest.xml')/d/auth/meta,
  cts:element-query(xs:QName('field'),
  cts:and-query((
cts:element-attribute-value-query(xs:QName('field'), 
xs:QName('type'), 'title')
  , cts:word-query('queries')
  ))

  )
  , ('filtered', 'checked')
)
return
  res id='{ $r/ancestor-or-self::auth[last()]/@id }' score='{ 
cts:score($r) }' /

Will match only at the root level though with the added work of having to find 
the root id in the result but I still have to do extra work combining any res 
items returned for multiple hits in the same root.

D

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Dominic Beesley
Sent: 10 October 2014 16:12
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] CTS Path restrictions

Hello,

I've been playing around with cts:search trying to get performance better on 
our data set. I'm having a few problems!

The data (simplified here) is a set of nested auth elements which represent 
the root, chapter, section, etc levels of a document. Each auth contains a 
meta which in turn controls field elements - each field element has a @type 
attribute which indicates its type. The structure of the data cannot be 
changed...

Firstly, how do I search for a word in an element with a particular attribute 
i.e. in the example below look for the word queries in field[@type='title'] 
(example 1 is what I thought worked but it doesn't it returns the hits on the 
precis field too)

Secondly, how do I search for something only at the root level i.e. if I just 
wanted to match a word in /d/auth/field[@type='title'] as opposed to 
/d/auth//field[@type='titlle']

I know that I could use the path in the cts:search to narrow down

Re: [MarkLogic Dev General] Adding new fields

2014-10-13 Thread Danny Sokolsky
Hi Ville,

I don’t know of a way to tell MarkLogic to trust you in this case, and you 
should not need it to.  If you do not have any content to reindex, and if 
reindexing is enabled, it should not rewrite all of the content.  It will query 
all of the content to see if it needs reindexing, which will not be free but 
should not be too expensive, but I would not expect a full reindex to happen.  
In that case you should see some messages in the log about reindexing that 
database and a little later another message saying you reindexes 0 fragments 
(in fact, you will see these messages each time the config files change).

You mention your fields are doing includes.  I would recommend using paths for 
your fields instead.  Also, make sure your fields are not including the root, 
as that is almost never the correct way to do it.  Are you using 7.0-4 for 
this?  If not, try upgrading.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of vi...@tilaton.fi
Sent: Monday, October 13, 2014 12:58 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Adding new fields

Hi,

when developing applications with ML as the database, we need to add new 
indexes regularly to deliver new features. We often (probably 95%) of the time 
add new indexes that will not hit any content in the database currently, but 
know that eventually will when new content is added.

As we have terabytes / millions of docs of content, these reindex operations 
can be costly and take considerable time to run.

So finally to the question: given that we're adding a new field that has one 
include, it seems that ML goes through all documents in the database (include 
limits by element and attribute value) - is there a way to tell ML that hey, we 
know, and we take the responsibility, that the database currently does not have 
any content that needs to be reindex, so even though the database wide 
reindexer enable is on, please do not do any reindexing for this field?

Would it work to toggle reindexer enable off while adding the fields, and then 
toggling it back on. What about new documents added during reindexer is off? 
(We don't have the luxury to stop writes at any given time.)

Ville
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] CTS Path restrictions

2014-10-12 Thread Danny Sokolsky
Hi Dominic,

It sounds like you got this working somewhat, but here are a few observations.

You did not say what version of MarkLogic this is or what index settings you 
have.  For this type of search to resolve accurately unfiltered, you would need 
to have word positions and element positions enabled on the db config.  Also, 
newer versions of MarkLogic have a lot of improvements in this area.

Another thing that might be worth trying here is to create a path field 
containing the data you are interested.  That is likely to be more efficient.

-Danny


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Dominic Beesley 
[domi...@brahms.demon.co.uk]
Sent: Sunday, October 12, 2014 3:35 AM
To: 'MarkLogic Developer Discussion'
Subject: Re: [MarkLogic Dev General] CTS Path restrictions

I’ve partially answered my own questions…(I think)

for $r in cts:search(doc('domtest.xml')/d/auth,
  cts:element-query(xs:QName('meta'), cts:element-query(xs:QName('field'),
  cts:and-query((
cts:element-attribute-value-query(xs:QName('field'), 
xs:QName('type'), 'title')
  , cts:word-query('queries')
  ))

  ))
  , ('filtered', 'checked')
)
return
  res id='{ $r/@id }' score='{ cts:score($r) }' /

Will match the word queries in field[@type='title']

And

for $r in cts:search(doc('domtest.xml')/d/auth/meta,
  cts:element-query(xs:QName('field'),
  cts:and-query((
cts:element-attribute-value-query(xs:QName('field'), 
xs:QName('type'), 'title')
  , cts:word-query('queries')
  ))

  )
  , ('filtered', 'checked')
)
return
  res id='{ $r/ancestor-or-self::auth[last()]/@id }' score='{ 
cts:score($r) }' /

Will match only at the root level though with the added work of having to find 
the root id in the result but I still have to do extra work combining any res 
items returned for multiple hits in the same root.

D

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Dominic Beesley
Sent: 10 October 2014 16:12
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] CTS Path restrictions

Hello,

I’ve been playing around with cts:search trying to get performance better on 
our data set. I’m having a few problems!

The data (simplified here) is a set of nested auth elements which represent 
the root, chapter, section, etc levels of a document. Each auth contains a 
meta which in turn controls field elements – each field element has a @type 
attribute which indicates its type. The structure of the data cannot be changed…

Firstly, how do I search for a word in an element with a particular attribute 
i.e. in the example below look for the word “queries” in field[@type=’title’] 
(example 1 is what I thought worked but it doesn't it returns the hits on the 
precis field too)

Secondly, how do I search for something only at the root level i.e. if I just 
wanted to match a word in /d/auth/field[@type='title'] as opposed to 
/d/auth//field[@type='titlle']

I know that I could use the path in the cts:search to narrow down the search to 
a particular level/field but the trouble then is when I want to combine two 
searches with and/or

i.e. I can do cts:search(doc()/d/auth/meta/field[@type='title'], 'precis') but 
would I search for say beer in title and pdfs in precis.

I'm sure I had some of this working about 4 years ago but I can't remember it!

At the moment I've got it doing something like:

for $r in cts:search(/d/auth/meta/field[@type='title'], 'beer') return item 
id='{ $r/ancestor::auth[not(parent::auth)]/@id }' /
,   for $r in cts:search(/d/auth/meta/field[@type='precis'], 
'pdfs') return item id='{ $r/ancestor::auth[not(parent::auth)]/@id }' /


The application then does the combination and score arithmetic. Trouble is that 
the $r/ancestor::… bit is quite slow on large sets and a lot of information is 
returned to the app from the server which when doing an and is usually a lot 
larger than the intersection. I could probably do the intersection in XQuery 
too but I suspect the combining and finding the root id bit would still be slow?

Any pointers appreciated!

D


xdmp:document-insert('domtest.xml',
d
auth id=1werwer
  meta
field type=titleThe Book of Queries/field
field type=precisOne man's struggle to overcome confusion and 
reach enlightenment/field
  /meta
/auth
auth id=2sdfsfsdf
  meta
field type=titleMisunderstanding CTS/field
field type=precisMy autobiography/field
  /meta
  auth id=xcvzxcvzxcv
meta
  field type=numberChapter 1/field
  field type=titleQueries explained/field
/meta
  /auth
/auth
auth id=4cvzxcvxcv
  meta
field type=titleThe 

Re: [MarkLogic Dev General] Adding new index to replicated ML servers

2014-09-29 Thread Danny Sokolsky
And here is the doc on this, FWI:

http://docs.marklogic.com/guide/database-replication/dbrep_intro#id_27654

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of vi...@tilaton.fi
Sent: Sunday, September 28, 2014 11:23 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Adding new index to replicated ML servers

Thank you Mike!

Ville

-- Original Message --
From: Michael Blakeley m...@blakeley.commailto:m...@blakeley.com
To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Sent: 29.9.2014 9:20:31
Subject: Re: [MarkLogic Dev General] Adding new index to replicated ML servers

Change the replica first, then the master. Each will index independently.

-- Mike

On Sep 28, 2014, at 23:04, vi...@tilaton.fimailto:vi...@tilaton.fi wrote:
I tried to search for the answer, but couldn't find it, I would appreciate if 
any of you could direct me to the correct chunk of documentation to find this 
out:

We have two node ML7 setup where one of the nodes is master and other slave 
using database replication matched by the database name. (This is NOT flexible 
replication)

We execute queries to both hosts 24/7 but obviously write only to the primary 
one.

We often need to add new indexes to the system and the (multi part) question is:

1. Does ML replicate the index definitions between hosts?
2. Does ML replicate the indexes themselves between the hosts?
3. What's the correct procedure to add a new index in this setup?

We currently add the indexes by hand, starting from the slave. We noticed that 
the slave does not initiate automatic reindexing, even though we have 
reindexer enable set to true and figured it's better to add the new index to 
slave first so that it will be there when the primary starts reindexing.

So, is it required at all to add the indexes first to slave, or will ML take 
care of the configuration changes via the replication also or does that include 
only data?

Ville
___
General mailing list
General@developer.marklogic.commailto:General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] using cts:boost-query with search:resolve in Marklogic 7

2014-09-17 Thread Danny Sokolsky
Range queries do not contribute to score in MarkLogic 6.  They do in MarkLogic 
7.  So if you are using MarkLogic 6 that explains the 0 scores.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Mrinmoy Khamrui
Sent: Wednesday, September 17, 2014 7:03 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7

Hi Erik,

I got a chance to try out this. I am using below query as my boost query but it 
seems we would still require feature similar to score-function. Otherwise the 
score for all the matching elements are coming as 0.

boost query
==
cts:element-range-query(
xs:QName(pubdate), =, current-dateTime())

Am I missing anything?

Thanks
Mrinmoy

On Thu, Sep 11, 2014 at 8:15 PM, Erik Hennum 
erik.hen...@marklogic.commailto:erik.hen...@marklogic.com wrote:
Hi, Mrinmoy:

On MarkLogic 6, you should be able come close to a boost query with

search:query xmlns:search=http://marklogic.com/appservices/search;

  search:and-query

YOUR_MATCHING_QUERY_HERE

search:or-query

  YOUR_BOOSTING_QUERY_HERE

  search:and-query/

/search:or-query

  /search:and-query

/search:query
or the cts:query equivalent

cts:and-query((

  YOUR_MATCHING_QUERY_HERE,

  cts:or-query((

YOUR_BOOSTING_QUERY_HERE,

cts:and-query(())

))

  ))
Within the or query, the and query matches everything, so the boosting query 
should only affect ranking and not matching.


Hoping that helps,

Erik Hennum

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 on behalf of Mrinmoy Khamrui 
[mrinmoy.kham...@ideacrestsolutions.commailto:mrinmoy.kham...@ideacrestsolutions.com]
Sent: Monday, September 08, 2014 11:17 PM

To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7

Hi Erik,

Is there a way to implement cts:boost-query in marklogic 6 apart from using 
document quality? We need to have similar feature on marklogic 6. Please 
suggest.

Thanks
Mrinmoy

On Fri, Sep 5, 2014 at 10:25 PM, Mrinmoy Khamrui 
mrinmoy.kham...@ideacrestsolutions.commailto:mrinmoy.kham...@ideacrestsolutions.com
 wrote:
Hi Erik,

Thanks for pointing that. It worked.

-- Mrinmoy

On Fri, Sep 5, 2014 at 8:38 PM, Erik Hennum 
erik.hen...@marklogic.commailto:erik.hen...@marklogic.com wrote:
Hi, Mrinmoy:

The search:resolve() function expects the serialized version of the cts:query.  
Try:

let $results := search:resolve(q{$query}/q/*, $options, $start, 
$pageRecs)

See:

http://docs.marklogic.com/search:resolve


Hoping that helps,


Erik Hennum

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 on behalf of Mrinmoy Khamrui 
[mrinmoy.kham...@ideacrestsolutions.commailto:mrinmoy.kham...@ideacrestsolutions.com]
Sent: Friday, September 05, 2014 7:38 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7
Hi Erik,

Many thanks. Please find below the error. I can execute the same query with 
cts:search but search:resolve complains



[1.0-ml] XDMP-AS: (err:XPTY0004) $ctsquery as element() -- Invalid coercion: 
cts:boost-query(cts:path-range-query(/products/product/productcategoryassociations/catalog[@code
 = q..., =, xs:int(10001), (), 1), 
cts:path-range-query(/products/product/edition, , 0, 
(score-function=linear,slope-factor=10), 1)) as element()
Stack Trace
In /MarkLogic/appservices/search/search.xqy on line 64
In xdmp:eval(xquery version quot;1.0-mlquot;;#10;#10;import module 
namesp..., (), options 
xmlns=xdmp:evaldatabase13679529190427072881/databaseisolationdifferent-tr.../options)
In /MarkLogic/appservices/qconsole/qconsole-amped.xqy on line 202
In amped-qconsole:qconsole-eval(xquery version 
quot;1.0-mlquot;;#10;#10;import module namesp..., (), options 
xmlns=xdmp:evaldatabase13679529190427072881/databaseisolationdifferent-tr.../options)

$xquery := xquery version quot;1.0-mlquot;;#10;#10;import module namesp...
$vars := ()
$options := options 
xmlns=xdmp:evaldatabase13679529190427072881/databaseisolationdifferent-tr.../options

On Fri, Sep 5, 2014 at 7:53 PM, Erik Hennum 
erik.hen...@marklogic.commailto:erik.hen...@marklogic.com wrote:
Hi, Mrinmoy:

Can you provide the invalid coercion error?  Including the expression, module,
and line number identified by the error (and the specific MarkLogic version)?


Thanks,


Erik Hennum

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 

Re: [MarkLogic Dev General] using cts:boost-query with search:resolve in Marklogic 7

2014-09-17 Thread Danny Sokolsky
You can consider moving to MarkLogic 7.  Also, you can add other non-range 
queries to your cts:query, if that is possible.  And quality is also an option, 
either at load time or as an update later.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Mrinmoy Khamrui
Sent: Wednesday, September 17, 2014 10:53 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7

Then is it that only option left is to set document quality at the time of 
loading?

Thanks
Mrinmoy

On Wed, Sep 17, 2014 at 10:05 PM, Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com wrote:
Range queries do not contribute to score in MarkLogic 6.  They do in MarkLogic 
7.  So if you are using MarkLogic 6 that explains the 0 scores.

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of Mrinmoy Khamrui
Sent: Wednesday, September 17, 2014 7:03 AM

To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7

Hi Erik,

I got a chance to try out this. I am using below query as my boost query but it 
seems we would still require feature similar to score-function. Otherwise the 
score for all the matching elements are coming as 0.

boost query
==
cts:element-range-query(
xs:QName(pubdate), =, current-dateTime())

Am I missing anything?

Thanks
Mrinmoy

On Thu, Sep 11, 2014 at 8:15 PM, Erik Hennum 
erik.hen...@marklogic.commailto:erik.hen...@marklogic.com wrote:
Hi, Mrinmoy:

On MarkLogic 6, you should be able come close to a boost query with

search:query xmlns:search=http://marklogic.com/appservices/search;

  search:and-query

YOUR_MATCHING_QUERY_HERE

search:or-query

  YOUR_BOOSTING_QUERY_HERE

  search:and-query/

/search:or-query

  /search:and-query

/search:query
or the cts:query equivalent

cts:and-query((

  YOUR_MATCHING_QUERY_HERE,

  cts:or-query((

YOUR_BOOSTING_QUERY_HERE,

cts:and-query(())

))

  ))
Within the or query, the and query matches everything, so the boosting query 
should only affect ranking and not matching.


Hoping that helps,

Erik Hennum

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 on behalf of Mrinmoy Khamrui 
[mrinmoy.kham...@ideacrestsolutions.commailto:mrinmoy.kham...@ideacrestsolutions.com]
Sent: Monday, September 08, 2014 11:17 PM

To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7

Hi Erik,

Is there a way to implement cts:boost-query in marklogic 6 apart from using 
document quality? We need to have similar feature on marklogic 6. Please 
suggest.

Thanks
Mrinmoy

On Fri, Sep 5, 2014 at 10:25 PM, Mrinmoy Khamrui 
mrinmoy.kham...@ideacrestsolutions.commailto:mrinmoy.kham...@ideacrestsolutions.com
 wrote:
Hi Erik,

Thanks for pointing that. It worked.

-- Mrinmoy

On Fri, Sep 5, 2014 at 8:38 PM, Erik Hennum 
erik.hen...@marklogic.commailto:erik.hen...@marklogic.com wrote:
Hi, Mrinmoy:

The search:resolve() function expects the serialized version of the cts:query.  
Try:

let $results := search:resolve(q{$query}/q/*, $options, $start, 
$pageRecs)

See:

http://docs.marklogic.com/search:resolve


Hoping that helps,


Erik Hennum

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 on behalf of Mrinmoy Khamrui 
[mrinmoy.kham...@ideacrestsolutions.commailto:mrinmoy.kham...@ideacrestsolutions.com]
Sent: Friday, September 05, 2014 7:38 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] using cts:boost-query with search:resolve 
in Marklogic 7
Hi Erik,

Many thanks. Please find below the error. I can execute the same query with 
cts:search but search:resolve complains



[1.0-ml] XDMP-AS: (err:XPTY0004) $ctsquery as element() -- Invalid coercion: 
cts:boost-query(cts:path-range-query(/products/product/productcategoryassociations/catalog[@code
 = q..., =, xs:int(10001), (), 1), 
cts:path-range-query(/products/product/edition, , 0, 
(score-function=linear,slope-factor=10), 1)) as element()
Stack Trace
In /MarkLogic/appservices/search/search.xqy on line 64
In xdmp:eval(xquery version quot;1.0-mlquot;;#10;#10;import module 
namesp..., (), options 
xmlns=xdmp:evaldatabase13679529190427072881/databaseisolationdifferent-tr.../options)
In /MarkLogic/appservices/qconsole/qconsole-amped.xqy on line 202
In amped

Re: [MarkLogic Dev General] How to export XML to ASCII text with ISO encodings?

2014-09-10 Thread Danny Sokolsky
These are also available via the xdmp:output option in the XQuery prolog:

http://docs.marklogic.com/guide/xquery/langoverview#id_71572

Note that you will not see the effect of these when running in Query Console 
because the output options only affect the outer query, and underneath the 
covers in Query Console it is running an eval of whatever query you enter.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Joe Bryan
Sent: Wednesday, September 10, 2014 12:58 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] How to export XML to ASCII text with ISO 
encodings?

Hi Tim,

There's a serialization option to control which entities are output: 
output-sgml-character-entities (see http://docs.marklogic.com/xdmp:quote).

xdmp:quote(xdmp:unquote(xuuml;/x))
=
xü/x


xdmp:quote(xdmp:unquote(xuuml;/x),
  options xmlns=xdmp:quote
output-sgml-character-entitiesnormal/output-sgml-character-entities
  /options)
=
xuuml;/x


Thanks.

-jb


From: Tim t...@aaom.netmailto:t...@aaom.net
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Wednesday, September 10, 2014 at 3:49 PM
To: 'MarkLogic Developer Discussion' 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] How to export XML to ASCII text with ISO 
encodings?

FYI - I know that I ca use the full repair option upon import - the real 
challenge is adding the character encodings upon export.

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Tim
Sent: Wednesday, September 10, 2014 12:28 PM
To: 'MarkLogic Developer Discussion'
Subject: [MarkLogic Dev General] How to export XML to ASCII text with ISO 
encodings?

Hi Folks,

I am importing content from an ASCII text file into an XML record to manage 
updates in MarkLogic, but upon request I need to export an updated ASCII text 
file. The ASCII text file can include a variety of ISO encodings and upon 
export it is required that some ASCII characters (such as apostrophes and 
ampersands) be out put with their equivalent ISO encoding, i.e., apos; and 
amp;) and that any characters exceeding the ASCII range be output with ISO 
encodings, e.g., uuml;.

First of all I need to ensure that any text content with ISO encodings can be 
adequately imported into its UTF-8 representation.  Secondly, upon export to a 
text file, I need to add back in the ISO entity encodings. Any suggestions?

Thank you!

Tim M.

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] cts:element-query

2014-09-09 Thread Danny Sokolsky
Hi Dave,

That works for me on 7.0-3.  Are you sure document looks exactly like that?  
Here is what I did:

xdmp:document-insert(/Dave.xml,
lncr:doc xmlns:lncr=http://www.lexis-nexis.com/lncr;
  lncr:metadata
lncr:titles
  lncr:titlePeople v. Johnson/lncr:title
/lncr:titles
  /lncr:metadata
/lncr:doc);

cts:search(doc(/Dave.xml),
cts:element-query(fn:QName(http://www.lexis-nexis.com/lncr,titles;),
   
cts:element-word-query(fn:QName(http://www.lexis-nexis.com/lncr,title;), 
people)
   ) )

That returns the document.

What version of MarkLogic?

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Steiner, David J. 
(LNG-DAY)
Sent: Tuesday, September 09, 2014 7:52 AM
To: General Mark Logic Developer Discussion (general@developer.marklogic.com)
Subject: [MarkLogic Dev General] cts:element-query

Must be doing something wrong because it feels like I'm following the 
documentation nearly exactly.
Data:
lncr:doc xmlns:lncr=http://www.lexis-nexis.com/lncr;
  lncr:metadata
lncr:titles
  lncr:titlePeople v. Johnson/lncr:title
/lncr:titles
...
/lncr:doc


This works:
cts:search(fn:doc(),
   
cts:element-word-query(fn:QName(http://www.lexis-nexis.com/lncr,title;), 
people)
)[1]

This doesn't:
cts:search(fn:doc(),
   cts:element-query(fn:QName(http://www.lexis-nexis.com/lncr,titles;),
   
cts:element-word-query(fn:QName(http://www.lexis-nexis.com/lncr,title;), 
people)
   )
)[1]

But it seems like it should...
From the documentation:
The cts:element-queryhttp://docs.marklogic.com/cts:element-query function 
searches through a specified element and all of its children. It is used to 
narrow the field of search to the specified element hierarchy, exploiting the 
XML structure in the data. Also, it is composable with other 
cts:element-queryhttp://docs.marklogic.com/cts:element-query functions, 
allowing you to specify complex hierarchical conditions in the 
cts:queryhttp://docs.marklogic.com/cts:query expressions.
For example, the following search against a Shakespeare database returns the 
title of any play that has SCENE elements that have SPEECH elements containing 
both the words 'room' and 'castle':
for $x in cts:search(fn:doc(),
   cts:element-query(xs:QName(SCENE),
   cts:element-query(xs:QName(SPEECH),
   cts:and-query((room, castle)) ) ) )
return
($x//TITLE)[1]
This query returns the first TITLE element of the play. The TITLE element is 
used for both play and scene titles, and the first one in a play is the title 
of the play.


In fact, this doesn't work, but it seems like it should if in fact, the 
cts:element-query function searches through a specified element and all of its 
children as the documentation says.
cts:search(fn:doc(),
   cts:element-query(fn:QName(http://www.lexis-nexis.com/lncr,titles;), 
people)
)[1]

I'm trying to build a query where I do different word searches at different 
paths within the documents
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] possible bug w/directory deletion

2014-08-28 Thread Danny Sokolsky
Hi Mike,

I am not seeing this in 7.0-3.  If you try to do a document-delete on a 
directory /test/, I am seeing XDMP-DOCNOTFOUND.

Are you sure you did not create a document at the /test/ uri?

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Mike Sokolov
Sent: Thursday, August 28, 2014 7:00 AM
To: MarkLogic Dev General
Subject: [MarkLogic Dev General] possible bug w/directory deletion

The documentation for xdmp:document-delete() says that it deletes a document 
and all its properties *except for the directory property*.

However, the following sequence of queries results in an empty properties 
document (using 7.0-2.3):

xdmp:directory-create(/test/);
xdmp:document-delete(/test/);
xdmp:document-properties(/test/);

with directory creation set to either manual or automatic

I have a workaround, but I think that is a bug?  However it's in such direct 
contradiction to the documentation that I wonder if I am misreading that.

- Mike
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] possible bug w/directory deletion

2014-08-28 Thread Danny Sokolsky
My test was with directory-creation=automatic.  You also get the same behavior 
(XDMP-DOCNOTFOUND ) with directory-creation=manual-enforced.

I think this makes sense, although the documentation could certainly be more 
clear about it ;)

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Thursday, August 28, 2014 9:33 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] possible bug w/directory deletion

With 7.0-3 on OSX and directory-creation=manual, I don't see a XDMP-DOCNOTFOUND 
error either.

xdmp:describe(doc(/test/));
xdmp:describe(xdmp:document-properties(/test/));
xdmp:directory-create(/test/);
xdmp:describe(xdmp:document-properties(/test/));
xdmp:document-delete(/test/);
xdmp:describe(xdmp:document-properties(/test/));

=
()
()
xdmp:document-properties(/test/)
()

I think that agrees with what Mike described. The first two expressions return 
(), verifying that I didn't have a pre-existing document or directory at 
'/test/'. Then we see a properties element, verifying that the directory was 
created. Then xdmp:document-delete succeeds where the docs say it won't. 
Afterward there's no directory property at '/test/'.

-- Mike

On 28 Aug 2014, at 08:45 , Danny Sokolsky danny.sokol...@marklogic.com wrote:

 Hi Mike,
 
 I am not seeing this in 7.0-3.  If you try to do a document-delete on a 
 directory /test/, I am seeing XDMP-DOCNOTFOUND.
 
 Are you sure you did not create a document at the /test/ uri?
 
 -Danny
 
 -Original Message-
 From: general-boun...@developer.marklogic.com 
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mike Sokolov
 Sent: Thursday, August 28, 2014 7:00 AM
 To: MarkLogic Dev General
 Subject: [MarkLogic Dev General] possible bug w/directory deletion
 
 The documentation for xdmp:document-delete() says that it deletes a document 
 and all its properties *except for the directory property*.
 
 However, the following sequence of queries results in an empty properties 
 document (using 7.0-2.3):
 
 xdmp:directory-create(/test/);
 xdmp:document-delete(/test/);
 xdmp:document-properties(/test/);
 
 with directory creation set to either manual or automatic
 
 I have a workaround, but I think that is a bug?  However it's in such direct 
 contradiction to the documentation that I wonder if I am misreading that.
 
 - Mike
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] possible bug w/directory deletion

2014-08-28 Thread Danny Sokolsky
No, not exactly.  The statement in the documentation assumes that directory 
creation is automatic or manual-enforced.  In those cases, what it says is 
correct.  When directory creation is manual, however, then the doc is not 
accurate now; in that case, document-delete will delete the document (if it 
exists) and all of its properties (including the directory property).

I will update the doc to be more clear about that.

-Danny 

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Mike Sokolov
Sent: Thursday, August 28, 2014 11:28 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] possible bug w/directory deletion

So my takeaway is that there was a glitch, but the behavior in more recent 
releases conforms to the documentation.  Thanks, everyone

-Mike

On 08/28/2014 01:09 PM, Danny Sokolsky wrote:
 My test was with directory-creation=automatic.  You also get the same 
 behavior (XDMP-DOCNOTFOUND ) with directory-creation=manual-enforced.

 I think this makes sense, although the documentation could certainly 
 be more clear about it ;)

 -Danny

 -Original Message-
 From: general-boun...@developer.marklogic.com 
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael 
 Blakeley
 Sent: Thursday, August 28, 2014 9:33 AM
 To: MarkLogic Developer Discussion
 Subject: Re: [MarkLogic Dev General] possible bug w/directory deletion

 With 7.0-3 on OSX and directory-creation=manual, I don't see a 
 XDMP-DOCNOTFOUND error either.

 xdmp:describe(doc(/test/));
 xdmp:describe(xdmp:document-properties(/test/));
 xdmp:directory-create(/test/);
 xdmp:describe(xdmp:document-properties(/test/));
 xdmp:document-delete(/test/);
 xdmp:describe(xdmp:document-properties(/test/));

 =
 ()
 ()
 xdmp:document-properties(/test/)
 ()

 I think that agrees with what Mike described. The first two expressions 
 return (), verifying that I didn't have a pre-existing document or directory 
 at '/test/'. Then we see a properties element, verifying that the directory 
 was created. Then xdmp:document-delete succeeds where the docs say it won't. 
 Afterward there's no directory property at '/test/'.

 -- Mike

 On 28 Aug 2014, at 08:45 , Danny Sokolsky danny.sokol...@marklogic.com 
 wrote:

 Hi Mike,

 I am not seeing this in 7.0-3.  If you try to do a document-delete on a 
 directory /test/, I am seeing XDMP-DOCNOTFOUND.

 Are you sure you did not create a document at the /test/ uri?

 -Danny

 -Original Message-
 From: general-boun...@developer.marklogic.com 
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mike 
 Sokolov
 Sent: Thursday, August 28, 2014 7:00 AM
 To: MarkLogic Dev General
 Subject: [MarkLogic Dev General] possible bug w/directory deletion

 The documentation for xdmp:document-delete() says that it deletes a document 
 and all its properties *except for the directory property*.

 However, the following sequence of queries results in an empty properties 
 document (using 7.0-2.3):

 xdmp:directory-create(/test/);
 xdmp:document-delete(/test/);
 xdmp:document-properties(/test/);

 with directory creation set to either manual or automatic

 I have a workaround, but I think that is a bug?  However it's in such direct 
 contradiction to the documentation that I wonder if I am misreading that.

 - Mike
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Deleting system databases

2014-08-26 Thread Danny Sokolsky
I would tend to leave them, as they will cost you very little to have.  There 
is no need to configure replicas for them if you are not using them, just make 
sure they are not configured to be used with any other databases or App 
Servers.  

-Danny 

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Whitby, Rob
Sent: Tuesday, August 26, 2014 6:44 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Deleting system databases

Hi,

Is it safe to delete any/all of these databases?

Extensions
Fab
Last-Login
Triggers

We¹re not using any of them so don¹t really want to have to configure replica 
forests.

ML 7 btw.

Cheers
Rob


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] sql interface for java

2014-08-18 Thread Danny Sokolsky
You can always use an ad-hoc query from Java and call xdmp:sql.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of 
qinggangwa...@gmail.com
Sent: Monday, August 18, 2014 1:54 AM
To: Discussion
Subject: Re: [MarkLogic Dev General] sql interface for java


I have set up the odbc server and have run queries in the mlsql client.  But I 
want ask can I run query in java other than in mlsql?

Thanks
evil

qinggangwa...@gmail.commailto:qinggangwa...@gmail.com

From: Joe Bryanmailto:joe.br...@marklogic.com
Date: 2014-08-18 16:40
To: MarkLogic Developer Discussionmailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] sql interface for java
Hi,

You can setup an ODBC server, and run SQL queries with the bundled mlsql 
client, or any ODBC driver: http://docs.marklogic.com/guide/sql/setup#chapter.

Thanks.

-jb

From: qinggangwa...@gmail.commailto:qinggangwa...@gmail.com 
qinggangwa...@gmail.commailto:qinggangwa...@gmail.com
Reply-To: MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Monday, August 18, 2014 at 4:31 AM
To: Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] sql interface for java

It seems that I do not express my idea clearly. What I want to express is that 
can I use sql to query by sql interface using java other than in the query 
console?


qinggangwa...@gmail.commailto:qinggangwa...@gmail.com

From: qinggangwa...@gmail.commailto:qinggangwa...@gmail.com
Date: 2014-08-18 15:05
To: Discussionmailto:general@developer.marklogic.com
Subject: sql interface for java
Hi All,
  Could the sql interface of marklogic be used by java? The databases of 
marklogic support the existence of sql interface and rest interface at the same 
time. So I think can I use the sql interface by java directly in order to not 
use the seach querymanager.

Best regards
evil

qinggangwa...@gmail.commailto:qinggangwa...@gmail.com
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] An error occured when install the marklogic

2014-08-07 Thread Danny Sokolsky
Can you say exactly what you were doing when you got this error, and what 
version of MarkLogic?

My guess is that you are trying to run rpm as an unprivileged user; you must 
run it as root.

http://docs.marklogic.com/guide/installation/procedures#id_28962

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of 
qinggangwa...@gmail.com
Sent: Thursday, August 07, 2014 2:08 AM
To: Discussion
Subject: [MarkLogic Dev General] An error occured when install the marklogic

Hi All,

   There is an error occured when I install the marklogic in the Redhat5.8. The 
error is in the follow:

   error: unpacking of archive failed on file 
/opt/MarkLogic/lib/libldap-2.4.so.2.10.2;53e3404e: cpio: read

  Can anyone give me a hand ?

Regards
evil


qinggangwa...@gmail.commailto:qinggangwa...@gmail.com
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Security Design

2014-07-28 Thread Danny Sokolsky
Hi Tim,

I am not sure I have thought this through completely, nor can I think of the 
exact steps to do this, but here is my instinct on how I would attempt to solve 
this:

I would try to create amped functions that allow Sue to share (read only) Tom’s 
document (that Sue has read permission for).  I think the function could amp to 
a role paired with a read permission on the document, thus allowing Tom to read 
the document.

Like I said, I am not totally sure how I would write such a function, but it 
seems possible (though tricky).  See if that scratches an itch.

Maybe someone else has a better idea.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Timothy W. Cook
Sent: Monday, July 28, 2014 7:19 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Security Design

I am in the early design stages of a (hopefully) large application and would 
like to see if I understand the operations of collections correctly.

You can think of this in a similar context to a social media app.
I have attached a simple diagram to aid the text.

Imagine that Joe, Sue and Tom are users and each have a collection (marked 'P' 
)where only they have read/write access to documents they load.
Joe and Tom have collections that they would like to use to share (read only) 
with various other users, one being Sue.  This seems rather straight forward.
However, the use case also calls for Sue being able to share (read only) Tom's 
documents with Joe and Joe's documents with Tom; as she sees fit without the 
intervention of Tom or Joe.

Could someone expand on this to describe how this might be setup?  Do I need 
separate roles that are tied to each collection, for each of these exchanges?

Thanks,
Tim


--


Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.orghttp://www.mlhim.org/

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Security Design

2014-07-28 Thread Danny Sokolsky
For your question about collections, there are 2 types of collections, 
“collections” and “protected collections”.  Collections have no security 
associated with them, and a document can have many (or no) collections, but 
access to the document is simply by permissions.

Protected collections are a bit different, and in general, I would not 
recommend using them.  They create a document in the security database, and 
they only affect access to the documents when asking for them *by collection* 
(ie, using fn:collection).  When accessing a document by a protected 
collection, you need to have permissions on both the collection and the 
document.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Timothy W. Cook
Sent: Monday, July 28, 2014 3:52 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Security Design

Thanks Danny.  I was hoping to get a discussion around this because I am not 
sure it is as simple as I first thought.
I had not considered using amped functions to do it.

Of course this was just a three person example.  The real use case involves Sue 
needing to have the ability to share read access to several other users on 
documents where she only has read access.

At this point  I have minimal exposure to the way MarkLogic handles document 
level security and trying to relate this to the documentation in the Search 
Guide on Collections security.  So, I think this needs good planning before 
jumping into implementation.

A specific question is; do I understand correctly that a document can be in 
many collections and that collection access must be granted before document 
access is checked?

--Tim

On Mon, Jul 28, 2014 at 7:31 PM, Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com wrote:
Hi Tim,

I am not sure I have thought this through completely, nor can I think of the 
exact steps to do this, but here is my instinct on how I would attempt to solve 
this:

I would try to create amped functions that allow Sue to share (read only) Tom’s 
document (that Sue has read permission for).  I think the function could amp to 
a role paired with a read permission on the document, thus allowing Tom to read 
the document.

Like I said, I am not totally sure how I would write such a function, but it 
seems possible (though tricky).  See if that scratches an itch.

Maybe someone else has a better idea.

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of Timothy W. Cook
Sent: Monday, July 28, 2014 7:19 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Security Design

I am in the early design stages of a (hopefully) large application and would 
like to see if I understand the operations of collections correctly.

You can think of this in a similar context to a social media app.
I have attached a simple diagram to aid the text.

Imagine that Joe, Sue and Tom are users and each have a collection (marked 'P' 
)where only they have read/write access to documents they load.
Joe and Tom have collections that they would like to use to share (read only) 
with various other users, one being Sue.  This seems rather straight forward.
However, the use case also calls for Sue being able to share (read only) Tom's 
documents with Joe and Joe's documents with Tom; as she sees fit without the 
intervention of Tom or Joe.

Could someone expand on this to describe how this might be setup?  Do I need 
separate roles that are tied to each collection, for each of these exchanges?

Thanks,
Tim


--


Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.orghttp://www.mlhim.org/


___
General mailing list
General@developer.marklogic.commailto:General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general



--


Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.orghttp://www.mlhim.org/

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Strict validation error encountered in ML7 but not in ML6

2014-07-14 Thread Danny Sokolsky
Or you can restart MarkLogic, which will also clear the cache.

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Mary Holstege
Sent: Monday, July 14, 2014 12:28 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Strict validation error encountered in ML7 
but not in ML6

On Mon, 14 Jul 2014 10:43:40 -0700, Tim t...@aaom.net wrote:

 How do I clear the expanded tree cache?

xdmp:expanded-tree-cache-clear()

You need to be admin to run it.


 Tim

 -Original Message-
 From: Mary Holstege [mailto:mary.holst...@marklogic.com]
 Sent: Saturday, July 12, 2014 9:56 PM
 To: 'MarkLogic Developer Discussion'; Tim
 Subject: Re: [MarkLogic Dev General] Strict validation error 
 encountered in ML7 but not in ML6

 On Sat, 12 Jul 2014 12:45:47 -0700, Tim t...@aaom.net wrote:

 After a little more investigating, it looks like there is a problem 
 updating a schema.  In this case I'm simply adding some optional 
 element attributes to the schema and updating it in the schemas 
 database, but strict validation of a document is failing.  When I 
 revert back to the previous schema it validates just fine.  What is up with 
 that?

 A couple of thoughts here:
 Do you have other schemas around for the same namespace?
 Unless you are very careful with schema locations in that case, the 
 lookup-by-namespace may grab the wrong one.

 You might also try clearing the expanded tree cache after loading a new 
 schema. The schema information associated with a particular document is 
 cached in the representation of it in the expanded tree cache and that can be 
 sticky across changes to a particular schema stored in the database.
 The system isn't really designed to accommodate on-the-fly schema changes 
 like that.

 It also appears that my schema was updated automatically at some 
 point to include the use=optional attribute  for optional schema 
 attributes and that elements were updated with the nillible=false and 
 abstract=false attributes.
 I don't understand why this happened.  Fortunately the update posed 
 no problems with validation, but it is out of sync with the original 
 schema in my repository
 - kind of weird.

 I think what you are seeing here is defaulted attributes being serialized.
 (They are getting defaulted from the schema-for-schemas). This is a 
 serialization issue entirely, and there are controls for when they get 
 included in serialization. I suspect you may be copying the schema XDM 
 instance in some way, because the default is to not include them in the 
 serialization.
 More recent versions avoid serializing them on copies as well.

 //Mary

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general



--
Using Opera's revolutionary email client: http://www.opera.com/mail/ 
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] SVC-SEMPOST error filling up log file

2014-07-10 Thread Danny Sokolsky
Hi Jakob,

I recommend you contact support for this one.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Jakob Fix
Sent: Thursday, July 10, 2014 3:00 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] SVC-SEMPOST error filling up log file

Hi,

we encounter repeatedly the following error:

2014-07-10 00:00:06.972 Error: Semaphore::post: SVC-SEMPOST: Semaphore post 
error: ReleaseSemaphore: The handle is invalid..
…
2014-07-10 11:32:12.629 Error: Semaphore::post: SVC-SEMPOST: Semaphore post 
error: ReleaseSemaphore: The handle is invalid..
2014-07-10 11:32:12.629 Error: Semaphore::post: SVC-SEMPOST: Semaphore post 
error: ReleaseSemaphore: The handle is invalid..
2014-07-10 11:32:12.629 Error: Semaphore::post: SVC-SEMPOST: Semaphore post 
error: ReleaseSemaphore: The handle is invalid..

It's filling up the log file until the disk is full. We're using 7.0-3 on 
Windows 2012.

Thanks for helping us to understand the issue.

cheers,
Jakob.
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Security Role deleted

2014-07-08 Thread Danny Sokolsky
Do you have a backup of your security database?  If so, you can shut down the 
server, then copy the Security forest back in.

If not, you do you need anything in your current security db?  If not, you can 
move everything aside and then re-initialize your system, which will create a 
new Security database.  If you do need that, then you will need to do some 
surgery to put it all back together again.

In short, when you delete a role, it is gone, and to get it back you have to 
restore it or recreate it.

-Danny


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Sikandar
Sent: Tuesday, July 08, 2014 8:11 AM
To: general-requ...@developer.marklogic.com; general@developer.marklogic.com
Subject: [MarkLogic Dev General] Security Role deleted

Hi All,

By mistake, I deleted Admin role from the UI and seeing below issues.

I tried to unsintall MarkLogic without deleting any data and re-install ML 
however seeing same issues.

Data is critical for me, so is there any way to correct this problem without 
data loss.

You've encountered an error in the server. Please copy the text below, and 
email support (supp...@marklogic.commailto:supp...@marklogic.com):
500: Internal Server Error
SEC-NOADMIN: (err:FOER) User does not have admin role.
In /MarkLogic/security.xqy on line 4959
In sec:check-admin()
In /lib/status-check.xqy on line 16
In status-check()
In / on line 6

Thanks in advance!

Jeet
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Reading Multiple Documents by URI (REST API)

2014-06-27 Thread Danny Sokolsky
Hi Szilard,

I believe the bulk REST API stuff is new in 7.0-3:

https://docs.marklogic.com/guide/relnotes/chap3#id_89380

So that I think is why this is not working on 7.0-2.  Try upgrading to 7.0-3.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Szilard Nemethy
Sent: Friday, June 27, 2014 3:08 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Reading Multiple Documents by URI (REST API)

Hi,

I'm trying to use the /v1/documents REST endpoint to read multiple documents by 
URI (as described in the following guide 
https://docs.marklogic.com/guide/rest-dev/bulk#id_44502) but keep getting the 
following error response:
rapi:error 
xmlns:rapi=http://marklogic.com/rest-api;http://marklogic.com/rest-apirapi:status-code400/rapi:status-coderapi:statusBad
 
Request/rapi:statusrapi:message-codeREST-REPEATEDPARAM/rapi:message-coderapi:messageREST-REPEATEDPARAM:
 (rest:REPEATEDPARAM) Endpoint does not support repeated parameter: uri can 
only appear once/rapi:message/rapi:error
Is there some kind of configuration that needs to done prior to use the uri 
parameter repeatedly? (MarkLogic version 7.0-2.3)

Regards,
Szilard
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] external nodes cannot be updated

2014-06-26 Thread Danny Sokolsky
Hi Jakob,

A node that is passed in from an invoking module is an external node (even if 
it was created by copying a node from the database).

Does that make sense?

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Jakob Fix
Sent: Thursday, June 26, 2014 1:18 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] external nodes cannot be updated

Hi,

it seems that a node that has been passed in from an invoking module (via one 
of the xdmp:invoke or xdmp:spawn functions) cannot be updated inside the 
invoked code.

Is this behaviour by design? Why? If so, I couldn't find a mentioning of this 
in the documentation. For example, 
http://docs.marklogic.com/xdmp:node-insert-child lists quite a number of 
restrictions where it won't work (in-memory nodes, no document nodes as child 
nodes of element nodes, ...), but not this one.

cheers,
Jakob.
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] external nodes cannot be updated

2014-06-26 Thread Danny Sokolsky
An invoke is in its own transaction, so it cannot hold onto the locks needed to 
update it (nor would you want it to).  You are making a copy, which turns it 
into an in-memory node.

So yes, if you want to update it in another program, you will have to provide 
the other program a way to access it.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Jakob Fix
Sent: Thursday, June 26, 2014 1:31 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] external nodes cannot be updated

Hi Danny,

I understand that. However, I don't understand why you cannot update it. Is it 
a copy of the original node that's being passed to the invoked modle?

Of course, there are ways around it, like

document(xdmp:node-uri($original-node))/*

to get the root node of the external node, but it was just a bit confusing to 
not see it mentioned in the documentation.


cheers,
Jakob.

On Thu, Jun 26, 2014 at 10:25 PM, Danny Sokolsky 
danny.sokol...@marklogic.commailto:danny.sokol...@marklogic.com wrote:
Hi Jakob,

A node that is passed in from an invoking module is an external node (even if 
it was created by copying a node from the database).

Does that make sense?

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com]
 On Behalf Of Jakob Fix
Sent: Thursday, June 26, 2014 1:18 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] external nodes cannot be updated

Hi,

it seems that a node that has been passed in from an invoking module (via one 
of the xdmp:invoke or xdmp:spawn functions) cannot be updated inside the 
invoked code.

Is this behaviour by design? Why? If so, I couldn't find a mentioning of this 
in the documentation. For example, 
http://docs.marklogic.com/xdmp:node-insert-child lists quite a number of 
restrictions where it won't work (in-memory nodes, no document nodes as child 
nodes of element nodes, ...), but not this one.

cheers,
Jakob.

___
General mailing list
General@developer.marklogic.commailto:General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Static resources taking a long time to load in ML 6.0-4.1

2014-06-23 Thread Danny Sokolsky
Hi Demian,

I have not seen a problem like that.  That does seem like a strange rewrite 
rule there though.

Can you duplicate this behavior on another app server on the same host?  Maybe 
without the rewriter?

Have you looked in your log file for anything odd, or your access file?  You 
might want to turn your logging level to debug if it is not already set there.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Demian Hess
Sent: Monday, June 23, 2014 4:52 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Static resources taking a long time to load in 
ML 6.0-4.1

I have an xquery application running on a Windows 2003 server in ML 6.0-4.1.

A few times each day, the application will hang when serving static js and 
css files. I can often cause this behavior if (in Chrome or FF) I clear the 
browser cache, and then try to hit the login page. When I watch the page load 
in the network monitor, I can see the css and js files waiting to load.

We are using URL rewriting and the router xquery has a rule that matches these 
static files:
if (matches($url, concat(^/resources)) ) then ( $url ) else ...
I can't tell if this is a problem in the application, Marklogic, the Windows 
server or the network.
Has anyone seen problems like this in MarkLogic apps?

--
Demian Hess
Architect | Avalon Consulting, LLC
M: 301.943.8307 | Fax: 845.367.5496
LinkedIn: http://www.linkedin.com/company/avalon-consulting-llc
Google+: http://www.google.com/+AvalonConsultingLLC
Twitter:https://twitter.com/avalonconsult

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Evaluation of `declare variable` vs `let`

2014-06-19 Thread Danny Sokolsky
I would only declare a variable if you thought you would want to use it many 
times, otherwise it makes your code harder to read.  I would say you should do 
what makes sense for your code.   

So mostly it is just a matter of style.

My 2c.
-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of 
abhinav.mish...@cognizant.com
Sent: Thursday, June 19, 2014 8:56 AM
To: general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] Evaluation of `declare variable` vs `let`

Correct Rob,  declare variable  evaluated lazily and is never evaluated more 
than once. So the expression in right side will never be evaluated until the 
declared variable accessed for the first time.

Thanks,
Abhinav

From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Whitby, Rob 
[rob.whi...@springer.com]
Sent: Thursday, June 19, 2014 9:20 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Evaluation of `declare variable` vs `let`

declare variable Š is lazily evaluated, which is great unless you never access 
the variable but expect it to cause a side-effect.


On 19/06/2014 16:28, Retter, Adam (RBI-UK) adam.ret...@rbi.co.uk wrote:

Given a main module with no user defined functions, is it considered 
better practice to use `declare variable` as opposed to `let`, the 
reason I ask is twofold:

1) I have started on a large code-base that seems to eschew `let` in 
favour of using `declare variable`. This seems somewhat strange to me.

2) We have seen different evaluation strategies, whereby a function 
which returns an empty-sequence which is bound in a declare variable 
clause, is never executed. Yet when we re-write that as a let binding, 
the code is executed. I think perhaps the query optimiser in ML is 
being too aggressive here?


For example -

declare variable $content-type as xs:string := 
slib:validated-bulk-load-content-type();

and then a few lines later we have -

slib:normal-bulk-load-response ($etag-map, fn:count 
($etag-map/store:etag-entry), $content-type)

Subsequently the `slib:normal-bulk-load-response` calls 
xdmp:set-response-content-type($content-type). However the 
`slib:validated-bulk-content-type()` function is never evaluated, we 
are certain of this because it eventually calls `fn:error`, yet the 
error never occurs!

If we switch the `declare variable $content-type` for a `let 
$content-type` then we do see the error occurring!

Cheers Adam.

DISCLAIMER
This message is intended only for the use of the person(s) (Intended
Recipient) to whom it is addressed. It may contain information, which 
is privileged and confidential. Accordingly any dissemination, 
distribution, copying or other use of this message or any of its 
content by any person other than the Intended Recipient may constitute 
a breach of civil or criminal law and is strictly prohibited. If you 
are not the Intended Recipient, please contact the sender as soon as possible.
Reed Business Information Limited. Registered Office: Quadrant House, 
The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
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
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] QConsole lost data

2014-06-05 Thread Danny Sokolsky
Will, I think you said you are using 7.0-1.  There were several bugs fixed in 
7.0-2, so an upgrade might be a good idea.

-Danny

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Thursday, June 05, 2014 6:23 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] QConsole lost data

I don't know much about the qconsole code. Earlier versions used the same 
backend as cq, but all that seems to have changed. Maybe support could help?

Looking at qconsole-model.xqy and qconsole-amped.xqy I think the workspaces 
should be this:

collection()/qconsole:workspace[qconsole:security/qconsole:userid = $userid]

...where $userid is xdmp:get-current-userid(). Any changes to your security 
database recently? Have you compared userid values between the new and old 
workspaces?

Also, I see is that qconsole supports import and export. Maybe you could trick 
it into taking one of your backup files as an import? The exports seem to have 
no namespace, but I didn't look into other differences.

-- Mike

On 5 Jun 2014, at 15:04 , Will Thompson wthomp...@jonesmcclure.com wrote:

 All of the current workspaces are there, along with this old workspace (there 
 are two named Workspace) that is the only one getting loaded. It at least 
 looks like most if not all of the current histories are there. I'm not sure 
 what I should try next...delete the unwanted duplicate workspace? I dumped 
 the XML to my filesystem, just in case anything goes awry.
 
 -W
 
 
 From: general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of Will Thompson 
 wthomp...@jonesmcclure.com
 Sent: Thursday, June 5, 2014 3:57 PM
 To: MarkLogic Developer Discussion
 Subject: Re: [MarkLogic Dev General] QConsole lost data
 
 I use several workspaces, but everything seems to have reverted to before I 
 did. I.e.: there are several tabs in Workspace that I had reorganized into 
 other workspaces like Utils, etc.  (months, if not over a year ago), and I 
 had accumulated several other ones by importing them (those are backed up, 
 but unfortunately they're not very important).
 
 I'll see if I can find anything in those directories. Thanks.
 
 -Will
 
 
 From: general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of Michael Blakeley 
 m...@blakeley.com
 Sent: Thursday, June 5, 2014 3:34 PM
 To: MarkLogic Developer Discussion
 Subject: Re: [MarkLogic Dev General] QConsole lost data
 
 Everything seems to be stored in these locations:
 
xdmp:directory('/workspaces/', 'infinity')
 
xdmp:directory('/histories/', 'infinity')
 
 Is it possible that it just switched you to a different workspace?
 
 -- Mike
 
 On 5 Jun 2014, at 12:36 , Will Thompson wthomp...@jonesmcclure.com wrote:
 
 I just noticed that on my dev QConsole (on ML 7.0-1 OSX) workspaces and tabs 
 appear to have somehow reverted to a state from many months ago. Nothing 
 significant has occurred directly relating to ML. The only thing out of the 
 ordinary is that Chrome recently crashed, after which I restarted it and 
 restored all my tabs. Before that, QConsole was fine.
 
 Any idea what might of happened (and how to prevent it)? And more 
 importantly, is there any way to get that data back? I created a merge 
 blackout on App-Services, just in case that might help facilitate recovery 
 with point-in-time.
 
 -Will
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 
 
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general
 

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] CPF Privileges

2014-05-30 Thread Danny Sokolsky
Hi Girish,

It all depends on what code your action is spawning.  There is no special 
privileges needed to run cpf code, but all of the code in your cpf action will 
be run as the same user that calls the triggering event.

So the way to figure out what privileges are needed is to call the action code 
outside of your cpf environment as the user you want to run, and start seeing 
what privileges are needed to run that code (it will throw exceptions for 
privileges that are needed).

That is a place to start.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Girish Kulkarni
Sent: Friday, May 30, 2014 4:25 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] CPF Privileges

We have a role which is being used to make a cpf call. The CPF action contains a
​call to a webservice api and a REST api over http on the same Marklogic server.

​For some reason i am able to trigger the cpf process if i upload a document 
only when i assign the admin role to this new role.

If i remove the admin role and just assign the following roles / Execute 
privileges..i see CPF execute errors in the Error log. Any clues on what are 
the missing roles / privileges for the cpf to execute

app-user
domain-management
filesystem-access
flexrep-user
hadoop-user-read
hadoop-user-write
pipeline-execution
pipeline-management
rest-admin
rest-reader
rest-writer​


​Thanks
Girish Kulkarni
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] best practices for manual directory creation

2014-05-22 Thread Danny Sokolsky
I think if you want to maintain these yourself, you should not use the system 
maintained properties; instead, make up some of your own that do the equivalent 
things.

That being said, have you tried leaving directory creation at automatic, but 
turning off maintain last modified and maintain directory last modified?  
Depending upon how deep your directory hierarchy is, this might not cause too 
much overhead.  I would recommend trying that, and then just add a dateTime 
property (or element in the document if you prefer, allowing you to not have to 
create a property fragment) to track whatever you want about the last modified 
(based on your app requirements).  I think that might work well, especially if 
your hierarchy does not not have millions of directories.  See how it works and 
let us know.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Keith L. Breinholt
Sent: Thursday, May 22, 2014 8:23 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] best practices for manual directory 
creation

prop:last-modified is not a property that you can manually set.  I believe 
that is a security issue.

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Mike Sokolov
Sent: Thursday, May 22, 2014 8:26 AM
To: MarkLogic General ML
Subject: Re: [MarkLogic Dev General] best practices for manual directory 
creation

I'm getting good results updating the directory timestamps using:

xdmp:document-set-properties ($dir-uri, prop:directory/)

and this seems to limit the number of prop:directory properties to 2 too

-Mike
On 05/22/2014 10:03 AM, Mike Sokolov wrote:
I'm working with a system that requires directories and directory-modified 
timestamps (for a webDAV-like browsing feature), but have found that automatic 
directory creation introduces unacceptable lock contention during bulk updates, 
so I am looking into managing the directory creation and timestamp updates 
manually.

I have one question, and one strange observation - maybe a bug.  I'm working 
with 7.0-2.3.

First the question: how should I update the prop:last-modified property?

Updating it explicitly raises an error:
XDMP-ARG: xdmp:document-set-property(/books/, prop:last-modified 
xmlns:prop=http://marklogic.com/xdmp/property;https://urldefense.proofpoint.com/v1/url?u=http://marklogic.com/xdmp/propertyk=wlPCrglRP6kzT4RbABWMaw%3D%3D%0Ar=2FOxwjXkcRFP9Zb5gsGqutGbMyYaH6V5O1y2qyDOE%2Bw%3D%0Am=tMQwNzleMcPFHrHVywsz7LShGCB7BV0fr4nwOoRO9yE%3D%0As=b129b0afdc261f273e05e156d512fac53273fae49be30e4e6423deb66508ad092014-05-22T15:53:46.724003+02:00/prop:last-modified)
 -- Invalid argument

even though I have maintain directory last modified set to false (and 
directory creation = manual).  I do have maintain last modified set to true, so 
I expect that is happening automatically on directory creation - OK, but in 
that instance how would I update the directory modified time when inserting or 
deleting documents in the directory?

I tried adding a dummy property using xdmp:set-property, and that does seem to 
update the timestamp, but I don't really want to do that if I don't have to, of 
course.  Perhaps I could delete and then recreate the directory properties 
document, but that doesn't seem great either. Any other ideas?

Now the weird observation.  It seems that every time I modify the directory 
properties document, it gets another prop:directory / property node!  
Currently I have:

prop:properties 
xmlns:prop=http://marklogic.com/xdmp/property;https://urldefense.proofpoint.com/v1/url?u=http://marklogic.com/xdmp/propertyk=wlPCrglRP6kzT4RbABWMaw%3D%3D%0Ar=2FOxwjXkcRFP9Zb5gsGqutGbMyYaH6V5O1y2qyDOE%2Bw%3D%0Am=tMQwNzleMcPFHrHVywsz7LShGCB7BV0fr4nwOoRO9yE%3D%0As=b129b0afdc261f273e05e156d512fac53273fae49be30e4e6423deb66508ad09
prop:directory/
prop:directory/
prop:directory/
prop:directory/
prop:directory/
prop:directory/
prop:directory/
prop:directory/
prop:directory/
prop:directory/
prop:last-modified2014-05-22T15:47:37+02:00/prop:last-modified
/prop:properties

I thought that properties documents maintained a map with unique keys?

-Mike



___

General mailing list

General@developer.marklogic.commailto:General@developer.marklogic.com

http://developer.marklogic.com/mailman/listinfo/generalhttps://urldefense.proofpoint.com/v1/url?u=http://developer.marklogic.com/mailman/listinfo/generalk=wlPCrglRP6kzT4RbABWMaw%3D%3D%0Ar=2FOxwjXkcRFP9Zb5gsGqutGbMyYaH6V5O1y2qyDOE%2Bw%3D%0Am=tMQwNzleMcPFHrHVywsz7LShGCB7BV0fr4nwOoRO9yE%3D%0As=c9cb9dbd161260f93e52fe3901e1bb716460a6fcc74f86cb436db69aa2cd554c



NOTICE: This email message is for the sole use of the intended recipient(s) and 
may contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and 

Re: [MarkLogic Dev General] Non-breaking space in QConsole

2014-05-22 Thread Danny Sokolsky
Yes, the browser is going to do with it what it will, and that will likely 
change based on various settings you have in your environment (language, etc).  
But when that string leaves MarkLogic, it will be the UTF-8 codepoint character 
(not the entity, as XQuery converts that to the character).

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Joe Bryan
Sent: Thursday, May 22, 2014 7:16
To: Florent Georges; MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Non-breaking space in QConsole

Hi Florent,

When I evaluate 'foo#xa0;bar', and then inspect the results using the Chrome 
Developer Tools, I see 'foonbsp;bar' in both Auto and Raw modes. The 
non-breaking space seems to be converted to a regular space when it's copied.

In Firefox, I'm not seeing the nbsp; entity at all.

Thanks.

-jb

From: Florent Georges li...@fgeorges.orgmailto:li...@fgeorges.org
Reply-To: Florent Georges li...@fgeorges.orgmailto:li...@fgeorges.org, 
MarkLogic Developer Discussion 
general@developer.marklogic.commailto:general@developer.marklogic.com
Date: Thursday, May 22, 2014 at 9:12 AM
To: MarkLogic General ML 
general@developer.marklogic.commailto:general@developer.marklogic.com
Subject: [MarkLogic Dev General] Non-breaking space in QConsole

  Hi,

  When evaluating the following query in QConsole: 'foo#xa0;bar'
(that is, a simple string containing a non-breaking space), the
result displayed in the result pane is 'foo bar', containing a regular
space instead (both in Auto and Raw modes).

  Which is not only not correct, but might lead to surprises as well.
I spent quite some time trying to debug a query, copying a string
value from the result pane and using it in a predicate (just to be
sure I got the *exact same value*), and the query kept failing.
Because the string actually contained some non-breaking space, and
using a regular space did not then match in the predicate.

  Is it a known bug?

  Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] best practices for manual directory creation

2014-05-22 Thread Danny Sokolsky
I don't see anything wrong with creating directories manually, there is even an 
api for it:

http://docs.marklogic.com/xdmp:directory-create

But it seems like it might be a pretty big burden on the application to do 
that, that is the only reason I was suggesting making that automatic and seeing 
how cheap or expensive that is for your app (and if you are creating the dirs 
anyway, how different would that actually be than having MarkLogic create them 
for you).

One other thing to note: newer versions of MarkLogic have a lot of performance 
improvements around large updates and deletes, so if you are on an older 
version of MarkLogic, upgrades can be good.

-Danny


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Michael Sokolov 
[soko...@falutin.net]
Sent: Thursday, May 22, 2014 7:18 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] best practices for manual directory 
creation

Thanks for the suggestion, Danny; it seems sensible.  At this stage I don't 
want to modify the rest of the system, which is pretty mature and relies on the 
system-maintained last-modified property.  In fact we already maintain a 
separate modified timestamp in the documents with different semantics (eg you 
can copy a document without updating its timestamp), but this can't be used for 
tracking changes to binary documents.  So I think we are stuck with the 
built-in maintain-last-modified.

I did briefly try having directory creation=automatic + maintain directory last 
modified=false and maintain-last-modified=true, but I thought it looked as if 
things were slowing down again during a large document import.  I didn't 
measure carefully or continue this experiment for long though because I think I 
have a solution to the manual directory creation that is effective.  All our 
document updates go through a single java API, so I can track updated uris 
there and manage directory insertion in batches as a separate process.  And it 
seems that the trick of setting the directory/ property tickles the 
modified-time.  I suppose if that became unsupported it could cause problems, 
but I think I can live with that risk.

Coming back around to my initial question though -- it seems like the consensus 
here is that best practice is *not* to create directories manually?

-Mike

On 5/22/2014 12:05 PM, Danny Sokolsky wrote:
I think if you want to maintain these yourself, you should not use the system 
maintained properties; instead, make up some of your own that do the equivalent 
things.

That being said, have you tried leaving directory creation at automatic, but 
turning off maintain last modified and maintain directory last modified?  
Depending upon how deep your directory hierarchy is, this might not cause too 
much overhead.  I would recommend trying that, and then just add a dateTime 
property (or element in the document if you prefer, allowing you to not have to 
create a property fragment) to track whatever you want about the last modified 
(based on your app requirements).  I think that might work well, especially if 
your hierarchy does not not have millions of directories.  See how it works and 
let us know.

-Danny

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Keith L. 
Breinholt
Sent: Thursday, May 22, 2014 8:23 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] best practices for manual directory 
creation

prop:last-modified is not a property that you can manually set.  I believe 
that is a security issue.

From: 
general-boun...@developer.marklogic.commailto:general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Mike Sokolov
Sent: Thursday, May 22, 2014 8:26 AM
To: MarkLogic General ML
Subject: Re: [MarkLogic Dev General] best practices for manual directory 
creation

I'm getting good results updating the directory timestamps using:

xdmp:document-set-properties ($dir-uri, prop:directory/)

and this seems to limit the number of prop:directory properties to 2 too

-Mike
On 05/22/2014 10:03 AM, Mike Sokolov wrote:
I'm working with a system that requires directories and directory-modified 
timestamps (for a webDAV-like browsing feature), but have found that automatic 
directory creation introduces unacceptable lock contention during bulk updates, 
so I am looking into managing the directory creation and timestamp updates 
manually.

I have one question, and one strange observation - maybe a bug.  I'm working 
with 7.0-2.3.

First the question: how should I update the prop:last-modified property?

Updating it explicitly raises an error:
XDMP-ARG: xdmp:document-set-property(/books/, prop:last-modified 
xmlns:prop=http://marklogic.com/xdmp/property;https://urldefense.proofpoint.com/v1/url?u=http://marklogic.com/xdmp/propertyk

  1   2   3   4   5   6   7   8   >