Re: [MarkLogic Dev General] Is there a way to delete a stand-alone properties document?

2017-05-19 Thread Steven Anderson
Thanks, that worked like a charm.

On Fri, May 19, 2017 at 2:23 PM, Justin Makeig 
wrote:

> First, why are you working with "stand-alone [un-sic.] properties
> documents"? Could your implementation be simplified by storing the
> properties in their own documents? There's no real advantage to a
> properties fragment, other than being able to access it with the same URI
> as its related document. Accessing the contents still requires a join
> between two fragments, just like with two separate documents.
>
> In your particular case, you should be able to remove the properties
> fragment with, xdmp:node-delete(xdmp:document-properties($uri)).
>
> Justin
>
> > On May 19, 2017, at 4:06 PM, Steve Anderson 
> wrote:
> >
> > I'm doing some work with stand-along properties documents, and I want to
> be able to delete them.  I know I can delete all the properties with a
> >
> > xdmp:document-set-properties($uri, ())
> >
> > but that leaves an empty properties document hanging around.  Is there a
> way to delete it?
> >
> > Thanks,
> >
> >   Steve
> > ___
> > General mailing list
> > General@developer.marklogic.com
> > Manage your subscription at:
> > http://developer.marklogic.com/mailman/listinfo/general
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>


-- 

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


Re: [MarkLogic Dev General] Is there a way to delete a stand-alone properties document?

2017-05-19 Thread Justin Makeig
First, why are you working with "stand-alone [un-sic.] properties documents"? 
Could your implementation be simplified by storing the properties in their own 
documents? There's no real advantage to a properties fragment, other than being 
able to access it with the same URI as its related document. Accessing the 
contents still requires a join between two fragments, just like with two 
separate documents. 

In your particular case, you should be able to remove the properties fragment 
with, xdmp:node-delete(xdmp:document-properties($uri)).

Justin

> On May 19, 2017, at 4:06 PM, Steve Anderson  wrote:
> 
> I'm doing some work with stand-along properties documents, and I want to be 
> able to delete them.  I know I can delete all the properties with a 
> 
> xdmp:document-set-properties($uri, ())
> 
> but that leaves an empty properties document hanging around.  Is there a way 
> to delete it?
> 
> Thanks,
> 
>   Steve
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at: 
> http://developer.marklogic.com/mailman/listinfo/general



smime.p7s
Description: S/MIME cryptographic signature
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Is there a way to delete a stand-alone properties document?

2017-05-19 Thread Steve Anderson
I'm doing some work with stand-along properties documents, and I want to be
able to delete them.  I know I can delete all the properties with a

xdmp:document-set-properties($uri, ())

but that leaves an empty properties document hanging around.  Is there a
way to delete it?

Thanks,

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


[MarkLogic Dev General] Different estimates while doing search

2017-05-19 Thread Shiv Shankar
Hi,

I've created a range index on ptype and ran the below queries and I am
getting the difference in count. What could be the reason? Any advice?

// This one is getting lesser results

cts.estimate(cts.andQuery([cts.jsonPropertyRangeQuery('ptype', "=",
"25"),cts.collectionQuery(["COLLECTION-1"])]));

// This one is getting accurate results.

cts.estimate(cts.andQuery([cts.jsonPropertyValueQuery("ptype","25"),cts.collectionQuery("COLLECTION-1")]));


Regards

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


Re: [MarkLogic Dev General] Logging Java Api

2017-05-19 Thread Sam Mefford
I don't see this code anywhere creating any log files nor connecting the out 
stream to any logging framework.  To see the contents of "out", you'll need to 
write them to a file, or print them to standard out, or connect a logging 
framework to do that for you.  All RequestLogger is trying to do is allow you 
to capture the requests sent to the REST server if that's desirable.  If all 
you need is logging, please use your preferred logging framwork.  We're not 
attempting to be a logging framework, we're attempting to be ready to connect 
with and work in harmony with your preferred logging framework.

Here's and important relevant excerpt from the javadoc summary 
page:

Enabling Logging

We use slf4j for logging. This means you can 
choose any slf4j-compliant logging framework such as Logback, AVSL, JDK 
logging, Log4j, or Simple. If you don't know which to choose, we recommend 
Logback since it is a native implementation and the easiest to configure. 
Please follow the instructions on the slf4j website to configure your logging 
framework. It should take no more than 15 minutes. Once your logging framework 
is configured with slf4j, you should be able to see and manage logging from the 
Java-client API. This is especially important for long-running QueryBatcher and 
WriteBatcher jobs.


Sam Mefford
Senior Engineer
MarkLogic Corporation
sam.meff...@marklogic.com
Cell: +1 801 706 9731
www.marklogic.com

This e-mail and any accompanying attachments are confidential. The information 
is intended solely for the use of the individual to whom it is addressed. Any 
review, disclosure, copying, distribution, or use of this e-mail communication 
by others is strictly prohibited. If you are not the intended recipient, please 
notify us immediately by returning this message to the sender and delete all 
copies. Thank you for your cooperation.

From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Andreas Holzgethan 
[andreas.holzget...@ebcont.com]
Sent: Friday, May 19, 2017 3:18 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Logging Java Api

We tried different ways:

1.

ByteArrayOutputStream out = new ByteArrayOutputStream();
RequestLogger logger = databaseClient.newLogger(out);
xmlDocumentManager.startLogging(logger);
try {
out.write("Test!".getBytes());
out.flush();
} catch (IOException e) {
e.printStackTrace();
}

DocumentDescriptor e = this.xmlDocumentManager.newDescriptor(this.getUri(id));
StringHandle content = (StringHandle)this.xmlDocumentManager.read(e, (new 
StringHandle()).withFormat(Format.XML));

2.

ByteArrayOutputStream out = new ByteArrayOutputStream();
RequestLogger logger = databaseClient.newLogger(out);
xmlDocumentManager.startLogging(logger);

try {

logger.getPrintStream().write("Test".getBytes());
logger.getPrintStream().flush();
} catch (IOException e) {
e.printStackTrace();
}

DocumentDescriptor e = this.xmlDocumentManager.newDescriptor(this.getUri(id));
StringHandle content = (StringHandle)this.xmlDocumentManager.read(e, (new 
StringHandle()).withFormat(Format.XML));

We also tried to call startLogging after the try catch block.

Once we've also tried to call append instead of write, but we never found 
"Test" in the Logfiles.


Best regards

Andreas Holzgethan

Andreas Holzgethan BSc.
IT Consultant

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

Mobil: +43 664 606 517 05
Email:andreas.holzget...@ebcont.com
Web:http://www.ebcont-et.com/

OUR TEAM IS YOUR SUCCESS

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

2017-05-18 18:40 GMT+02:00 Sam Mefford 
>:
Can you please share the code you tried that did not work?

Sam Mefford
Senior Engineer
MarkLogic Corporation
sam.meff...@marklogic.com
Cell: +1 801 706 9731
www.marklogic.com

This e-mail and any accompanying attachments are confidential. The information 
is intended solely for the use of the individual to whom it is addressed. Any 
review, disclosure, copying, distribution, or use of this e-mail communication 
by others is strictly prohibited. If you are not the intended recipient, please 
notify us immediately by returning this message to the sender and delete all 
copies. Thank you for your cooperation.

From: 
general-boun...@developer.marklogic.com
 
[general-boun...@developer.marklogic.com]
 on behalf of Andreas Felix 
[andreas.fe...@ebcont.com]
Sent: