[MarkLogic Dev General] abstract and name elements value is null when convert XML to json

2018-05-24 Thread Indrajeet Verma
Hi - I am converting XML doc to json and it was working before till today.

Now suddenly  and  elements values are converting into
"null" values.

I am using custom config strategy.

Have someone faced this issue before?

XML:


2017-08-31T16:00:08.131792-04:00

active
2017-08-31
10.1056/nejm-jw.NA44895
NA44895
When Genetic Testing Is Unproven: The Case of Depression
Treatments
/nlm-articles/jwx/2017/08/31/jx-NA44895.xml


Genetic testing of your depressed patient will not help you
find the right medication.



Psychiatry

Yes


AU111
Peter Roy-Byrne, MD


Steven Dubovsky, MD, Joel Yager, MD


...

JSON


Code:
let $xml := <>
 let $custom :=
let $config := json:config("custom")
let $_ := map:put( $config, "whitespace", "ignore" )
let $_ := map:put( $config, "array-element-names", ("result",
"abstract", "speciality", "article", "author") )
return $config
  return
json:transform-to-json( $xml, $custom )


Please note when I am using "full" strategy,  is showing value.

Thank you for your help!

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


Re: [MarkLogic Dev General] Search results are same w/ or w/o punctuation with unfiltered search option

2017-07-31 Thread Indrajeet Verma
Thank You!

On Tue, Aug 1, 2017 at 12:07 AM, Erik Hennum <erik.hen...@marklogic.com>
wrote:

> Hi, Indrajeet:
>
> Mary Holstege provides a concise and authoritative explanation here:
>
> http://markmail.org/message/r2sdkmjzrawdjpjn
>
> In essence, enable the fast-diacritic-sensitive-searches index (either
> for the entire database or a field on the element or property) and
> pass the punctuation sensitive (or exact) option on a value query.
>
>
> Hoping that helps,
>
>
> Erik Hennum
>
>
> --
> *From:* general-boun...@developer.marklogic.com [
> general-boun...@developer.marklogic.com] on behalf of Indrajeet Verma [
> indrajeet.ve...@gmail.com]
> *Sent:* Monday, July 31, 2017 4:38 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* [MarkLogic Dev General] Search results are same w/ or w/o
> punctuation with unfiltered search option
>
> Hi - The search:search() is giving same results for keyword 10, 10%, 10#%@
> and $10 when I use "unfiltered" search option. Though when I use "filtered"
> search-option, the results are accurate and punctuation is considered in
> the query text.
>
> Is there any way if I can get correct results using "unfiltered" option
> for the query text with punctuation as if I use filtered option the
> response time drastically increases.
>
> Thank You!
>
> Regards,
> Indrajeet
>
> ___
> 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


[MarkLogic Dev General] Search results are same w/ or w/o punctuation with unfiltered search option

2017-07-31 Thread Indrajeet Verma
Hi - The search:search() is giving same results for keyword 10, 10%, 10#%@
and $10 when I use "unfiltered" search option. Though when I use "filtered"
search-option, the results are accurate and punctuation is considered in
the query text.

Is there any way if I can get correct results using "unfiltered" option for
the query text with punctuation as if I use filtered option the response
time drastically increases.

Thank You!

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


Re: [MarkLogic Dev General] Make string XML "safe" in xquery

2017-07-28 Thread Indrajeet Verma
Steve - Did you try using fn:replace? e.g. fn:replace(fn:replace($title,
"<", "lt;"), ">", "gt;")


On Sat, Jul 29, 2017 at 5:32 AM, Steve Anderson 
wrote:

> I have a string like this:
>
> A title for  the product
>
> and I'd like to replace it with
>
> A title for placeholder the product
>
> Basically, I want to make the a valid XML text node, fixing greater than,
> less than, and ampersands.  I thought I could make xdmp:quote do that, but,
> perhaps because it's Friday afternoon, I can't find the right options to
> make it work.
>
> Is there any easy solution I can't find?
>
>Steve
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MLCP Error Return

2017-05-12 Thread Indrajeet Verma
Hi Tim -

As per my understanding there is nothing by which you can return
success/failure. Other developers can guide you if anything is there in
mlcp.

However your problem should solve using thread count property with value 1
in your option file.
-thread_count
1

Regards,
Indy

On Fri, May 12, 2017 at 6:03 PM, Timothy Pearce 
wrote:

> Hello,
>
>
>
> I’m currently working on improving the continuous integration system I
> currently have which uses Jenkins. It’s deploying our modules into the
> database via MLCP and the XDBC server. I am seeing one issue with the mlcp
> script and it is not returning any errors via exit code when it fails to
> updated a document because it is locked. It is returning exit 0 with “exit
> $?” tacked on to the end of the run after the mlcp.sh script is called. Is
> there any way to get this to throw a non 0 exit code on error? I’m not
> seeing any reference to checking if it the script ran with success or
> parameters to add that in the mlcp documentation. For a snippet of the
> mlcp’s logging which shows the error:
>
>
>
> 17/05/11 15:10:41 INFO contentpump.FileAndDirectoryInputFormat: Total
> input paths to process : 14
>
> 17/05/11 15:10:43 INFO contentpump.LocalJobRunner:  completed 100%
>
> 17/05/11 15:10:43 ERROR mapreduce.ContentWriter: XDMP-LOCKED: Document or
> Directory is locked
>
> 17/05/11 15:10:43 WARN mapreduce.ContentWriter: Failed document
> /utils/a.xqy in file:/modules/utils/a.xqy
>
> 17/05/11 15:10:46 ERROR mapreduce.ContentWriter: XDMP-LOCKED: Document or
> Directory is locked
>
> 17/05/11 15:10:46 WARN mapreduce.ContentWriter: Failed document
> /utils/b.xqy in file:/modules/utils/b.xqy
>
> 17/05/11 15:10:46 INFO contentpump.LocalJobRunner: 
> com.marklogic.mapreduce.MarkLogicCounter:
>
>
> 17/05/11 15:10:46 INFO contentpump.LocalJobRunner: INPUT_RECORDS: 143
>
> 17/05/11 15:10:46 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS: 143
>
> 17/05/11 15:10:46 INFO contentpump.LocalJobRunner:
> OUTPUT_RECORDS_COMMITTED: 143
>
> 17/05/11 15:10:46 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_FAILED: 0
>
> 17/05/11 15:10:46 INFO contentpump.LocalJobRunner: Total execution time: 4
> sec
>
> + exit 0
>
>
>
> I’ve verified that the file was not overwritten via adding data to a file
> stored in marklogic and using mlcp to replace the file, then querying with
> fn:doc to verify the data was removed. It did not replace the file. Any
> guidance to helping verify the files were actually written into marklogic
> would be appreciated.
>
>
>
> Thanks,
>
> Tim
>
>
>
>
> Nothing in this message is intended to constitute an electronic signature
> unless a specific statement to the contrary is included in this message.
> Confidentiality Note: This message is intended only for the person or
> entity to which it is addressed. It may contain confidential and/or
> proprietary material. Any review, transmission, dissemination or other use,
> or taking of any action in reliance upon this message by persons or
> entities other than the intended recipient is prohibited. If you received
> this message in error, please contact the sender and delete it from your
> computer.
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


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

2017-02-08 Thread Indrajeet Verma
declare namespace xhtml = "http://www.w3.org/1999/xhtml;;



declare function do:makeXMLsafe( $Str as xs:string ) {

let $xhtml-node:=xdmp:tidy($Str, yes

  )[2]/xhtml:html/xhtml:body/node()

 return $xhtml-node

};

On Thu, Feb 9, 2017 at 3:55 AM, Kari Cowan <kco...@alm.com> wrote:

> Thanks Indy – how is that meant to flow, something like this?
>
>
>
> declare namespace xhtml = "http://www.w3.org/1999/xhtml;;
>
>
>
> declare function do:makeXMLsafe( $Str as xs:string ) {
>
>  let $Str:=fn:escape-html-uri($Str)
>
> let $Str:=xdmp:tidy($Str,  xhtml>yes
>
>   )[2]/xhtml:html/xhtml:body/node()
>
>  return $Str
>
> };
>
>
>
> *From: *<general-boun...@developer.marklogic.com> on behalf of Indrajeet
> Verma <indrajeet.ve...@gmail.com>
> *Reply-To: *MarkLogic <general@developer.marklogic.com>
> *Date: *Wednesday, February 8, 2017 at 10:28 AM
>
> *To: *MarkLogic <general@developer.marklogic.com>
> *Subject: *Re: [MarkLogic Dev General] Is xdml:unquote appropriate for
> handling accent characters?
>
>
>
> See if this works for you.
>
>
>
> declare namespace xhtml = "http://www.w3.org/1999/xhtml;;
>
> xdmp:tidy($Str,  xhtml>yes
>
>   )[2]/xhtml:html/xhtml:body/node()
>
>
>
> Regards,
>
> Indy
>
>
>
> On Wed, Feb 8, 2017 at 11:40 PM, Kari Cowan <kco...@alm.com> wrote:
>
> I guess I can make it palatable with the function I added below – then
> have them unfurl it on the front end.   When I pulled actual doc source –
> even though ‘Pokémon’ displayed in Qconsole, it was actually encoded as
> 
>
>
>
> declare function do:makeXMLsafe( $Str as xs:string ) {
>
>  let $Str:=fn:escape-html-uri($Str)
>
>  return $Str
>
> };
>
>
>
> >> changes ‘Pokémon’ to ‘Pok%C3%A9mon’
>
>
>
> Is there any better way to deal with it?
>
>
>
>
>
> *From: *<general-boun...@developer.marklogic.com> on behalf of Kari Cowan
> <kco...@alm.com>
> *Reply-To: *MarkLogic <general@developer.marklogic.com>
> *Date: *Tuesday, February 7, 2017 at 2:34 PM
> *To: *MarkLogic <general@developer.marklogic.com>
> *Subject: *Re: [MarkLogic Dev General] Is xdml:unquote appropriate for
> handling accent characters?
>
>
>
> (note outlook stripped out the unknown character below, in the 
> node it was “Pok?mon”
>
>
>
>
>
> *From: *Kari Cowan <kco...@alm.com>
> *Date: *Tuesday, February 7, 2017 at 2:31 PM
> *To: *MarkLogic <general@developer.marklogic.com>
> *Subject: *Is xdml:unquote appropriate for handling accent characters?
>
>
>
> The doc contains a node with text including an accent grave, example:
>
>
>
> VOIR DIRE: Pokémon Drive?
>
>
>
> I tried to handle it with:
>
> let $theTitle:=xdmp:unquote($theTitle, "", ("repair-full"))
>
>
>
> But I still get an output with an unknown character in xml
>
>
>
> VOIR DIRE: Pokmon Drive?
>
>
>
> >> XML Parsing Error: not well-formed
>
>
>
> Anyone have a tip they can share on how to handle it?
>
>
> ___
> 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] Is xdml:unquote appropriate for handling accent characters?

2017-02-08 Thread Indrajeet Verma
See if this works for you.

declare namespace xhtml = "http://www.w3.org/1999/xhtml;;
xdmp:tidy($Str, yes
  )[2]/xhtml:html/xhtml:body/node()

Regards,
Indy

On Wed, Feb 8, 2017 at 11:40 PM, Kari Cowan  wrote:

> I guess I can make it palatable with the function I added below – then
> have them unfurl it on the front end.   When I pulled actual doc source –
> even though ‘Pokémon’ displayed in Qconsole, it was actually encoded as
> 
>
>
>
> declare function do:makeXMLsafe( $Str as xs:string ) {
>
>  let $Str:=fn:escape-html-uri($Str)
>
>  return $Str
>
> };
>
>
>
> >> changes ‘Pokémon’ to ‘Pok%C3%A9mon’
>
>
>
> Is there any better way to deal with it?
>
>
>
>
>
> *From: * on behalf of Kari Cowan
> 
> *Reply-To: *MarkLogic 
> *Date: *Tuesday, February 7, 2017 at 2:34 PM
> *To: *MarkLogic 
> *Subject: *Re: [MarkLogic Dev General] Is xdml:unquote appropriate for
> handling accent characters?
>
>
>
> (note outlook stripped out the unknown character below, in the 
> node it was “Pok?mon”
>
>
>
>
>
> *From: *Kari Cowan 
> *Date: *Tuesday, February 7, 2017 at 2:31 PM
> *To: *MarkLogic 
> *Subject: *Is xdml:unquote appropriate for handling accent characters?
>
>
>
> The doc contains a node with text including an accent grave, example:
>
>
>
> VOIR DIRE: Pokémon Drive?
>
>
>
> I tried to handle it with:
>
> let $theTitle:=xdmp:unquote($theTitle, "", ("repair-full"))
>
>
>
> But I still get an output with an unknown character in xml
>
>
>
> VOIR DIRE: Pokmon Drive?
>
>
>
> >> XML Parsing Error: not well-formed
>
>
>
> Anyone have a tip they can share on how to handle it?
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MLCP

2016-12-30 Thread Indrajeet Verma
Arvind - Have you tried below options?

 -max_split_size  Maximum number of MarkLogic documents
  per each input split in export or copy,
  or maximum number of bytes in file per
  each split in import
 -min_split_size  Minimum number of bytes in file per each
  split in import

Regards,
Indy

On Fri, Dec 30, 2016 at 4:27 PM, Arvind Kumar <akmishra...@gmail.com> wrote:

> Hi Indy,
>
> Thanks for your suggestion,
>
> Yes, I have tried this option before.
> The command end with the exception "Could not buffer value as string."
> I think the no of split increase when the database have multiple forest
> and it passes the same uri to each split to process which causing the
> deadlock issue.
> Can we some how reduce the no of split to 1?
>
>
> Regards,
> Arvind Kr.
>
>
>
>
> On Thu, Dec 29, 2016 at 7:17 PM, Indrajeet Verma <
> indrajeet.ve...@gmail.com> wrote:
>
>> Arvind - Have you tried with -THREAD_COUNT=1? I know using thread count =
>> 1 will take time to update docs but deadlock could be avoided.
>>
>> Thanks!
>>
>> On Wed, Dec 28, 2016 at 3:56 PM, Arvind Kumar <akmishra...@gmail.com>
>> wrote:
>>
>>> Hi Jason,
>>>
>>> Thanks for your response.
>>>
>>> The problem is the no. of records processed is not equal to the total
>>> actual records. Some times it stuck in middle of the processing.
>>>
>>> This deadlock problem occurring when the same command over the database
>>> having more the one forest. It is working fine with single forest.
>>>
>>>
>>> Regards,
>>>
>>> Arvind Kr.
>>>
>>>
>>>
>>> ___
>>> 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] MLCP

2016-12-29 Thread Indrajeet Verma
Arvind - Have you tried with -THREAD_COUNT=1? I know using thread count = 1
will take time to update docs but deadlock could be avoided.

Thanks!

On Wed, Dec 28, 2016 at 3:56 PM, Arvind Kumar  wrote:

> Hi Jason,
>
> Thanks for your response.
>
> The problem is the no. of records processed is not equal to the total
> actual records. Some times it stuck in middle of the processing.
>
> This deadlock problem occurring when the same command over the database
> having more the one forest. It is working fine with single forest.
>
>
> Regards,
>
> Arvind Kr.
>
>
>
> ___
> 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


[MarkLogic Dev General] Load single file

2016-12-29 Thread Indrajeet Verma
Ahmed - If this is not resolved yet. Please try like below and make sure
this dir is present in your file-system. Now you drop a file in this dir
and upload. As per docs it accepts DIR not file.

Directory Loader Configuration
Directory path

Thanks

On Tue, Dec 27, 2016 at 11:58 AM, Ahmed Khan <2005.k...@gmail.com> wrote:

> Hello,
>
> I am trying to load a file from a window directory, and entered the
> pathname as below:
> Directory Loader ConfigurationDirectory path
>
> Getting direopne error.
>
>
> Any suggestion?
>
>
> Thanks,
> A Khan
>
>
>
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] General Digest, Vol 148, Issue 7

2016-10-05 Thread Indrajeet Verma
Hi Vinod,

Can you try IOUtils and set UTF-8 encoding? I used it in one of my project
and works fine.

HttpResponse response = client.execute(getReq);// execute get request
response.setHeader("Content-Type", "text/html; charset=utf-8");
result = IOUtils.toString(response.getEntity().getContent(), "UTF-8");

Regards,
Indy

On Wed, Oct 5, 2016 at 8:18 PM,  wrote:

> Hi Eric,
>
> Thanks for Responding.
>
> We are calling MarkLogic Custom services using apache commons http client
> to get the data. We are getting the response as UTF-8 encoded only.
> final HttpResponse response = httpClientExecutor.execute(request,
>   globalProperties.getProperty(
> MARKLOGIC_USERNAME),
>   globalProperties.getProperty(
> MARKLOGIC_PASSWORD));
>
>
> response.getEntity() is still in UTF-8  encoding only.
>
> We are converting response entity  to string and creating JSON object
>
> final String strEntiry = EntityUtils.toString(response.getEntity());
>
> When we debug ,At this point it self we are not receiving the special
> characters properly and getting some dirty characters in place of special
> characters.
>
> return new JSONObject(strEntiry);
>
> And we tried reading strEntiry as UTF-8 encoded explicitly like below
>
> final String strEntiry = EntityUtils.toString(response.
> getEntity(),"UTF-8");
>
> but the result is same.
>
>
> Thanks,
> Vinod.
>
> -Original Message-
> From: general-boun...@developer.marklogic.com [mailto:general-bounces@
> developer.marklogic.com] On Behalf Of general-request@developer.
> marklogic.com
> Sent: Wednesday, October 05, 2016 6:20 PM
> To: general@developer.marklogic.com
> Subject: General Digest, Vol 148, Issue 7
>
> Send General mailing list submissions to
> general@developer.marklogic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://developer.marklogic.com/mailman/listinfo/general
> or, via email, send a message with subject or body 'help' to
> general-requ...@developer.marklogic.com
>
> You can reach the person managing the list at
> general-ow...@developer.marklogic.com
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of General digest..."
>
>
> Today's Topics:
>
>1. Re: Issue with special charecters in  MarkLogic (Kapoor, Pragya)
>2. Re: Issue with special charecters in  MarkLogic (Erik Hennum)
>
>
> --
>
> Message: 1
> Date: Wed, 5 Oct 2016 11:06:51 +
> From: "Kapoor, Pragya" 
> Subject: Re: [MarkLogic Dev General] Issue with special charecters in
> MarkLogic
> To: "general@developer.marklogic.com"
> 
> Message-ID:
>  apcprd02.prod.outlook.com>
>
> Content-Type: text/plain; charset="us-ascii"
>
> You can try using  xdmp:url-decode()
>
>
> Example:
>
> let $write := ""write ()/())"
> return xdmp:url-decode($write)
>
>
> This will give the output as " write ?(?)/?(?)
>
>
> Thanks
>
> Pragya
>
>
> 
> From: general-boun...@developer.marklogic.com  marklogic.com> on behalf of thangella.vinodre...@cognizant.com <
> thangella.vinodre...@cognizant.com>
> Sent: Wednesday, October 5, 2016 3:53:16 PM
> To: general@developer.marklogic.com
> Subject: [MarkLogic Dev General] Issue with special charecters in MarkLogic
>
> Hi All,
>
> We are facing an issue with special characters involved in mathematical
> expressions such as " write ?(?)/?(?) in the form " which has  italic
> characters (?(?)/?(?)). In MarkLogic these are stored as UTF-8 encoded
> values as "write ()/() in the
> form". In Java application When we are retrieving data from MarkLogic DB
> ,these special characters are being received  as " write ?c(?^1)/??(?^1) in
> the form" .  These are being corrupted by the time we received them in Java
> layer.
>
> We tried many options from Java side to receive content as UTF-8 encoded,
> but did not resolved the issue. Can anyone please suggest a way to  resolve
> this kind of issues from MarkLogic side.
>
>
> Thanks,
> Vinod.
>
>
>
>
>
>
> This e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. If you are not the intended recipient(s), please reply to the
> sender and destroy all copies of the original message. Any unauthorized
> review, use, disclosure, dissemination, forwarding, printing or copying of
> this email, and/or any action taken in reliance on the contents of this
> e-mail is strictly prohibited and may be unlawful. Where permitted by
> applicable law, this e-mail and other e-mail communications sent to and
> from Cognizant e-mail addresses may be monitored.
> "This e-mail and any attachments 

Re: [MarkLogic Dev General] Regarding retrieving nonblocking-timestamp for the replica database forests

2016-10-05 Thread Indrajeet Verma
t $nconfig :=
admin:database-attach-forest($nconfig-orig, $dbid, $forest-id)
return xdmp:set($nconfig-orig, $nconfig)
   else ()
  let $_  := admin:save-configuration($nconfig-orig)
  return "Rollback is done!"
 }
catch($e){
   (
 $e
 ,
 xdmp:log($e, "debug")
   )
}

Thank you for your help!

Regards,
Indy


On Tue, Oct 4, 2016 at 8:16 PM, Indrajeet Verma <indrajeet.ve...@gmail.com>
wrote:

> Hi All,
>
> We have configured database replication in a database in which there are 3
> forests and we want to write a script to make DR host same database to
> ready for updates in case master host is down.
>
> As per documentation:
> After you fail over your applications to a Replica database, each Replica
> forest will likely have committed its last transaction at different
> timestamps. If the Replica database has multiple forests and relationships
> exist between those forests, this inconsistency may cause problems. In
> order to return the database to a transactionally consistent state, all
> forests must be rolled back to the minimum nonblocking timestamp.
>
> Also it says in the documentation (https://docs.marklogic.com/
> guide/database-replication/dbrep_intro#id_99224) use the
> xdmp:forest-rollback function to roll back the forests to the minimum
> nonblocking-timestamp returned by the xdmp:forest-status function for each
> forest that is in the open or open replica state.
>
> However in the code sample below in the documentation is retrieving
> nonblocking-timestamp from the method xdmp:database-nonblocking-
> timestamp($db).
>
> xquery version "1.0-ml";
> let $db := xdmp:database("Documents")
> let $timestamp := xdmp:database-nonblocking-timestamp($db)
> let $rollback := xdmp:forest-rollback(
> xdmp:forest-open-replica(
> xdmp:database-forests($db)),
> $timestamp)
> return
> "Roll back done"
>
> So wanted to know whether we should use xdmp:forest-status() to get
> minimum nonblocking-timestamp (*retrieve nonblocking-timestamp from all
> the forests and get the minimum timestamp from all three then rollback to
> that timestamp*) or xdmp:database-nonblocking-timestamp() is fine.
>
> Thank you for sharing your thoughts!
>
> Regards,
> Indy
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Regarding retrieving nonblocking-timestamp for the replica database forests

2016-10-04 Thread Indrajeet Verma
Hi All,

We have configured database replication in a database in which there are 3
forests and we want to write a script to make DR host same database to
ready for updates in case master host is down.

As per documentation:
After you fail over your applications to a Replica database, each Replica
forest will likely have committed its last transaction at different
timestamps. If the Replica database has multiple forests and relationships
exist between those forests, this inconsistency may cause problems. In
order to return the database to a transactionally consistent state, all
forests must be rolled back to the minimum nonblocking timestamp.

Also it says in the documentation (
https://docs.marklogic.com/guide/database-replication/dbrep_intro#id_99224)
use the xdmp:forest-rollback function to roll back the forests to the
minimum nonblocking-timestamp returned by the xdmp:forest-status function
for each forest that is in the open or open replica state.

However in the code sample below in the documentation is retrieving
nonblocking-timestamp from the method
xdmp:database-nonblocking-timestamp($db).

xquery version "1.0-ml";
let $db := xdmp:database("Documents")
let $timestamp := xdmp:database-nonblocking-timestamp($db)
let $rollback := xdmp:forest-rollback(
xdmp:forest-open-replica(
xdmp:database-forests($db)),
$timestamp)
return
"Roll back done"

So wanted to know whether we should use xdmp:forest-status() to get minimum
nonblocking-timestamp (*retrieve nonblocking-timestamp from all the forests
and get the minimum timestamp from all three then rollback to that
timestamp*) or xdmp:database-nonblocking-timestamp() is fine.

Thank you for sharing your thoughts!

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


Re: [MarkLogic Dev General] Code complexity survey

2016-09-22 Thread Indrajeet Verma
I did it as well. Yes it takes 5 to 10 minutes only.

Regards,
Indy

On 22-Sep-2016 7:19 pm, "Geert Josten"  wrote:

> I’ve submitted my answers, good luck with your survey. Anyone else up for
> it? It really takes only 5 to 10 minutes..
>
> Cheers
>
> From:  on behalf of Vard
> Antinyan 
> Reply-To: MarkLogic Developer Discussion 
> Date: Tuesday, September 20, 2016 at 4:13 PM
> To: "general@developer.marklogic.com" 
> Subject: [MarkLogic Dev General] Code complexity survey
>
> Dear general developers,
>
>
>
> We have undertaken a task to assess code complexity triggers and generate
> recommendations for developing simple and understandable code. Our
> intension is to share the results with you, developers, so everyone can
> learn the triggers behind complex software.
>
>
>
> We need your help for rigorous results. My request to you is – if you get
> 5-10 min. time, *would you please consider to answer the questions of
> this survey on code complexity?*
>
> https://goo.gl/forms/h9WXZ8VSEw7BUyHg1
>
>
>
> *You are welcome to learn preliminary results through this link:*
>
> https://www.facebook.com/SoftwareCodeQuality/photos/?tab=album_id=
> 1639816749664288
>
>
>
> The results will be shared in a public webpage and everyone possible will
> be invited to learn and discuss them.
>
>
>
> Your knowledge and experience is vital for achieving substantial and
> generalizable results, and your effort is much appreciated!
>
>
>
> Sincerely
>
> Vard Antinyan
>
> PhD candidate in University of Gothenburg, Sweden
>
> Tel: 0046317725707
>
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] How does "xdmp:collection-delete" work?

2016-09-19 Thread Indrajeet Verma
Thank You Geert!

Regards,
Indy

On Mon, Sep 19, 2016 at 9:33 PM, Geert Josten <geert.jos...@marklogic.com>
wrote:

> Hi Indy,
>
> You usually don’t need manual merging, MarkLogic will clean up
> automatically provided merging is not disabled. Deleted fragments might
> stick around for one hour, just to make sure merging does not slow down
> deletion itself..
>
> Cheers,
> Geert
>
> From: <general-boun...@developer.marklogic.com> on behalf of Indrajeet
> Verma <indrajeet.ve...@gmail.com>
> Reply-To: MarkLogic Developer Discussion <general@developer.marklogic.com>
> Date: Monday, September 19, 2016 at 5:36 PM
> To: MarkLogic Developer Discussion <general@developer.marklogic.com>
> Subject: Re: [MarkLogic Dev General] How does "xdmp:collection-delete"
> work?
>
> Hi Geert,
>
> In addition, do you think he should run manual merge after deleting 20M to
> free the space and improve performance?
>
> Regards,
> Indy
>
> On Mon, Sep 19, 2016 at 8:58 PM, Geert Josten <geert.jos...@marklogic.com>
> wrote:
>
>> Hi Qambar,
>>
>> I think it makes sense to discuss this in more detail here first, and
>> then see if we can summarize conclusions on SO..
>>
>> In general there are several ways to get rid of a large group of files.
>> It generally comes down to either:
>>
>>1. xdmp:collection-delete and xdmp:directory-delete
>>2. or a batch delete approach.
>>
>> This roughly matches the two answers on SO.
>>
>> The ‘benefit' of approach 1 is that it happens in one transaction, which
>> could be important to you. But you are right that a collection-delete can
>> take time. I would not necessarily say it will flood servers, but deleting
>> 20 mln docs could take up to minutes. How much exactly depends a lot on
>> factors like how many forests, how fast your disks are, how many MarkLogic
>> instances you have in your cluster, how the docs are spread across those,
>> etc. Deleting 20 mln docs could just as well take 10 sec, provided right
>> configuration, and right circumstances are met. Right circumstances also
>> includes things like not having triggers, not having enabled auditing etc..
>>
>> The second approach has kind of the opposite. You won’t have the deletion
>> happening in one transaction (unless you care to handle transactions
>> yourself), but you have more control to manage load, and can take as long
>> as needed. There are several tools that can help spawning deletion tasks.
>> Corb/Corb2 is one, Taskbot is another.
>>
>> Which answer fits your case best, depends firstly on whether or not it is
>> important to do the collection-delete in one transaction. Secondly, the
>> volume of the average deletion counts, and how often you need to perform
>> it. It might be good to run a test on a similar environment that allows
>> estimating whether you can run the delete in an acceptable timeframe.
>>
>> We could go into more detail about xdmp:collection-delete, but I don’t
>> think that will be of much help to you.
>>
>> Instead I’d prefer returning to your description on SO, you are talking
>> about ‘expired’ collection items. Have you considered giving documents an
>> expiry date, and running a schedule that will periodically remove expired
>> documents? If the schedule runs for instance every hour, and would delete a
>> reasonable sized batch of files on average, that could help spread load for
>> keeping your system clean..
>>
>> Cheers,
>> Geert
>>
>> From: <general-boun...@developer.marklogic.com> on behalf of Qambar Raza
>> <qambar.r...@bbc.co.uk>
>> Reply-To: MarkLogic Developer Discussion <general@developer.marklogic.com
>> >
>> Date: Monday, September 19, 2016 at 1:00 PM
>> To: "general@developer.marklogic.com" <general@developer.marklogic.com>
>> Subject: [MarkLogic Dev General] How does "xdmp:collection-delete" work?
>>
>> Hello,
>>
>> Can anyone  answer my question on stack overflow, I couldn't find a
>> documentation about how https://docs.marklogic.com/xdmp:collection-delete
>>  works.
>>
>> For more details, see :
>> http://stackoverflow.com/questions/39571215/how-does-marklog
>> ics-xdmpcollection-delete-work
>>
>> Thanks,
>>
>> Qambar.
>>
>> ___
>> 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] How does "xdmp:collection-delete" work?

2016-09-19 Thread Indrajeet Verma
Hi Geert,

In addition, do you think he should run manual merge after deleting 20M to
free the space and improve performance?

Regards,
Indy

On Mon, Sep 19, 2016 at 8:58 PM, Geert Josten 
wrote:

> Hi Qambar,
>
> I think it makes sense to discuss this in more detail here first, and then
> see if we can summarize conclusions on SO..
>
> In general there are several ways to get rid of a large group of files. It
> generally comes down to either:
>
>1. xdmp:collection-delete and xdmp:directory-delete
>2. or a batch delete approach.
>
> This roughly matches the two answers on SO.
>
> The ‘benefit' of approach 1 is that it happens in one transaction, which
> could be important to you. But you are right that a collection-delete can
> take time. I would not necessarily say it will flood servers, but deleting
> 20 mln docs could take up to minutes. How much exactly depends a lot on
> factors like how many forests, how fast your disks are, how many MarkLogic
> instances you have in your cluster, how the docs are spread across those,
> etc. Deleting 20 mln docs could just as well take 10 sec, provided right
> configuration, and right circumstances are met. Right circumstances also
> includes things like not having triggers, not having enabled auditing etc..
>
> The second approach has kind of the opposite. You won’t have the deletion
> happening in one transaction (unless you care to handle transactions
> yourself), but you have more control to manage load, and can take as long
> as needed. There are several tools that can help spawning deletion tasks.
> Corb/Corb2 is one, Taskbot is another.
>
> Which answer fits your case best, depends firstly on whether or not it is
> important to do the collection-delete in one transaction. Secondly, the
> volume of the average deletion counts, and how often you need to perform
> it. It might be good to run a test on a similar environment that allows
> estimating whether you can run the delete in an acceptable timeframe.
>
> We could go into more detail about xdmp:collection-delete, but I don’t
> think that will be of much help to you.
>
> Instead I’d prefer returning to your description on SO, you are talking
> about ‘expired’ collection items. Have you considered giving documents an
> expiry date, and running a schedule that will periodically remove expired
> documents? If the schedule runs for instance every hour, and would delete a
> reasonable sized batch of files on average, that could help spread load for
> keeping your system clean..
>
> Cheers,
> Geert
>
> From:  on behalf of Qambar Raza <
> qambar.r...@bbc.co.uk>
> Reply-To: MarkLogic Developer Discussion 
> Date: Monday, September 19, 2016 at 1:00 PM
> To: "general@developer.marklogic.com" 
> Subject: [MarkLogic Dev General] How does "xdmp:collection-delete" work?
>
> Hello,
>
> Can anyone  answer my question on stack overflow, I couldn't find a
> documentation about how https://docs.marklogic.com/xdmp:collection-delete
> works.
>
> For more details, see :
> http://stackoverflow.com/questions/39571215/how-does-
> marklogics-xdmpcollection-delete-work
>
> Thanks,
>
> Qambar.
>
> ___
> 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] modules, conditions to validate JSON documents in CPF

2016-09-15 Thread Indrajeet Verma
Shiv,

Your XQuery code had some issues. See attached corrected pipeline and
action module code. Also try to change log level from "debug" to "fine" to
see more logs.


Regards,
Indy

On Wed, Sep 14, 2016 at 11:09 AM, Indrajeet Verma <indrajeet.ve...@gmail.com
> wrote:

> Hey Shiv,
>
> It's working fine to me with json documents as well. If you can send your
> complete pipeline, I may try to point out issue.
>
> You may try to set log level "fine" and can see more granular level logs.
> You might catch the issues your own.
>
> Also you may try adding logs in the xqy module 
> /MarkLogic/cpf/actions/mimetype-condition.xqy
> and see what content type/mime type is being logged.
>
> let $_ := xdmp:log("content-type=" || $doc-content-type)
> let $_ := xdmp:log($mime-type-patterns)
>
> Which version of ML are you using?
>
> Regards,
> Indy
>
> On Wed, Sep 14, 2016 at 12:04 AM, Shiv Shankar <shiv.shivshan...@gmail.com
> > wrote:
>
>> Hi,
>> As part of Pipeline definition in Content Processing Framework, I need to
>> handle JSON documents. I added below lines in the Pipeline file. But it is
>> unable to call action module. Please advise.'
>>
>> Note: added add-something to module. and the given tutorial is working
>>  for XML content.
>>
>> 
>>
>> 
>>
>> /MarkLogic/cpf/actions/mimetype-condition.xqy
>>
>> 
>>
>> application/json
>>
>> 
>>
>> 
>>
>> 
>>
>> do-something.xqy
>>
>> 
>>
>> 
>>
>>
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
http://marklogic.com/cpf/pipelines;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation="http://marklogic.com/cpf/pipelines pipelines.xsd">
Add-last-date
 This pipeline add a new property in document with last-modified 

/MarkLogic/cpf/actions/success-action.xqy


/MarkLogic/cpf/actions/failure-action.xqy


 when a document inserted or updated add a new property in document with
last-modified 
http://marklogic.com/states/initial
http://marklogic.com/states/done
http://marklogic.com/states/error
9200


/MarkLogic/cpf/actions/mimetype-condition.xqy

application/json



add-attributes.xqy







add-attributes.xqy
Description: Binary data
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] General Digest, Vol 147, Issue 16

2016-09-14 Thread Indrajeet Verma
Hey Shiv,

Please send your code and I will see where you are having problem.

Regards,
Indy

On Wed, Sep 14, 2016 at 11:46 PM, Shiv Shankar <shiv.shivshan...@gmail.com>
wrote:

> Hi Indy,
> Thanks for your reply. I added same text to the mimetype-conditions.xqy,
> but saying condition failed.
>
> Can you share your working condition for mime-type as json to my personal
> email shiv.shivshan...@gmail.com?
>
> My condition is below and version is ML8.0-5.5
>
> 
>
> /MarkLogic/cpf/actions/mimetype-condition.xqy
>
> 
>
> application/json
>
> 
> Regards
>
>
> On Wed, Sep 14, 2016 at 7:24 AM, <general-requ...@developer.marklogic.com>
> wrote:
>
>> Send General mailing list submissions to
>> general@developer.marklogic.com
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://developer.marklogic.com/mailman/listinfo/general
>> or, via email, send a message with subject or body 'help' to
>> general-requ...@developer.marklogic.com
>>
>> You can reach the person managing the list at
>> general-ow...@developer.marklogic.com
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of General digest..."
>>
>>
>> Today's Topics:
>>
>>1. Re: modules, conditions to validate JSON documents in CPF
>>   (Indrajeet Verma)
>>2. index for dateTime comparsion not working properly
>>   (vikas.sin...@cognizant.com)
>>3. Re: index for dateTime comparsion not working properly
>>   (Mats Stellwall)
>>
>>
>> --
>>
>> Message: 1
>> Date: Wed, 14 Sep 2016 11:09:00 +0530
>> From: Indrajeet Verma <indrajeet.ve...@gmail.com>
>> Subject: Re: [MarkLogic Dev General] modules, conditions to validate
>> JSON documents in CPF
>> To: MarkLogic Developer Discussion <general@developer.marklogic.com>
>> Message-ID:
>> 

Re: [MarkLogic Dev General] modules, conditions to validate JSON documents in CPF

2016-09-13 Thread Indrajeet Verma
Hey Shiv,

It's working fine to me with json documents as well. If you can send your
complete pipeline, I may try to point out issue.

You may try to set log level "fine" and can see more granular level logs.
You might catch the issues your own.

Also you may try adding logs in the xqy module
/MarkLogic/cpf/actions/mimetype-condition.xqy and see what content
type/mime type is being logged.

let $_ := xdmp:log("content-type=" || $doc-content-type)
let $_ := xdmp:log($mime-type-patterns)

Which version of ML are you using?

Regards,
Indy

On Wed, Sep 14, 2016 at 12:04 AM, Shiv Shankar 
wrote:

> Hi,
> As part of Pipeline definition in Content Processing Framework, I need to
> handle JSON documents. I added below lines in the Pipeline file. But it is
> unable to call action module. Please advise.'
>
> Note: added add-something to module. and the given tutorial is working
>  for XML content.
>
> 
>
> 
>
> /MarkLogic/cpf/actions/mimetype-condition.xqy
>
> 
>
> application/json
>
> 
>
> 
>
> 
>
> do-something.xqy
>
> 
>
> 
>
>
>
> ___
> 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] #CGP#RE: Need Technical Support

2016-07-15 Thread Indrajeet Verma
Hi Udaya,

As per my understanding you should always use latest version of ML if you
are installing from scratch. The latest version of ML (MarkLogic-8.0-5.4)
is available here https://developer.marklogic.com/products.

Did you follow all the installation steps of MarkLogic those are mentioned
here https://docs.marklogic.com/guide/installation/procedures#id_28962?
(mainly configuration and security set up).

If you are able to access MarkLogic using http://localhost:8001 and
http://localhost:8000/qconsole then it means your installation completed
successfully.

Now you may try below curl command to create rest instance:

curl --anyauth --user admin:admin -X POST -d@"config/rest-instance.xml" -i
-H "Content-type:application/xml" http://localhost:8002/v1/rest-apis

Make sure rest-instance.xml has been created under <>/config in your system from where you are running command.

rest-instance.xml

http://marklogic.com/rest-api;>
  test-rest
  Default
  test-rest-db
  test-rest-mods
  8045


Now you may open http://localhost:8001 and see whether rest instance and db
has been created successfully. You should check database and attached
forest as well.

You may try another rest end point to load content:

curl --anyauth --user admin:admin -X PUT -T docs-rest/song1.xml "
http://localhost:8045/v1/documents?uri=/plays/play1.xml=xml=plays
"

For more information regarding setting up rest instance, please refer
https://developer.marklogic.com/learn/rest/setup

You may attend some training courses that MarkLogic provides:
http://mlu.marklogic.com/ondemand/index.xqy?q=Version%3A%22MarkLogic%208%22

Hope that helps!

Regards,
Indy



On Fri, Jul 15, 2016 at 12:24 PM, Khan, Zishan 
wrote:

> ++below
>
>
>
> *From:* Khan, Zishan
> *Sent:* Friday, July 15, 2016 12:23 PM
> *To:* general@developer.marklogic.com
> *Subject:* RE: Need Technical Support
>
>
>
> Hi udaya,
>
>
>
> Did you use the curl command properly ?. check it once again it should
> work if coded properly.
>
>
>
> Regards,
>
> Zishan
>
>
>
> *From:* general-boun...@developer.marklogic.com [
> mailto:general-boun...@developer.marklogic.com
> ] *On Behalf Of *
> udaya.chill...@wipro.com
> *Sent:* Friday, July 15, 2016 12:16 PM
> *To:* general@developer.marklogic.com
> *Subject:* Re: [MarkLogic Dev General] Need Technical Support
>
>
>
>
>
> Hello Team,
>
>
>
> We are new to MarkLogic DB and we are analysing it to use in our project
> which is programmed in scala .We have downloaded the MarkLogic 7
> trial version but are unable to create a rest API instance.
>
>
>
> We tried to insert a document but we are unable to come forward. Can you
> please assist us technically to get started.
>
>
>
>
>
> Thanks
>
> Udaya
>
>
> --
>
> *From:* general-boun...@developer.marklogic.com <
> general-boun...@developer.marklogic.com> on behalf of
> general-requ...@developer.marklogic.com <
> general-requ...@developer.marklogic.com>
> *Sent:* Friday, July 15, 2016 12:12 PM
> *To:* Udaya Laxmi Chillara (MFG & Tech)
> *Subject:* Welcome to the "General" mailing list
>
>
>
> ** This mail has been sent from an external source **
>
> Welcome to the General@developer.marklogic.com mailing list!
>
> To post to this list, send your email to:
>
>   general@developer.marklogic.com
>
> General information about the mailing list is at:
>
>   http://developer.marklogic.com/mailman/listinfo/general
>
> General Info Page - developer.marklogic.com
> 
>
> developer.marklogic.com
>
> This is a general mailing list for all things MarkLogic related. To see
> the collection of prior postings to the list, visit the General Archives.
>
>
>
>
> If you ever want to unsubscribe or change your options (eg, switch to
> or from digest mode, change your password, etc.), visit your
> subscription page at:
>
>
> http://developer.marklogic.com/mailman/options/general/udaya.chillara%40wipro.com
>
>
> You can also make such adjustments via email by sending a message to:
>
>   general-requ...@developer.marklogic.com
>
> with the word `help' in the subject or body (don't include the
> quotes), and you will get back a message with instructions.
>
> You must know your password to change your options (including changing
> the password, itself) or to unsubscribe.  It is:
>
>   marklogic
>
> Normally, Mailman will remind you of your developer.marklogic.com
> mailing list passwords once every month, although you can disable this
> if you prefer.  This reminder will also include instructions on how to
> unsubscribe or change your account options.  There is also a button on
> your options page that will email your current password to you.
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the 

Re: [MarkLogic Dev General] mlcp and loading multiple files

2016-07-03 Thread Indrajeet Verma
Hey Hans,

Not completely sure however could you try to load files again by defining
thread count properties equal to 1 in your mlcp import config file and see
the results?

-thread_count
1

Regards,
Indy

On Sun, Jul 3, 2016 at 11:22 PM, Hans Hübner 
wrote:

> Hi,
>
> I'm trying to load a bunch of files into MarkLogic using mlcp, but for
> some reason, it seems that it skips some of the files.  I'm using a command
> line like this:
>
> mlcp.sh import \
>  -database tx-claims \
>  -host marklogic -port 8884 -username XXX -password XXX -mode local \
>  -input_file_path 2015/277ca/ \
>  -input_file_type aggregates -aggregate_record_element TRANSACTION \
>  -transform_module /transform-in.xquery \
>  -transform_function transform-response \
>  -transform_namespace http://lambdawerk.com/tx-claims
>
> The transform-response function looks like this:
>
> declare function tx-claims:transform-response(
> $content as map:map,
> $context as map:map
> ) as map:map*
> {
>   let $doc := map:get($content, 'value')
>   let $icn := $doc/TRANSACTION/LOOP2000D/LOOP2200D/TRN/TRN02/text()
>   let $uri := concat('/responses/', $icn, '.xml')
>   return
> (map:put($content, 'uri', $uri),
> $content)
> };
>
> The mlcp output looks like this at the end:
>
> 16/07/03 18:59:22 INFO contentpump.LocalJobRunner:  completed 76%
> 16/07/03 18:59:28 INFO contentpump.LocalJobRunner:  completed 77%
> 16/07/03 18:59:30 INFO contentpump.LocalJobRunner:  completed 78%
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner:  completed 80%
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner:  completed 81%
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner:
> com.marklogic.mapreduce.ContentPumpStats:
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner: INPUT_RECORDS: 1421471
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS: 1421471
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner:
> OUTPUT_RECORDS_COMMITTED: 1404192
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_FAILED: 0
> 16/07/03 18:59:31 INFO contentpump.LocalJobRunner: Total execution time:
> 3270 sec
>
> After the load operation completes, nothing unusual is in the ErrroLog.txt
> file.  However, when I look into the database, I find that some files are
> missing.  When I load one of the missing files into the database explicitly
> (specifying its name as -input_file_path argument), it is correctly loaded.
>
> Now, the mlcp output looks kind of fishy to me in that i apparently loads
> the last 19% of the work in under one second.  It seems that it is skipping
> a whole bunch of files.  It also seems that some output records could not
> be written.  The manual says that this could be caused by a server-side
> transformation, but our function does not seem to be at fault - When I load
> the missing file specifying its file name, it is correctly loaded, so it
> seems to be something else.
>
> I would greatly appreciate any ideas or advice.
>
> Thanks!
> Hans
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


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

2016-06-23 Thread Indrajeet Verma
You can try with path range indexes as well and see which query will give
you fast results. Go through page no 29 and 30 of the pdf
"inside-marklogic-server-r7.pdf" for more information

Regards,
Indy

On Thu, Jun 23, 2016 at 1:12 PM, Indrajeet Verma <indrajeet.ve...@gmail.com>
wrote:

> Hi Hans,
>
> If you use range queries then you need to create required indexes
> manually/via script. As mention in my previous email, create range
> indexes on elements "j", "k", "d" and "f" to make it work by going
> Configure-->databases>yourdatabase-->Element range indexes.
>
> Please refer https://docs.marklogic.com/guide/admin/range_index for more
> information.
>
> For your question regarding universal indexing, XPath and cts queries,
> please refer
> https://developer.marklogic.com/pubs/architecture/inside-marklogic-server-r7.pdf
>
>
> Hope that helps!
>
> Regards,
> Indy
>
>
> On Thu, Jun 23, 2016 at 12:03 PM, Hans Hübner <hans.hueb...@lambdawerk.com
> > wrote:
>
>> Indy,
>>
>> thank you for your suggestion!  If I understand you correctly, the way to
>> go about is to build up a query manually rather than asking MarkLogic to
>> figure out a query plan based on the XPath provided?
>>
>> I have tried your solution, but it seems that some manual indexing is
>> required to make it work (which is also mentioned in the documentation for
>> cts:element-values):
>>
>> [1.0-ml] XDMP-ELEMRIDXNOTFOUND: cts:element-values(fn:QName("","k"), (),
>> (), cts:and-query((cts:document-query("file1.xml"),
>> cts:element-value-query(fn:QName("","j"), "123", ("lang=en"), 1)), ())) --
>> No element range index for k http://marklogic.com/collation/
>>
>> I will work myself from here, but any suggestion as to how to solve this
>> or what other approaches exist would be greatly appreciated!
>>
>> Thanks,
>> Hans
>>
>> On Thu, Jun 23, 2016 at 7:42 AM, Indrajeet Verma <
>> indrajeet.ve...@gmail.com> wrote:
>>
>>> Hi Hans,
>>>
>>> You might try below code and see if that helps in improving the
>>> performance. You need to create range indexes on elements "j", "k", "d" and
>>> "f".
>>>
>>> BTW what values the elements "k" and "f" does contain? Is it numeric,
>>> string or sentences ? If it contains para/sentences then you should think
>>> some different way.
>>>
>>> let $q1 := cts:and-query((cts:document-query("file1.xml"),
>>> cts:element-range-query(xs:QName("j"), '=','123')))
>>> for $key in cts:element-values(xs:QName("k"), (), (), $q1)
>>> let $q2 := cts:and-query((cts:document-query("file2.xml"),
>>> cts:element-range-query(xs:QName("d"), '=',$key)))
>>> let $data-from-file-2 := cts:element-values(xs:QName("f"), (), (), $q2)
>>> return
>>>   
>>>$key => $data-from-file-2
>>>   
>>>
>>>
>>> Regards,
>>> Indy
>>>
>>> On Thu, Jun 23, 2016 at 10:23 AM, Hans Hübner <
>>> hans.hueb...@lambdawerk.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have a beginner's question regarding indexing:  As far as I
>>>> understand, MarkLogic indexes all data according to global indexing rules.
>>>> Thus, in general, all accesses to data should be "fast" when the universal
>>>> index can be used.
>>>>
>>>> I am trying to combine data from two XML files into a report, and
>>>> throughput is not sufficient.  I'm now looking for ways to improve the
>>>> performance of my XQuery, either by adding indexes to MarkLogic or by
>>>> improving the query so that it runs faster.  Here's what I have:
>>>>
>>>> for $key in doc("file1.xml")/a/b/c/d/e/f/g/h/i[j = 123]/k/text()
>>>> let $data-from-file-2 := doc("file2.xml")/a/b[c/d = $key]/e/f/text()
>>>> return
>>>>   
>>>>$key => $data-from-file-2
>>>>   
>>>>
>>>> Thus, I'm iterating over some subset of the nodes in file1.xml,
>>>> selecting data from file2.xml for each of the nodes selected.  Both
>>>> file1.xml and file2.xml are in a files residing in MarkLogic.  They have a
>>>> pre-determined format and contain roughly 100,000 elements matching each of
>>>> the two paths.
>

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

2016-06-23 Thread Indrajeet Verma
Hi Hans,

If you use range queries then you need to create required indexes
manually/via script. As mention in my previous email, create range indexes
on elements "j", "k", "d" and "f" to make it work by going
Configure-->databases>yourdatabase-->Element range indexes.

Please refer https://docs.marklogic.com/guide/admin/range_index for more
information.

For your question regarding universal indexing, XPath and cts queries,
please refer
https://developer.marklogic.com/pubs/architecture/inside-marklogic-server-r7.pdf


Hope that helps!

Regards,
Indy


On Thu, Jun 23, 2016 at 12:03 PM, Hans Hübner <hans.hueb...@lambdawerk.com>
wrote:

> Indy,
>
> thank you for your suggestion!  If I understand you correctly, the way to
> go about is to build up a query manually rather than asking MarkLogic to
> figure out a query plan based on the XPath provided?
>
> I have tried your solution, but it seems that some manual indexing is
> required to make it work (which is also mentioned in the documentation for
> cts:element-values):
>
> [1.0-ml] XDMP-ELEMRIDXNOTFOUND: cts:element-values(fn:QName("","k"), (),
> (), cts:and-query((cts:document-query("file1.xml"),
> cts:element-value-query(fn:QName("","j"), "123", ("lang=en"), 1)), ())) --
> No element range index for k http://marklogic.com/collation/
>
> I will work myself from here, but any suggestion as to how to solve this
> or what other approaches exist would be greatly appreciated!
>
> Thanks,
> Hans
>
> On Thu, Jun 23, 2016 at 7:42 AM, Indrajeet Verma <
> indrajeet.ve...@gmail.com> wrote:
>
>> Hi Hans,
>>
>> You might try below code and see if that helps in improving the
>> performance. You need to create range indexes on elements "j", "k", "d" and
>> "f".
>>
>> BTW what values the elements "k" and "f" does contain? Is it numeric,
>> string or sentences ? If it contains para/sentences then you should think
>> some different way.
>>
>> let $q1 := cts:and-query((cts:document-query("file1.xml"),
>> cts:element-range-query(xs:QName("j"), '=','123')))
>> for $key in cts:element-values(xs:QName("k"), (), (), $q1)
>> let $q2 := cts:and-query((cts:document-query("file2.xml"),
>> cts:element-range-query(xs:QName("d"), '=',$key)))
>> let $data-from-file-2 := cts:element-values(xs:QName("f"), (), (), $q2)
>> return
>>   
>>$key => $data-from-file-2
>>   
>>
>>
>> Regards,
>> Indy
>>
>> On Thu, Jun 23, 2016 at 10:23 AM, Hans Hübner <
>> hans.hueb...@lambdawerk.com> wrote:
>>
>>> Hi,
>>>
>>> I have a beginner's question regarding indexing:  As far as I
>>> understand, MarkLogic indexes all data according to global indexing rules.
>>> Thus, in general, all accesses to data should be "fast" when the universal
>>> index can be used.
>>>
>>> I am trying to combine data from two XML files into a report, and
>>> throughput is not sufficient.  I'm now looking for ways to improve the
>>> performance of my XQuery, either by adding indexes to MarkLogic or by
>>> improving the query so that it runs faster.  Here's what I have:
>>>
>>> for $key in doc("file1.xml")/a/b/c/d/e/f/g/h/i[j = 123]/k/text()
>>> let $data-from-file-2 := doc("file2.xml")/a/b[c/d = $key]/e/f/text()
>>> return
>>>   
>>>$key => $data-from-file-2
>>>   
>>>
>>> Thus, I'm iterating over some subset of the nodes in file1.xml,
>>> selecting data from file2.xml for each of the nodes selected.  Both
>>> file1.xml and file2.xml are in a files residing in MarkLogic.  They have a
>>> pre-determined format and contain roughly 100,000 elements matching each of
>>> the two paths.
>>>
>>> It seems that the performance of the second of the two XPaths
>>> (doc("file2.xml")/a/b[c/d = $key]/e/f/text()) is most important.  Ideally,
>>> I would like this lookup to complete in under a millisecond, but it seems
>>> to need 75ms right now.
>>>
>>> Any help speeding this up would be greatly appreciated!
>>>
>>> Thanks,
>>> Hans
>>>
>>> --
>>> LambdaWerk GmbH
>>> Oranienburger Straße 87/89
>>> 10178 Berlin
>>> Phone: +49 30 555 7335 0
>>> Fax: +49 30 555 7335 99
>>>
>>> HRB 169991 B Amtsgericht Charlotte

Re: [MarkLogic Dev General] Validation error when loading pipeline with options via Management API

2016-06-22 Thread Indrajeet Verma
Hi Rob,

I have never tried loading pipeline via APIs however by looking into the
error, it seems a namespace error as you can see pipeline is in different
namespace and options is with different namespace as per docs.

If possible, could you share your code and I may try to look. If not I am
sure some other ML experts can help you on this.

Regards,
Indy
On 22-Jun-2016 2:44 pm, "Rob Walpole" <robkwalp...@gmail.com> wrote:

> Hi Indy,
>
> Thanks for your reply. Yes we have tried loading the pipeline via the
> admin UI and it works fine using the format you describe - however we
> really want to use the management API as the admin UI requires file system
> access on the server where MarkLogic and this will not always be available
> to us.
>
> Rob
>
>
> On 22 June 2016 at 10:05, Indrajeet Verma <indrajeet.ve...@gmail.com>
> wrote:
>
>> Hi Rob,
>>
>> Have you tried to load pipeline via admin UI and seeing same error?
>>
>> I am using ML8.0-4 and below code works with the options however I have
>> loaded pipeline via UI.
>>
>> 
>> 
>> When a document is zip,
>> 
>> http://marklogic.com/states/initial
>> http://marklogic.com/states/transformed
>> http://marklogic.com/states/error
>> 
>> 
>>
>> /MarkLogic/cpf/actions/mimetype-condition.xqy
>> > xmlns="/MarkLogic/cpf/actions/mimetype-condition.xqy">
>> application/zip
>> 
>> 
>> 
>> action/extract-zip.xqy
>> 
>> 
>> 
>>
>> Regards,
>> Indy
>>
>> On Wed, Jun 22, 2016 at 2:11 PM, Rob Walpole <robkwalp...@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> We are trying to load a CPF pipeline via the RESTful Management API and
>>> this fails with an invalid node error when there is an options element
>>> present within /pipeline-properties/state-transition/execute/condition
>>>
>>> The full error message is as follows:
>>>
>>> http://marklogic.com/xdmp/error;>
>>>   400
>>>   Bad Request
>>>   MANAGE-INVALIDPAYLOAD
>>>   MANAGE-INVALIDPAYLOAD: (err:FOER) Payload has errors in
>>> structure, content-type or values. XDMP-VALIDATEUNEXPECTED: (err:XQDY0027)
>>> validate strict { $pipeline } -- Invalid node: Found pp:options but
>>> expected any(lax,!(http://marklogic.com/manage/pipeline/properties))?
>>> at
>>> fn:doc("")/pp:pipeline-properties/pp:state-transition/pp:execute/pp:condition/pp:options
>>> using schema "manage-pipeline-properties.xsd"
>>> 
>>>
>>> The problem node looks like this:
>>>
>>> 
>>> /MarkLogic/cpf/actions/mimetype-condition.xqy
>>> 
>>> application/xml
>>> 
>>> 
>>>
>>> We have also tried putting the options element in as..
>>>
>>> 
>>> application/xml
>>> 
>>>
>>> ..which is how it is described in the Content Processing Framework Guide
>>> but this fails with a different error as follows:
>>>
>>> http://marklogic.com/xdmp/error;>
>>>   500
>>>   Internal Server Error
>>>   XDMP-VALIDATEUNEXPECTED
>>>   XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate strict {
>>> $pipeline } -- Invalid node: Found p:options but expected any(lax,!(
>>> http://marklogic.com/cpf/pipelines))? at
>>> /p:pipeline/p:state-transition/p:execute/p:condition/p:options using schema
>>> "pipelines.xsd"
>>> 
>>>
>>> If we remove the options element the pipeline loads via the API with no
>>> problems.
>>>
>>> We are using MarkLogic Server Enterprise Edition 8.0-4.2
>>>
>>> Many thanks
>>> Rob Walpole
>>>
>>> ___
>>> 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] Validation error when loading pipeline with options via Management API

2016-06-22 Thread Indrajeet Verma
Hi Rob,

Have you tried to load pipeline via admin UI and seeing same error?

I am using ML8.0-4 and below code works with the options however I have
loaded pipeline via UI.



When a document is zip,

http://marklogic.com/states/initial
http://marklogic.com/states/transformed
http://marklogic.com/states/error



/MarkLogic/cpf/actions/mimetype-condition.xqy

application/zip



action/extract-zip.xqy




Regards,
Indy

On Wed, Jun 22, 2016 at 2:11 PM, Rob Walpole  wrote:

> Hi,
>
> We are trying to load a CPF pipeline via the RESTful Management API and
> this fails with an invalid node error when there is an options element
> present within /pipeline-properties/state-transition/execute/condition
>
> The full error message is as follows:
>
> http://marklogic.com/xdmp/error;>
>   400
>   Bad Request
>   MANAGE-INVALIDPAYLOAD
>   MANAGE-INVALIDPAYLOAD: (err:FOER) Payload has errors in
> structure, content-type or values. XDMP-VALIDATEUNEXPECTED: (err:XQDY0027)
> validate strict { $pipeline } -- Invalid node: Found pp:options but
> expected any(lax,!(http://marklogic.com/manage/pipeline/properties))? at
> fn:doc("")/pp:pipeline-properties/pp:state-transition/pp:execute/pp:condition/pp:options
> using schema "manage-pipeline-properties.xsd"
> 
>
> The problem node looks like this:
>
> 
> /MarkLogic/cpf/actions/mimetype-condition.xqy
> 
> application/xml
> 
> 
>
> We have also tried putting the options element in as..
>
> 
> application/xml
> 
>
> ..which is how it is described in the Content Processing Framework Guide
> but this fails with a different error as follows:
>
> http://marklogic.com/xdmp/error;>
>   500
>   Internal Server Error
>   XDMP-VALIDATEUNEXPECTED
>   XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate strict {
> $pipeline } -- Invalid node: Found p:options but expected any(lax,!(
> http://marklogic.com/cpf/pipelines))? at
> /p:pipeline/p:state-transition/p:execute/p:condition/p:options using schema
> "pipelines.xsd"
> 
>
> If we remove the options element the pipeline loads via the API with no
> problems.
>
> We are using MarkLogic Server Enterprise Edition 8.0-4.2
>
> Many thanks
> Rob Walpole
>
> ___
> 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] Sort by last modified in search:search()

2016-05-12 Thread Indrajeet Verma
Hi Soumadri,

Have you tried using OPTIONS? If not please see below and try to create it
based on your requirement and pass it into search:search(). I think this
should give you sorted results.

declare variable $SEARCH-OPTIONS :=
http://marklogic.com/appservices/search;>
unfiltered
10

case-insensitive
punctuation-sensitive







(: constraints for search  :)




(: Sort of search result -- :)



















;

Regards,
Indrajeet

On Thu, May 12, 2016 at 4:05 PM, Roy Chowdhury, Soumadri <
srroychowdh...@innodata.com> wrote:

> Hi,
>
>
>
> How can I search using search:search() which need to return documents
> order by the last modified date. As the number of documents are huge,
> bringing the whole result set and sorting using ‘order by’ FLOWR expression
> is not useful.
>
>
>
> Regards,
>
> Soumadri Roy
> "This e-mail and any attachments transmitted with it are for the sole use
> of the intended recipient(s) and may contain confidential , proprietary or
> privileged information. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message. Any unauthorized review, use, disclosure, dissemination,
> forwarding, printing or copying of this e-mail or any action taken in
> reliance on this e-mail is strictly prohibited and may be unlawful."
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Database Restore Errorhis

2016-03-30 Thread Indrajeet Verma
One correction, Path should be like,
</<>/<>

On Wed, Mar 30, 2016 at 5:35 PM, Indrajeet Verma <indrajeet.ve...@gmail.com>
wrote:

> Hi Aganan,
>
> Did you give the path till a number like <>/<>
> (e.g. <>/20160315-141620826) in the restore from directory
> input field while restoring the DB?
>
> Error says, your backup dir is empty.
>
> Regards,
> Indy
>
>
>
> On Wed, Mar 30, 2016 at 3:15 PM, Aganan, Rufel <rpaga...@dci.ph> wrote:
>
>> I am trying to restore a previously backup-up database and getting an
>> error below:
>>
>> Operation failed with error message: XDMP-BACKUPEMPTY:
>> xdmp:database-restore((), "dcidmsbackup", (), fn:false(), (), fn:false(),
>> ()) -- No forests specified for backup or restore.. Check server logs.
>>
>> The restore was asking for confirmation (below)  to restore a forest
>> which I previously created and attached to the database. Is it because of
>> this?
>>
>> *Confirm that you want to restore the following forests to database
>> dcidms from directory dcidmsbackup*
>> dciforest *Use Incremental Backup: false* *Use Journal Archive: false
>> RestoreToTime: *
>> Thank you.
>> --
>> Rufel P. Aganan
>> Systems Analyst
>> DBP Data Center, Inc.
>> 848-02-77
>>
>> ___
>> 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] Database Restore Errorhis

2016-03-30 Thread Indrajeet Verma
Hi Aganan,

Did you give the path till a number like <>/<>
(e.g. <>/20160315-141620826) in the restore from directory
input field while restoring the DB?

Error says, your backup dir is empty.

Regards,
Indy



On Wed, Mar 30, 2016 at 3:15 PM, Aganan, Rufel  wrote:

> I am trying to restore a previously backup-up database and getting an
> error below:
>
> Operation failed with error message: XDMP-BACKUPEMPTY:
> xdmp:database-restore((), "dcidmsbackup", (), fn:false(), (), fn:false(),
> ()) -- No forests specified for backup or restore.. Check server logs.
>
> The restore was asking for confirmation (below)  to restore a forest which
> I previously created and attached to the database. Is it because of this?
>
> *Confirm that you want to restore the following forests to database dcidms
> from directory dcidmsbackup*
> dciforest *Use Incremental Backup: false* *Use Journal Archive: false
> RestoreToTime: *
> Thank you.
> --
> Rufel P. Aganan
> Systems Analyst
> DBP Data Center, Inc.
> 848-02-77
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Regarding running ML on AWS and using the pay-as-you-go payment model

2016-03-09 Thread Indrajeet Verma
Thank you David for sharing information!

Regards,
Indrajeet

On Wed, Mar 9, 2016 at 8:55 PM, David Gorbet <david.gor...@marklogic.com>
wrote:

> The annual subscription on AWS includes support. The hourly does not.
>
>
>
> *From:* general-boun...@developer.marklogic.com [mailto:
> general-boun...@developer.marklogic.com] *On Behalf Of *Indrajeet Verma
> *Sent:* Wednesday, March 09, 2016 7:01 AM
> *To:* MarkLogic Developer Discussion <general@developer.marklogic.com>
> *Subject:* [MarkLogic Dev General] Regarding running ML on AWS and using
> the pay-as-you-go payment model
>
>
>
> Hi All,
>
>
>
> Is there anyone running ML on AWS and using the pay-as-you-go payment
> model described on http://www.marklogic.com/what-is-marklogic/pricing/?
>
>
>
> and if it includes access to MarkLogic Support?
>
>
>
> Could you please share your findings and suggestions?
>
>
>
> Regards,
>
> Indrajeet
>
> ___
> 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


[MarkLogic Dev General] Regarding running ML on AWS and using the pay-as-you-go payment model

2016-03-09 Thread Indrajeet Verma
Hi All,

Is there anyone running ML on AWS and using the pay-as-you-go payment model
described on http://www.marklogic.com/what-is-marklogic/pricing/?

and if it includes access to MarkLogic Support?

Could you please share your findings and suggestions?

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


Re: [MarkLogic Dev General] Regarding Error

2016-02-15 Thread Indrajeet Verma
Hi Siva,

BTW what do you want to achieve? You can't use
fn:concat($file//dir:pathname/text())
in this way.  Please refer https://docs.marklogic.com/fn:concat.

Might be you use fn:string-join() instead however not sure about your
requirement.

e.g
let $file := xdmp:filesystem-directory($DIR_URI)
let $fileName :=  fn:string-join($file//dir:pathname/text(), ",")
return $fileName

Regards,
Indy

On Mon, Feb 15, 2016 at 4:52 PM, Mani, Sivasubramani (ELS) <
s.m...@elsevier.com> wrote:

> Hi Team,
>
>
>
> I want to convert element value to string in marklogic but I got an error
> my code was here
>
>
>
> let $DIR_URI := "/data/reports/"
>
>
>
> for $file in xdmp:filesystem-directory($DIR_URI)
>
> let $fileName :=  fn:concat($file//dir:pathname/text())
>
> return $file//dir:pathname/text()
>
>
>
> *XDMP-ARGTYPE: (err:XPTY0004)
> fn:concat($file/descendant::dir:pathname/text()) -- arg0 is not of type
> xs:anyAtomicType?*
>
> Kindly do the needful as soon as possible. Thanks in advance
>
>
>
> Thanks & Regards,
>
> Siva
>
>
>
> ___
> 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] json:transform-to-json() with custom configuration is suppressing some content in XML to JSON transformation

2016-01-02 Thread Indrajeet Verma
Thank you David for your suggestions!
On 02-Jan-2016 11:55 pm, "David Lee" <david@marklogic.com> wrote:

> The custom strategy will not work on arbitrary content.
> The 'full' strategy will.
>
> https://docs.marklogic.com/json:config
>
> At the expense of much more verbose and 'ugly' Markup.
>
> You can specify a set of names in the custom strategy to format as full
> See:
>
> full-element-names
>
> A list of XML element names which will be treated as an full expansion in
> JSON similar to the full strategy. These can be xs:QName or xs:string. If
> an xs:string is used then the default namespace is used to construct the
> QName.
>
>
>
>
> Another approach is to preprocessing the XML into a form that that
> Eliminates mixed text and repeated element children
>
> Similarly the resultant. JSON, if it is full fidelity , can be post
> processed
> To your final desired form
>
>
>
>
> Sent from my iPad
> David A Lee
> d...@marklogic.com
>
>
> On Jan 2, 2016, at 1:15 PM, Indrajeet Verma <indrajeet.ve...@gmail.com>
> wrote:
>
> Hi,
>
> I am using json:transform-to-json() function to convert XML node to json
> however for a nested xml node and with custom configuration, this function
> is suppressing some content.
>
> Could you please suggest where I am doing mistake or this is not the right
> conversion (json is not fit for mixed content )?
>
> import module namespace json = "http://marklogic.com/xdmp/json;
> at "/MarkLogic/json/json.xqy";
>
> let $node := This is my test data this should be italic sample
> content
> let $custom :=
> let $config := json:config("custom")
> let $_ := map:put( $config, "whitespace", "ignore" )
> return $config
>   return
> json:transform-to-json( $node, $custom )
>
>
> Result-
>
> {
> "p":
> {
> "i": "this should be italic",
> "_value": " sample content"
> }
> }
>
>
> import module namespace json = "http://marklogic.com/xdmp/json;
> at "/MarkLogic/json/json.xqy";
>
> let $node := This is my test data this should be italic sample
> content
> return
> json:transform-to-json( $node, json:config("full") )
>
> Result-
>
> {
> "p":
> {
> "_children":
> [
> "This is my test data ",
> {
> "i":
> {
> "_children":
> [
> "this should be italic"
> ]
> }
> }
> ,
> " sample content"
> ]
> }
> }
>
> Regards,
> Indrajeet
>
> ___
> 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


[MarkLogic Dev General] json:transform-to-json() with custom configuration is suppressing some content in XML to JSON transformation

2016-01-02 Thread Indrajeet Verma
Hi,

I am using json:transform-to-json() function to convert XML node to json
however for a nested xml node and with custom configuration, this function
is suppressing some content.

Could you please suggest where I am doing mistake or this is not the right
conversion (json is not fit for mixed content )?

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

let $node := This is my test data this should be italic sample
content
let $custom :=
let $config := json:config("custom")
let $_ := map:put( $config, "whitespace", "ignore" )
return $config
  return
json:transform-to-json( $node, $custom )


Result-

{
"p":
{
"i": "this should be italic",
"_value": " sample content"
}
}


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

let $node := This is my test data this should be italic sample
content
return
json:transform-to-json( $node, json:config("full") )

Result-

{
"p":
{
"_children":
[
"This is my test data ",
{
"i":
{
"_children":
[
"this should be italic"
]
}
}
,
" sample content"
]
}
}

Regards,
Indrajeet
___
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 Indrajeet Verma
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
>
>
>
>
>
> *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;> type="xs:dateTime" direction="descending"> name="insert_timestamp"/>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;> type="xs:dateTime" direction="descending"> name="insert_timestamp"/>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
>
>
>
> *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
>
>
>
>
>
> Click here
> 
> to report this email as spam.
>
>
> ___
> 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] searching for word where uppercase letter can occur anywhere in the word

2015-11-25 Thread Indrajeet Verma
Hey Amish,

Might be someone has better option however I can think of maintaining a
thesaurus for all type of possible combinations with upper case letter and
do the exact search for other elements except lower case.


Also you approach might fail incase, any word with upper case letter might
be present in the document where a word with lower case. I mean "worker"
and "Worker" can be present in a single document so you can not exclude
that results from your list.

Regards,
Indy

On Wed, Nov 25, 2015 at 11:57 PM, Shah, Amish (LNG-CON) <
amish.s...@lexisnexis.com> wrote:

> Marklogic version used by me version 7 or 8:
>
>
>
> Looks like Marklogic provides the ability to do case-sensitive and
> case-insensitive search and we can set those options with a combination of
> filtered or unfiltered search.
>
> It also provides a mechanism to index the documents using fast case
> sensitive searches option in the configure part of the database, of course
> index will affect the results from filtered or unfiltered.
>
> Our application wants to start supporting mechanism where we want to find
> any letter in the word which may upper case.
>
>
>
> For example  a search for anyletterupperCase (worker)
>
> Should give matches for
>
>   Worker
>
>   WOrker
>
>   workEr
>
>
>
>
>
> but no match for
>
>worker
>
>
>
> match words where uppercase can happen.  I could not find any search
> option or feature which would help me come to what I need (atleast so far).
>
>
>
> Any help or thoughts if something close to above is supported.
>
>
>
> Solution that I can think of
>
> 
>
> For simplicity lets assume that there is only one occurrence of word
> worker in each of  my documents
>
>
>
> One solution I was thinking was,
>
> To do a search with “exact” on worker lets call the search result as
>  (List_exact)
>
>
>
> This should give me list of documents that I can exclude
>
> Then do a case-insensitive search on worker, call the search result as
>  (List_general)
>
>
>
> Resultant_list  = list_general – list_exact
>
>
>
> Resultant_list will have occurences of worker where any word would be
> uppercase
>
>
>
> Inefficiency is that my solution involve two searches.
>
>
>
> Thanks in advance
>
> Amish
>
>
>
> ___
> 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 Indrajeet Verma
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 <apeac...@elevate.co.uk>
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
>
>
>
> *Ashley Peacock*
>
> Developer II
> Elevate Credit International Limited
> P: 01284 717800 | Ext: 877 |  Elevate.co.uk <http://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 <indrajeet.ve...@gmail.com>
> 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 <apeac...@elevate.co.uk>
> 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
>>
>>
>>
>>
>>
>> **
>>
>> *Ashley Peacock*
>>
>> Developer II
>> Elevate Credit International Limited
>> P: 01284 717800 | Ext: 877 |  Elevate.co.uk <http://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;>> type="xs:dateTime" direction="descending">> name="insert_timestamp"/>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;>> type="xs:dateTime" direction="descending">> name="ins

Re: [MarkLogic Dev General] SEARCH-BADORDERBY

2015-11-25 Thread Indrajeet Verma
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 <indrajeet.ve...@gmail.com
> 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 <apeac...@elevate.co.uk>
> 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
>>
>>
>>
>> *Ashley Peacock*
>>
>> Developer II
>> Elevate Credit International Limited
>> P: 01284 717800 | Ext: 877 |  Elevate.co.uk <http://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 <indrajeet.ve...@gmail.com>
>> 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 <apeac...@elevate.co.uk>
>> 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
>>>
>>>
>>>
>>>
>>>
>>> **
>>>
>>> *Ashley Peacock*
>>>
>>> Developer II
>>> Elevate Credit International Limited
>>> P: 01284 717800 | Ext: 877 |  Elevate.co.uk <http://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;>>> type="xs:dateTime" direction="descending">>> name="insert_timestamp"/>Order by the timestamp,
>>> descending
>>>
>>>
>>>
>>> If I then query using that search option, I get the following result:
>>>
>>>
>>>
>>> {"errorResponse":{"statusCode":400, "status"

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

2015-11-16 Thread Indrajeet Verma
Cowan,

There is a function fn:last() which returns an integer value that
represents the number of items in the current context. Please refer
https://docs.marklogic.com/fn:last. See if that works for you.

Another approach could be, you can get the count of your results and add
the condition like $counter < $count or $counter = $count whatever you
needed.

Regards,
Indy

On Tue, Nov 17, 2015 at 10:00 AM, Kari Cowan  wrote:

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


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

2015-08-11 Thread Indrajeet Verma
Sanjay,

Did you try using xdmp:document-get() and xdmp:document-insert(),

let $doc := xdmp:document-get($loc)
return xdmp:document-insert($uri, $odc,$permissions.)


Regards,
Indy

On Tue, Aug 11, 2015 at 7:20 PM, Sanjaya Keshari Dash 
sanjaya_d...@infosys.com wrote:

 Hi All,



 we have ML Server Enterprise Edition 8.0-3 installed one of the systems in
 our network. However, It worked fine while trying to load it from the same
 system where the server is running.



 While trying to load a file from another system(Remote) on the same
 network, the command is not able to trace the path, which is local to the
 remote host.



 *XQuery:*

 xquery version 1.0-ml;

 declare namespace html = http://www.w3.org/1999/xhtml;;




 xdmp:document-load(d:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfast.xml,

 options xmlns=xdmp:document-load

   uri/assignment/breakfast/breakfast.xml/uri

   repairnone/repair

   permissions{xdmp:default-permissions()}/permissions

 /options)



 Error Message:



 *[1.0-ml] SVC-FILOPN:
 xdmp:document-load(d:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfa...,
 options
 xmlns=xdmp:document-loaduri/assignment/breakfast/breakfast.xml/urirepairnone/repa.../options)
 -- File open error: open
 'd:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfast.xml':
 No such file or directory*

 *Stack Trace*

 *At line 4 column 0:*

 In xdmp:eval(xquery version quot;1.0-mlquot;;#10;declare namespace
 html = ..., (), options
 xmlns=xdmp:evaldatabase16075890108731410617/databasemodules10812663131527.../options)

 2. declare namespace html = http://www.w3.org/1999/xhtml;;
 3.
 4.
 xdmp:document-load(d:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfast.xml,
 5. options xmlns=xdmp:document-load
 6. uri/assignment/breakfast/breakfast.xml/uri

 Please advise on the resolution if possible.



 thanks

 _ sanjaya

  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


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


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

2015-08-11 Thread Indrajeet Verma
Sanajya - I realized my code will also not work for you.

Regards,
Indy

On Tue, Aug 11, 2015 at 7:28 PM, Indrajeet Verma indrajeet.ve...@gmail.com
wrote:

 Sanjay,

 Did you try using xdmp:document-get() and xdmp:document-insert(),

 let $doc := xdmp:document-get($loc)
 return xdmp:document-insert($uri, $odc,$permissions.)


 Regards,
 Indy

 On Tue, Aug 11, 2015 at 7:20 PM, Sanjaya Keshari Dash 
 sanjaya_d...@infosys.com wrote:

 Hi All,



 we have ML Server Enterprise Edition 8.0-3 installed one of the systems
 in our network. However, It worked fine while trying to load it from the
 same system where the server is running.



 While trying to load a file from another system(Remote) on the same
 network, the command is not able to trace the path, which is local to the
 remote host.



 *XQuery:*

 xquery version 1.0-ml;

 declare namespace html = http://www.w3.org/1999/xhtml;;




 xdmp:document-load(d:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfast.xml,

 options xmlns=xdmp:document-load

   uri/assignment/breakfast/breakfast.xml/uri

   repairnone/repair

   permissions{xdmp:default-permissions()}/permissions

 /options)



 Error Message:



 *[1.0-ml] SVC-FILOPN:
 xdmp:document-load(d:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfa...,
 options
 xmlns=xdmp:document-loaduri/assignment/breakfast/breakfast.xml/urirepairnone/repa.../options)
 -- File open error: open
 'd:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfast.xml':
 No such file or directory*

 *Stack Trace*

 *At line 4 column 0:*

 In xdmp:eval(xquery version quot;1.0-mlquot;;#10;declare namespace
 html = ..., (), options
 xmlns=xdmp:evaldatabase16075890108731410617/databasemodules10812663131527.../options)

 2. declare namespace html = http://www.w3.org/1999/xhtml;;
 3.
 4.
 xdmp:document-load(d:\MarkLogic\day2ExampleCodes\day2ExampleCodes\breakfast\breakfast.xml,
 5. options xmlns=xdmp:document-load
 6. uri/assignment/breakfast/breakfast.xml/uri

 Please advise on the resolution if possible.



 thanks

 _ sanjaya

  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



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


[MarkLogic Dev General] Regarding Excluding a node from search

2015-07-23 Thread Indrajeet Verma
Hi All,

I am doing free text search by using search libraries. I am using
search:search/search:resolve etc.. We have elements footnote inside
documents and I don't want to include these nodes in my search.

e.g.

If I search Effective , this should not return result.

If I search confidential , this should return result however match count
should be only 2 NOT 3. Also confidential  that is under footnote should
not be highlighted.

doc
meta
/meta
footnote id=R09-IDANDNQ-R09-IDAE00T-FN7 content-type=secondary
para
textEffective February 3, 2015, confidential  /text
   /para
/footnote
num(a)/num
para
textAn SCI entity (as defined in
of this chapter) shall not omit the confidential portion from
the material filed in electronic format on Form SCI pursuant to Regulation
SCI,
italicet seq/italic., and, in lieu of the procedures
described in
 of this section, may request confidential treatment of all
information provided on Form SCI by completing Section IV of Form SCI.
/text
/para
/doc


Is there any way to exclude elements from the search?

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


Re: [MarkLogic Dev General] Regarding Excluding a node from search

2015-07-23 Thread Indrajeet Verma
Thank you All for your suggestions!

I am using cts:element, cts:word and cts:range queries with in
search:resolve. If I don't want to change any query in code, could I
exclude footnote element from my search?

if I create phrase arounds in  my database, will re-indexing happen? Will
any extra space required?

Regards,
Indy


On Thu, Jul 23, 2015 at 7:31 PM, Geert Josten geert.jos...@marklogic.com
wrote:

  Hi Indy,

  I think you are looking for the Phrase-Arounds setting on your database.
 Or if you are using a Field, you can add that element to the exclude list..

  Kind regards,
 Geert

   From: general-boun...@developer.marklogic.com on behalf of Indrajeet
 Verma indrajeet.ve...@gmail.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Thursday, July 23, 2015 at 3:57 PM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: [MarkLogic Dev General] Regarding Excluding a node from search

   Hi All,

  I am doing free text search by using search libraries. I am using
 search:search/search:resolve etc.. We have elements footnote inside
 documents and I don't want to include these nodes in my search.

  e.g.

  If I search Effective , this should not return result.

  If I search confidential , this should return result however match count
 should be only 2 NOT 3. Also confidential  that is under footnote should
 not be highlighted.

  doc
 meta
 /meta
  footnote id=R09-IDANDNQ-R09-IDAE00T-FN7 content-type=secondary
 para
 textEffective February 3, 2015, confidential  /text
 /para
 /footnote
  num(a)/num
 para
 textAn SCI entity (as defined in
 of this chapter) shall not omit the confidential portion from
 the material filed in electronic format on Form SCI pursuant to Regulation
 SCI,
 italicet seq/italic., and, in lieu of the procedures
 described in
  of this section, may request confidential treatment of all
 information provided on Form SCI by completing Section IV of Form SCI.
 /text
 /para
  /doc


  Is there any way to exclude elements from the search?

  Regards,
 Indy

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


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


Re: [MarkLogic Dev General] Need to remove unused xml namespace prefix

2015-07-22 Thread Indrajeet Verma
Hi Raghu,

Can you try this and see if works for you?

declare namespace ns=http://somewhere.something.com;;
xdmp:document-insert
(
/text.xml,
ns:root
child xmlns=http://anywhere.anything.com;/child
/ns:root
);
declare function local:reparse-doc($node)
{
  typeswitch($node)
  case document-node() return
local:reparse-doc($node/*[1])
  case element() return
element { fn:node-name($node) } {
  $node/node() ! local:reparse-doc(.)
}
 case processing-instruction() return $node
 case comment() return $node
 default return $node
};
let $doc := doc(/text.xml)//*:child
return local:reparse-doc($doc)

Regards,
Indy

On Wed, Jul 22, 2015 at 6:28 PM, Raghu raghupathy.visweswa...@gmail.com
wrote:

 Thanks Florent Georges!

 On Wed, Jul 22, 2015 at 7:42 AM, Florent Georges li...@fgeorges.org
 wrote:

   Hi,

   Just to make it clear, there is nothing wrong with using several
 namespaces in the same document.  Namespaces have been invented to
 differentiate names (by creating uniquely identified spaces for
 them).  So their unit of application is element and attribute names,
 rather than documents.

   Think for instance about embedding SVG and MathML elements in a
 XHTML or XSL-FO document.  The namespaces will ensure that elements
 with the (local) name title can be differentiated, by looking at
 within what namespace they have been defined.

   Regards,

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


 On 21 July 2015 at 19:30, Asit Nautiyal wrote:
 
  Hi Raghu,
 
  Here you want to keep the text.xml as part of
  http://somewhere.something.com; namespace and want to make its child
  element (child) part to other namespace http://anywhere.anything.com;
 ,
  correct me, if I am wrong!
 
  If this is the case then, you are making this xml file as ambiguous. In
 xml
  file , all child elements should belongs to same namespace as its root
  element, that's why we have concept of namespace.
 
  Regards,
  Asit Nautiyal
  
  Date: Tue, 21 Jul 2015 11:07:53 -0400
  From: raghupathy.visweswa...@gmail.com
  To: general@developer.marklogic.com
  CC: nagendran...@gmail.com
  Subject: [MarkLogic Dev General] Need to remove unused xml namespace
 prefix
 
 
  HI All,
 
  The following snippet gives me the unused namespace prefix (in this case
  ns), I need to ignore such unused namespace prefixes in the output
 
  Query
 
  declare namespace ns=http://somewhere.something.com;;
  xdmp:document-insert
  (
  /text.xml,
  ns:root
  child xmlns=http://anywhere.anything.com;/child
  /ns:root
  );
  doc(/text.xml)//*:child
 
  Result
 
  child xmlns:ns=http://somewhere.something.com;
  xmlns=http://anywhere.anything.com/
 
  Thanks in advance!
  Raghu
 
  ___ 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


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


Re: [MarkLogic Dev General] Displaying document after an update

2015-07-18 Thread Indrajeet Verma
Thank you Eric. I had also a similar kind of requirement however I was
first retrieving full document from db and manipulating in the memory then
replacing whole document and returning the document that is in the memory
to API.

I will try this and see if it gives better performance.

Though my document size is very small.

Regards,
Indy

On Sat, Jul 18, 2015 at 2:43 AM, Erik Hennum erik.hen...@marklogic.com
wrote:

  Hi, Danny:

 Good that you puzzled it out.

 In case anyone is curious about the details, the solution would be similar
 to:

 let $uri := /some/text.xml
 return  (
 xdmp:invoke-function(function () {
 xdmp:node-replace(doc($uri)/some/path/text(),
 text{'replacement'})
 },
 options xmlns=xdmp:eval
   transaction-modeupdate-auto-commit/transaction-mode
 /options
 ),

 xdmp:invoke-function(function () {
 doc($uri)
 })
 )


   Erik Hennum

--
 *From:* general-boun...@developer.marklogic.com [
 general-boun...@developer.marklogic.com] on behalf of Danny Sinang [
 d.sin...@gmail.com]
 *Sent:* Friday, July 17, 2015 2:02 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Displaying document after an update

   Never mind ... figured it out.

  The app was hanging because I had a query to the same document just
 before the xdmp:invoke-function which updates the same document.

  I've now placed that initial query inside xdmp:invoke-function as well.

 On Fri, Jul 17, 2015 at 4:16 PM, Danny Sinang d.sin...@gmail.com wrote:

 Hi Erik,

  I got this error when I ran the code below :

  XDMP-UPEXTNODES:
 xdmp:node-replace(fn:doc(/release-tracking/components/2.xml)/component/environments/environment[2],
 environmentnameQA/nameversion9/versionversion-date2015-07-17T16:0.../environment)
 -- Cannot update external nodes

  *xdmp:invoke-function* (
 *function* () {
 *xdmp:node-replace*(*$environment*,
 *$new-environment*)
 },
 options *xmlns*=*xdmp:eval*
 transaction-modeupdate-auto-commit
 /transaction-mode
 /options
 )


  So I did this instead :

 xdmp:invoke-function (
 function () {
let $component := fn:doc
 ($component-uri)/node()
let $environment :=
 $component/environments/environment[name eq $environment-name]
let $new-environment :=  element
 environment {
 for $elem in
 $environment/child::*
 return
switch
 ($elem/name())
 case
 version return version{$new-version-number}/version
 case
 version-date return version-date{fn:current-dateTime()}/version-date

 default return $elem
 }
 return
 xdmp:node-replace($environment,
 $new-environment)
  },
 options xmlns=xdmp:eval

 transaction-modeupdate-auto-commit/transaction-mode
 /options
 )


  but the app just hung.

 If I go with the code below (which uses xdmp:spawn-function), the
 node-replace works, but the document displayed is the one before the update
 was applied.

*let **$_* :=
 *xdmp:spawn-function* (
 *function* () {
*let **$component* := *fn:doc* (
 *$component-uri*)/*node*()
*let* *$environment* :=
 *$component*/*environments*/*environment*[*name* eq *$environment-name*]
*let* *$new-environment* :=
 *element* *environment* {
 *for
 * *$elem* *in **$environment*/child::*

 *return*

 *switch* (*$elem*/*name*())

   *case *version *return *version{*$new-version-number*}/version

   *case *version-date *return *version-date{*fn:current-dateTime*()}
 /version-date

   *default* *return **$elem*
 }
 *return*
 *xdmp:node-replace*(
 *$environment*, *$new-environment*)
  },
 

[MarkLogic Dev General] cts:element-values is not returning result in input order

2015-07-16 Thread Indrajeet Verma
Hi All,

I am using cts:element-values() to return suggestions based on the input
char/string and its other matches and I want the result in order of input.
If I entered A, the match of A should come first and then matches of others.

Please help me to correct my code!

Query-
---
let $query := cts:or-query(cts:element-range-query(xs:QName(sum:TS), =,
(A, AB, AC,ABDC,AXYZ), (collation=
http://marklogic.com/collation/codepoint;), 1), ())
let $values :=
cts:element-values(xs:QName('Searchable-Value'),(),(fn:concat(limit=, 10)
,fragment-frequency,item-order, concurrent), $query)
return $values

The cts:element-values() is not returning results in the order of inputs
(A, AB, AC,ABDC,AXYZ).

Might be in this example the output same however when (A, AB,
AC,ABDC,AXYZ, ) increase then the order of results unexpected.

Is there any way to show the results in order of input (A, AB,
AC,ABDC,AXYZ)?


XML document 1
?xml version=1.0 encoding=UTF-8?
Company
Company-NameNOBLE CORP SWITZERLAND/Company-Name
Searchable-Value{CompanyName:NOBLE CORP
SWITZERLAND,TS:AC}/Searchable-Value
/Company
XML document 2
?xml version=1.0 encoding=UTF-8?
Company
Company-NameSAFEGUARD SCIENTIFICS INC/Company-Name
Searchable-Value{CompanyName:SAFEGUARD SCIENTIFICS
INC,CIK:86115,TS:A}/Searchable-Value
/Company
XML document 3
?xml version=1.0 encoding=UTF-8?
Company
Company-NameCRUCELL NV/Company-Name
Searchable-Value{CompanyName:CRUCELL
NV,CIK:1126136,TS:AB}/Searchable-Value
/Company
.




Expected output:


Searchable-Value{CompanyName:SAFEGUARD SCIENTIFICS
INC,CIK:86115,TS:A}/Searchable-Value
Searchable-Value{CompanyName:CRUCELL
NV,CIK:1126136,TS:AB}/Searchable-Value
Searchable-Value{CompanyName:NOBLE CORP
SWITZERLAND,TS:AC}/Searchable-Value


Regards,
Indy
___
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 is not returning result in input order

2015-07-16 Thread Indrajeet Verma
Some Correction in Input,

XML document 1
?xml version=1.0 encoding=UTF-8?
Company
Company-NameNOBLE CORP SWITZERLAND/Company-Name
TSAC/TS
Searchable-Value{CompanyName:NOBLE CORP
SWITZERLAND,TS:AC}/Searchable-Value
/Company
XML document 2
?xml version=1.0 encoding=UTF-8?
Company
Company-NameSAFEGUARD SCIENTIFICS INC/Company-Name
TSA/TS
Searchable-Value{CompanyName:SAFEGUARD SCIENTIFICS
INC,CIK:86115,TS:A}/Searchable-Value
/Company
XML document 3
?xml version=1.0 encoding=UTF-8?
Company
Company-NameCRUCELL NV/Company-Name
TSAB/TS
Searchable-Value{CompanyName:CRUCELL
NV,CIK:1126136,TS:AB}/Searchable-Value
/Company
.




On Thu, Jul 16, 2015 at 10:47 PM, Indrajeet Verma indrajeet.ve...@gmail.com
 wrote:

 Hi All,

 I am using cts:element-values() to return suggestions based on the input
 char/string and its other matches and I want the result in order of input.
 If I entered A, the match of A should come first and then matches of others.

 Please help me to correct my code!

 Query-
 ---
 let $query := cts:or-query(cts:element-range-query(xs:QName(TS), =,
 (A, AB, AC,ABDC,AXYZ), (collation=
 http://marklogic.com/collation/codepoint;), 1), ())
 let $values :=
 cts:element-values(xs:QName('Searchable-Value'),(),(fn:concat(limit=, 10)
 ,fragment-frequency,item-order, concurrent), $query)
 return $values

 The cts:element-values() is not returning results in the order of inputs
 (A, AB, AC,ABDC,AXYZ).

 Might be in this example the output same however when (A, AB,
 AC,ABDC,AXYZ, ) increase then the order of results unexpected.

 Is there any way to show the results in order of input (A, AB,
 AC,ABDC,AXYZ)?


 XML document 1
 ?xml version=1.0 encoding=UTF-8?
 Company
 Company-NameNOBLE CORP SWITZERLAND/Company-Name
 Searchable-Value{CompanyName:NOBLE CORP
 SWITZERLAND,TS:AC}/Searchable-Value
 /Company
 XML document 2
 ?xml version=1.0 encoding=UTF-8?
 Company
 Company-NameSAFEGUARD SCIENTIFICS INC/Company-Name
 Searchable-Value{CompanyName:SAFEGUARD SCIENTIFICS
 INC,CIK:86115,TS:A}/Searchable-Value
 /Company
 XML document 3
 ?xml version=1.0 encoding=UTF-8?
 Company
 Company-NameCRUCELL NV/Company-Name
 Searchable-Value{CompanyName:CRUCELL
 NV,CIK:1126136,TS:AB}/Searchable-Value
 /Company
 .
 



 Expected output:
 

 Searchable-Value{CompanyName:SAFEGUARD SCIENTIFICS
 INC,CIK:86115,TS:A}/Searchable-Value
 Searchable-Value{CompanyName:CRUCELL
 NV,CIK:1126136,TS:AB}/Searchable-Value
 Searchable-Value{CompanyName:NOBLE CORP
 SWITZERLAND,TS:AC}/Searchable-Value


 Regards,
 Indy

___
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 is not returning result in input order

2015-07-16 Thread Indrajeet Verma
Thank you Mary!

Yes your understanding is correct. I am retrieving a different element
values based on other element values.

I will try your suggested code. However I was thinking to use
cts:element-values twice.

let $first-token-value := cts:element-values(
xs:QName('Searchable-Value'),
(),
(fn:concat(limit=, 1)
,fragment-frequency,frequency-order,descending, concurrent),

cts:element-range-query(xs:QName(TS),=, A))
let $other-values := cts:element-values(
xs:QName('Searchable-Value'),
(),
(fn:concat(limit=, 9)
,fragment-frequency,frequency-order,descending, concurrent),

cts:element-range-query(xs:QName(TS),=, (AB, AC,...)))
return ($first-token-value, $other-values)

Right now I am not sure which one will give better performance your
suggested code OR mine. Do you have any suggestions in my code?

Regards,
Indy

On Thu, Jul 16, 2015 at 11:43 PM, Mary Holstege mary.holst...@marklogic.com
 wrote:


 cts:element-values can either return the full values based on the ordering
 of those values (the full values) or on the frequency of the occurrences of
 those values.
 Since A and AXYZ aren't values of the element given to element-values,
 you can't return things based on the ordering of those. It sounds like you
 want to return values of one element based on the ordering of values of
 some other element.

 You could do something like:
 cts:element-value-co-occurrences(xs:QName(TS),xs:QName(Searchable-Value),(limit=10,fragment-frequency,item-order,concurrent))!fn:data(.//cts:value[2])

 That orders things on the first element, and plucks out values of the
 second.

 //Mary


 On 07/16/2015 10:17 AM, Indrajeet Verma wrote:

 Hi All,

  I am using cts:element-values() to return suggestions based on the input
 char/string and its other matches and I want the result in order of input.
 If I entered A, the match of A should come first and then matches of others.

  Please help me to correct my code!

   Query-
 ---
 let $query := cts:or-query(cts:element-range-query(xs:QName(sum:TS),
 =, (A, AB, AC,ABDC,AXYZ), (collation=
 http://marklogic.com/collation/codepoint;), 1), ())
 let $values :=
 cts:element-values(xs:QName('Searchable-Value'),(),(fn:concat(limit=, 10)
 ,fragment-frequency,item-order, concurrent), $query)
 return $values

  The cts:element-values() is not returning results in the order of inputs
 (A, AB, AC,ABDC,AXYZ).

  Might be in this example the output same however when (A, AB,
 AC,ABDC,AXYZ, ) increase then the order of results unexpected.

  Is there any way to show the results in order of input (A, AB,
 AC,ABDC,AXYZ)?


  XML document 1
 ?xml version=1.0 encoding=UTF-8?
 Company
 Company-NameNOBLE CORP SWITZERLAND/Company-Name
 Searchable-Value{CompanyName:NOBLE CORP
 SWITZERLAND,TS:AC}/Searchable-Value
 /Company
 XML document 2
 ?xml version=1.0 encoding=UTF-8?
 Company
 Company-NameSAFEGUARD SCIENTIFICS INC/Company-Name
 Searchable-Value{CompanyName:SAFEGUARD SCIENTIFICS
 INC,CIK:86115,TS:A}/Searchable-Value
 /Company
 XML document 3
 ?xml version=1.0 encoding=UTF-8?
 Company
 Company-NameCRUCELL NV/Company-Name
 Searchable-Value{CompanyName:CRUCELL
 NV,CIK:1126136,TS:AB}/Searchable-Value
 /Company
 .
 



  Expected output:
 

  Searchable-Value{CompanyName:SAFEGUARD SCIENTIFICS
 INC,CIK:86115,TS:A}/Searchable-Value
 Searchable-Value{CompanyName:CRUCELL
 NV,CIK:1126136,TS:AB}/Searchable-Value
 Searchable-Value{CompanyName:NOBLE CORP
 SWITZERLAND,TS:AC}/Searchable-Value


  Regards,
 Indy


 ___
 General mailing listgene...@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] XDMP-EXPNTREECACHEFULL error

2015-07-02 Thread Indrajeet Verma
Hi Gary,

As suggested by Geert, you should use search:search() in place of
cts:search(). That is very quick. However please let us know what do you
want to achieve and some sample of data so that we can help you.

Regards,
Indy

On Thu, Jul 2, 2015 at 4:53 PM, Gary Larsen gary.lar...@envisn.com wrote:

 Hi Indy,



 I’ve been using this syntax for cts:search queries with large result sets
 to avoid XDMP-EXPNTREECACHEFULL.





 (: setup constraining query :)

 let $cq :=
 ...
 ))

 let $incr := 1000
 let $size := xdmp:estimate(cts:search(doc(), $cq, 'unfiltered'))
 let $segs := ceiling($size div $incr) return

 for $x in (1 to $segs)
 let $start :=  (($x -1) * $incr) +1
 let $end := $start + $incr -1 return
 for $a in  cts:search(doc(), $cq, 'unfiltered')[$start to $
 end]/content  return



   ...



 Gary



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *???
 *Sent:* Thursday, July 02, 2015 4:54 AM
 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error



 I had created range index on delete_flag and report_date, and i change my 
 xquery to this:

 count(cts:search(collection('test')/patient/link/visit/lab_report[@delete_flag
  = '0'],

   cts:and-query(

 
 (cts:element-attribute-range-query(xs:QName(lab_report),xs:QName(report_date),
  =, xs:dateTime(2010-09-25T00:00:00.000)),

 
 cts:element-attribute-range-query(xs:QName(lab_report),xs:QName(report_date),
  =, xs:dateTime(2014-09-25T00:00:00.000));



 and this query can work.



 but if i execute the follow xquery, MarkLogic still will throw an 
 XDMP-EXPNTREECACHEFULL error:

 cts:search(collection()/patient/link/visit/lab_report[@delete_flag = '0'],

   cts:and-query(

 
 (cts:element-attribute-range-query(xs:QName(lab_report),xs:QName(report_date),
  =, xs:dateTime(2010-09-25T00:00:00.000)),

 
 cts:element-attribute-range-query(xs:QName(lab_report),xs:QName(report_date),
  =, xs:dateTime(2014-09-25T00:00:00.000);



 the above xquery will return a very large resut set, in this case, what can i 
 do to avoid the  XDMP-EXPNTREECACHEFULL error





 

 Message: 1

 Date: Wed, 1 Jul 2015 10:58:24 +0530

 From: Indrajeet Verma indrajeet.ve...@gmail.com

 Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error

 To: MarkLogic Developer Discussion general@developer.marklogic.com

 Message-ID:

cakwhaegeh70ro8wgqvmuv3jaqbcmv7u09gnxhnfxmfbv1or...@mail.gmail.com

 Content-Type: text/plain; charset=utf-8

 

 In Addition of Asit response,

 

 You should go with cts:element-values() and you should create cts:and-query

 and inside it cts:range-query for the dates and flag.

 

 Create range index for lab_report, report_date and delete_flag.

 

 Let me know if you want any help in creating query.

 

 Regards,

 Indy

 

 On Wed, Jul 1, 2015 at 10:45 AM, Asit Nautiyal asitnauti...@outlook.com

 wrote:

 

  Hi Zise,

 

  By observing below code, it will hit performance for sure and that's why

  your are getting XDMP-EXPNTREECACHEFULL error.

  To avoid XDMP-EXPNTREECACHEFULL error you have to tune your code. Use

  cts:queries (like range queries and others) to get your result first and

  then you can use count.

 

  Please go through the below link :

 

  https://docs.marklogic.com/guide/performance

 

 

  Regards,

  Asit Nautiyal

  --

  Date: Wed, 1 Jul 2015 10:11:01 +0800

  From: zisedeq...@163.com

  To: general@developer.marklogic.com

  Subject: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error

 

 

  when i execute the following xquery , marklogic throw an

  XDMP-EXPNTREECACHEFULL error:

  count(for $i in collection('test')/patient/link/visit/lab_report

  where $i /@report_date = '2010-09-25T00:00:00.000' and $i/@ report_date

  = '2014-09-25T00:00:00.000' and $i/@delete_flag = '0'

  return $i)

 

  I can not increase size of expanded tree cache, so what i can do to avoid

  the XDMP-EXPNTREECACHEFULL error while the query resturn the very large

  results

 

 

 

  ___ 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

 

 

 -- next part --

 An HTML attachment was scrubbed...

 URL: 
 http://developer.marklogic.com/pipermail/general/attachments/20150701/e5ad4c84/attachment-0001.html

 

 --

 

 Message: 2

 Date: Wed, 1 Jul 2015 13:46:50 +

 From: Dave Cassel dave.cas...@marklogic.com

 Subject: Re: [MarkLogic Dev General] how to update the attribute

Re: [MarkLogic Dev General] how to update the attribute of nodes?

2015-07-01 Thread Indrajeet Verma
If you want to update @language ='en' only, you can try this,

xdmp:node-replace(/catalog/product/name[@language = 'en']/@language,
attribute language {chinese})

On Wed, Jul 1, 2015 at 7:16 PM, Dave Cassel dave.cas...@marklogic.com
wrote:

   To Asit's point, if you need to make an update like this across a large
 number of documents, take a look at Corb2
 https://github.com/marklogic/corb2.

  --
 Dave Cassel http://davidcassel.net, @dmcassel
 https://twitter.com/dmcassel
 Technical Community Manager
 MarkLogic Corporation http://www.marklogic.com/
  http://developer.marklogic.com/


   From: Indrajeet Verma indrajeet.ve...@gmail.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Wednesday, July 1, 2015 at 1:21 AM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] how to update the attribute of nodes?

   Hi Zise,

  You can try below code as well,

  xdmp:node-replace(/catalog/product/name/@language, attribute language
 {chinese})

  Regards,
 Indy

 On Wed, Jul 1, 2015 at 10:37 AM, Asit Nautiyal asitnauti...@outlook.com
 wrote:

  Hi Zise,

  There are various ways to do this simple task. Find the below sample
 code :

  let $doc := fn:doc(/xmlFile.xml)
 let $oldNode := $doc/catalog/product/name[@language=en]
 let $newNode := element {fn:local-name($oldNode)} { attribute language {
 chinese}, $oldNode/text()}

  return xdmp:node-replace($oldNode,$newNode)

  Above code will work as expected. But, if your database size is very
 huge and you want to perform such update on entire database then use
 cts:queries for better performance.


  Regards,
 Asit Nautiyal

  --
 Date: Wed, 1 Jul 2015 11:50:02 +0800
 From: zisedeq...@163.com
 To: general@developer.marklogic.com
 Subject: [MarkLogic Dev General] how to update the attribute of nodes?


  the xml document is:
 catalog
  productdept=ACC
  number
  443
  /number
  namelanguage=en
  Deluxe Travel Bag
  /name
  /product
  /catalog

  I want to update the attirbute language of node name to new value,
 after update operation, the name node is:
 namelanguage=chinese
  Deluxe Travel Bag
  /name

  which function can do this in marklogic 8.0?



  ___ 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] XDMP-EXPNTREECACHEFULL error

2015-06-30 Thread Indrajeet Verma
In Addition of Asit response,

You should go with cts:element-values() and you should create cts:and-query
and inside it cts:range-query for the dates and flag.

Create range index for lab_report, report_date and delete_flag.

Let me know if you want any help in creating query.

Regards,
Indy

On Wed, Jul 1, 2015 at 10:45 AM, Asit Nautiyal asitnauti...@outlook.com
wrote:

 Hi Zise,

 By observing below code, it will hit performance for sure and that's why
 your are getting XDMP-EXPNTREECACHEFULL error.
 To avoid XDMP-EXPNTREECACHEFULL error you have to tune your code. Use
 cts:queries (like range queries and others) to get your result first and
 then you can use count.

 Please go through the below link :

 https://docs.marklogic.com/guide/performance


 Regards,
 Asit Nautiyal
 --
 Date: Wed, 1 Jul 2015 10:11:01 +0800
 From: zisedeq...@163.com
 To: general@developer.marklogic.com
 Subject: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error


 when i execute the following xquery , marklogic throw an
 XDMP-EXPNTREECACHEFULL error:
 count(for $i in collection('test')/patient/link/visit/lab_report
 where $i /@report_date = '2010-09-25T00:00:00.000' and $i/@ report_date
 = '2014-09-25T00:00:00.000' and $i/@delete_flag = '0'
 return $i)

 I can not increase size of expanded tree cache, so what i can do to avoid
 the XDMP-EXPNTREECACHEFULL error while the query resturn the very large
 results



 ___ 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] how to update the attribute of nodes?

2015-06-30 Thread Indrajeet Verma
Hi Zise,

You can try below code as well,

xdmp:node-replace(/catalog/product/name/@language, attribute language
{chinese})

Regards,
Indy

On Wed, Jul 1, 2015 at 10:37 AM, Asit Nautiyal asitnauti...@outlook.com
wrote:

 Hi Zise,

 There are various ways to do this simple task. Find the below sample code :

 let $doc := fn:doc(/xmlFile.xml)
 let $oldNode := $doc/catalog/product/name[@language=en]
 let $newNode := element {fn:local-name($oldNode)} { attribute language {
 chinese}, $oldNode/text()}

 return xdmp:node-replace($oldNode,$newNode)

 Above code will work as expected. But, if your database size is very huge
 and you want to perform such update on entire database then use cts:queries
 for better performance.


 Regards,
 Asit Nautiyal

 --
 Date: Wed, 1 Jul 2015 11:50:02 +0800
 From: zisedeq...@163.com
 To: general@developer.marklogic.com
 Subject: [MarkLogic Dev General] how to update the attribute of nodes?


 the xml document is:
 catalog
 product dept=ACC
 number
 443
 /number
 name language=en
 Deluxe Travel Bag
 /name
 /product
 /catalog

 I want to update the attirbute language of node name to new value, after
 update operation, the name node is:
 name language=chinese
 Deluxe Travel Bag
 /name

 which function can do this in marklogic 8.0?



 ___ 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] Convert element text to node in XSL

2015-06-30 Thread Indrajeet Verma
Hi Gary,

Will that work for you OR do you expect anything else?

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:xs=http://www.w3.org/2001/XMLSchema;
exclude-result-prefixes=xs version=2.0
   xsl:template match=/
   xsl:apply-templates/
   /xsl:template

xsl:template match=advancedSettings
xsl:apply-templates/
/xsl:template

xsl:template match=value
xsl:value-of select=. disable-output-escaping=yes/
/xsl:template
/xsl:stylesheet

OR

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:xs=http://www.w3.org/2001/XMLSchema;
exclude-result-prefixes=xs version=2.0

xsl:template match=advancedSettings
xsl:value-of select=value disable-output-escaping=yes/
/xsl:template

/xsl:stylesheet

Output:

settingssetting name=asv.preview.maxRows450/setting/settings

Regards,
Indy

On Tue, Jun 30, 2015 at 11:06 PM, Gary Larsen gary.lar...@envisn.com
wrote:

 Thanks Rob,



 Is there something I can use in XSL?   Although maybe I can preprocess the
 document before sending to the stylesheet,



 Gary Larsen

 Envisn Inc.

 508 259-6465



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Rob Szkutak
 *Sent:* Tuesday, June 30, 2015 1:29 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Convert element text to node in XSL



 Here you go:



 xquery version 1.0-ml;



 let $doc :=

 advancedSettings

 valuelt;settingsgt;lt;setting
 name=asv.preview.maxRowsgt;450lt;/settinggt;lt;/settingsgt;/value

 /advancedSettings



 let $convert := xdmp:unquote(xdmp:url-decode($doc/value/text()))



 return

   $convert//setting





 Best,

 Rob



 Rob Szkutak

 Associate Consultant

 MarkLogic Corporation

 rob.szku...@marklogic.com

 Cell +1.716.562.8464

 www.marklogic.com


 --

 *From:* general-boun...@developer.marklogic.com [
 general-boun...@developer.marklogic.com] on behalf of Gary Larsen [
 gary.lar...@envisn.com]
 *Sent:* Tuesday, June 30, 2015 12:27 PM
 *To:* 'General MarkLogic Developer Discussion'
 *Subject:* [MarkLogic Dev General] Convert element text to node in XSL

 Hope this isn’t too off topic.  In an XML document the value element
 contains and encoded XML string. I would like to parse this to a node in
 XSL for further processing.

 advancedSettings
 valuelt;settingsgt;lt;setting
 name=asv.preview.maxRowsgt;450lt;/settinggt;lt;/settingsgt;/value
 /advancedSettings

 Is this possible?

 Thanks,
 Gary



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


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


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

2015-06-29 Thread Indrajeet Verma
Geert,

I was looking into the difference between eq and = in MarkLogic and found
one article and it says in the 1.0-ml version of XQuery, there's no
difference in behavior. eq behaves the same as =, etc. for more
information please refer 
https://developer.marklogic.com/blog/comparison-operators-whats-the-difference


Are you referring the same of some other issue of =/eq?

Regards,
Indy


On Mon, Jun 29, 2015 at 1:46 PM, Geert Josten geert.jos...@marklogic.com
wrote:

  Replacing = with eq also works. I’ll file a bug, this is odd behavior..

  Cheers

   From: Asit Nautiyal asitnauti...@outlook.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Monday, June 29, 2015 at 9:25 AM
 To: MarkLogic Developer Discussion general@developer.marklogic.com

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

   Hi Raja,

  That's what i wrote in my first reply, code will work with predicate[ ].


  Regards,
 Asit Nautiyal

  --
 From: rajamani.marimu...@cognizant.com
 To: general@developer.marklogic.com
 Date: Mon, 29 Jun 2015 07:22:43 +
 Subject: Re: [MarkLogic Dev General] Can anyone tell me why the result of
 the second xqery is empy?

  Hi All,



 Below options  also working .



 for $i in collection(test)/catalog/product[@dept = WMN]/name

 return $i,



 for $i in collection('test')/catalog/product/name



 return $i[../@dept = WMN]



 By

 Raja 



 *From:* general-boun...@developer.marklogic.com [
 mailto:general-boun...@developer.marklogic.com
 general-boun...@developer.marklogic.com] *On Behalf Of *Asit Nautiyal
 *Sent:* Monday, June 29, 2015 12:37 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] Can anyone tell me why the result
 of the second xqery is empy?



 Hi Geert,



 Below code is working fine, if we are assigning xml document in a
 variable, as you are doing.



  for $i in $xml/catalog/product/name

 where $i/../@dept = 'WMN'

 return $i


 But, while using collection (retrieving document from MarkLogic
 collection) above code won't work.



 It is working with below code :



 for $i in collection('SAMPLE')/catalog/product/name

 where $i/..[@dept = 'WMN']

 return $i



 Regards,

 Asit Nautiyal
  --

 From: geert.jos...@marklogic.com
 To: general@developer.marklogic.com
 Date: Mon, 29 Jun 2015 06:58:38 +
 Subject: Re: [MarkLogic Dev General] Can anyone tell me why the result of
 the second xqery is empy?

 This works just fine for me:



 let $xml := document{

 catalog

 product dept=WMN

 number557/number

 name language=enFleece Pullover/name

 colorChoicesnavy black/colorChoices

 /product

 product dept=ACC

 number563/number

 name language=enFloppy Sun Hat/name

 /product

 product dept=ACC

 number443/number

 name language=enDeluxe Travel Bag/name

 /product

 product dept=MEN

 number784/number

 name language=enCotton Dress Shirt/name

 colorChoiceswhite gray/colorChoices

 descOur ifavorite/i shirt!/desc

 /product

 /catalog

 }

 return (

 for $i in $xml/catalog/product

 where $i/@dept = 'WMN'

 return $i/name,



 for $i in $xml/catalog/product/name

 where $i/../@dept = 'WMN'

 return $i

 )



 I am getting Fleece Pullover twice..



 Cheers,

 Geert



 *From: *张晓博 zisedeq...@163.com
 *Reply-To: *MarkLogic Developer Discussion 
 general@developer.marklogic.com
 *Date: *Monday, June 29, 2015 at 3:25 AM
 *To: *general@developer.marklogic.com general@developer.marklogic.com
 *Subject: *[MarkLogic Dev General] Can anyone tell me why the result of
 the second xqery is empy?



 There is one XML document stored in my database, the content of the XML
 document is:

 catalog

 product dept=WMN

 number557/number

 name language=enFleece Pullover/name

 colorChoicesnavy black/colorChoices

 /product

 product dept=ACC

 number563/number

 name language=enFloppy Sun Hat/name

 /product

 product dept=ACC

 number443/number

 name language=enDeluxe Travel Bag/name

 /product

 product dept=MEN

 number784/number

 name language=enCotton Dress Shirt/name

 colorChoiceswhite gray/colorChoices

 descOur ifavorite/i shirt!/desc

 /product

 /catalog



 when i execute the follow xquery :

 for $i in collection('http://marklogic.com/xdmp/test')/catalog/product

 where $i/@dept = 'WMN'

 return $i/name;

 the result is:

 namelanguage=en

 Fleece Pullover

 /name

 But, if i use the follow xquery to do the same thing, the result will be
 

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

2015-06-28 Thread Indrajeet Verma
Hi Zise,

Use below query to avoid any loop or don't want any order by,

collection('http://marklogic.com/xdmp/test')/catalog/product[@dept =
'WMN']/name

However I would suggest to use of cts queries for the better response time.

Regards,
Indy

On Mon, Jun 29, 2015 at 11:18 AM, Asit Nautiyal asitnauti...@outlook.com
wrote:

 Hi Zise,

 Use the predicate in where condition. Please find the below code :


 for $i in collection('SAMPLE')/catalog/product/name
 where $i/..[@dept = 'WMN']
 return $i


 Regards,
 Asit Nautiyal
 --
 Date: Mon, 29 Jun 2015 09:25:48 +0800
 From: zisedeq...@163.com
 To: general@developer.marklogic.com
 Subject: [MarkLogic Dev General] Can anyone tell me why the result of the
 second xqery is empy?

 There is one XML document stored in my database, the content of the XML
 document is:
 catalog
 product dept=WMN
 number557/number
 name language=enFleece Pullover/name
 colorChoicesnavy black/colorChoices
 /product
 product dept=ACC
 number563/number
 name language=enFloppy Sun Hat/name
 /product
 product dept=ACC
 number443/number
 name language=enDeluxe Travel Bag/name
 /product
 product dept=MEN
 number784/number
 name language=enCotton Dress Shirt/name
 colorChoiceswhite gray/colorChoices
 descOur ifavorite/i shirt!/desc
 /product
 /catalog

 when i execute the follow xquery :
 for $i in collection('http://marklogic.com/xdmp/test')/catalog/product
 where $i/@dept = 'WMN'
 return $i/name;
 the result is:
 name language=en
 Fleece Pullover
 /name
 But, if i use the follow xquery to do the same thing, the result will be
 empty

 for $i in collection('
 http://marklogic.com/xdmp/test')/catalog/product/name
 where $i/../@dept = 'WMN'
 return $i;

 Can anyone tell me why the result of second xqery is empy?



 ___ 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] cts query question

2015-06-26 Thread Indrajeet Verma
Hi Chunyu,

Cts:element-query does,

Returns a cts:query matching elements by name with the content constrained
by the given cts:query in the second parameter. Searches for matches
in the *specified
element and all of its descendants.* If the specified query in the second
parameter has any cts:element-attribute-*-query constructors, it will
search attributes directly on the specified element and attributes on any
descendant elements (see thesecond example
https://docs.marklogic.com/cts:element-query?print=yes#eq2 below)

Yes other searches in the specified element.

Regards,
Indy

On Fri, Jun 26, 2015 at 2:42 PM, Chunyu Cong congchu...@gmail.com wrote:

 Hello,

 I read through the following cts query functions and etc.

 Can I say only cts:element-query looks up itself and descendent children
 by default?


 All the other functions are only search itself element with its text()
 node by default.

 cts:element-value-query
 cts:element-word-query
 cts:element-word-match
 ...

 Thanks,
 Chunyu

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


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


Re: [MarkLogic Dev General] MarkLogic Database size per collection

2015-06-24 Thread Indrajeet Verma
Hi Vishal,

In addition to link shared by Asit, go through
https://developer.marklogic.com/pubs/architecture/inside-marklogic-server-r7.pdf
the link as well.

Though there are a lot of things to make system faster however in the
starting of your project, I would suggest, you should focus on the data
modelling and appropriate number of forests based on your infrastructure as
well.

Collection has not any constraint on the data size however you should
consider collections based on your requirement/data type.

Like for storing history type data, you can consider a separate collection
and for users a separate collection, separate for the searchable documents,
and separate for binary documents etc...

Regards,
Indy


On Wed, Jun 24, 2015 at 10:52 AM, Asit Nautiyal asitnauti...@outlook.com
wrote:

 Hi Vishal,

 Please go through the below link

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

 And there no restriction on collection size. All documents belongs to a
 collection are stored into disk. So, disk size matters as per data size.


 Regards,
 Asit Nautiyal

  From: vtahili...@fdbhealth.com
  To: general@developer.marklogic.com
  Date: Tue, 23 Jun 2015 19:52:15 +
  Subject: [MarkLogic Dev General] MarkLogic Database size per collection

 
  I am currently researching MarkLogic Database Size. Currently in the
 development database we have indexed around 78000 documents. The current
 size of the database is 424 MB. In future we will have at least 2 million
  Document. So I applied below formula to get the database size for
 indexing 2 million documents
 
  Future storage : (424 / 78000) * 200= 11 GB (approx.).
 
  So as per above formulation max storage of 25 GB is needed.
 
  I would like to know whether the above formula is the correct to
 approximate database size?
 
  Also I would like whether I have to take into consideration collection
 size also. Are there any size constraints on collections?
 
 
  Vishal Tahiliani
  Senior IT Consultant
  FDB (First Databank, Inc.)
  Direct: 317.571.7239
  vtahili...@fdbhealth.com
 
 
 
  --
   This e-mail message is intended only for the personal use of the
  recipient(s) named above. If you are not an intended recipient, you
  may not review, copy or distribute this message. If you have received
  this communication in error, please notify FDB Support
  (c...@fdbhealth.com) immediately by e-mail and delete the
  original message.
  --
 
  ___
  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] TaskServer: state is already successor so not updating for /alerts/email/15835948930718685389.xml

2015-06-16 Thread Indrajeet Verma
Hi Mary,

We have tried by changing the state even this does not work. Now states are
different. please see below. Could you please suggest, what could be the
issue?

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

*on success*

http://marklogic.com/states/sent



*on failure*

http://marklogic.com/states/error



*when*

/MarkLogic/cpf/actions/mimetype-condition.xqy (mime-type=text/xml)

*do*

/app/lib/actions/delete.xqy



To



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

*on success*

*http://marklogic.com/states/finished
http://marklogic.com/states/finished*



*on failure*

http://marklogic.com/states/error



*when*

/MarkLogic/cpf/actions/mimetype-condition.xqy (mime-type=text/xml)

*do*

/app/lib/actions/delete.xqy


Regards,
Indy
On Thu, Jun 4, 2015 at 8:15 PM, Mary Holstege mary.holst...@marklogic.com
wrote:


 On 06/04/2015 07:20 AM, Christopher Hamlin wrote:
  Hi,
 
  This happens on success, when the next state is the same as the old
 state.
 
  In your pipeline I see:
 
 state-transition
   statehttp://marklogic.com/states/sent/state
   on-successhttp://marklogic.com/states/sent/on-success
 
  Perhaps this is what is happening:  when it is in sent, and succeeds,
  it tries to move to sent, and so just doesn't move.
 
  Not sure why this would be different after upgrade, but could be an
  extra guard that was added (or, just an extra notification)?

 Yes, since CPF is trigger based, there are race conditions that can
 arise between competing triggers and the CPF code has a lot of checks to
 prevent this from causing trouble. (This is what the
 cpf:check-transition is doing for you.)  The warning messages are
 telling you that maybe you have two pipelines or domains that are
 competing with each other. This is very bad, as it leads to
 unpredictable results.

 In pipelines the states where work actually happens should have a
 transition definition for them and the terminal states should not. It is
 a little unwise to use the same state name for both the state before
 something is sent and for when it has been sent, as a query of the
 states cannot distinguish them. That is, knowing a document is in state
 http://marklogic.com/states/sent; doesn't tell you whether it is about
 to be sent or has been sent. Having the pipeline defined as you do where
 you loop back to the same state will work (if you're willing to overlook
 the warnings) but I'd recommend renaming one or the other of these states.

 //Mary

 Aside: You can name the states anything you want, by the way, they don't
 have to start with http://marklogic.com/states/;. That is just our
 convention for our own states. You can use any URI you like.

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


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

2015-06-04 Thread Indrajeet Verma
Hi,

We have alert configured in our server and when any file inserts into
/alert/email/file-name the email sent to specified user.

However after upgrading ML from 6 to 8, the below messages started coming

TaskServer: state is already successor so not updating for
/alerts/email/15835948930718685389.xml

The file name is unique and it can not be same any time.

Could somebody help to resolve this.?

I am attaching pipeline for the reference.

Regards,
Indy
?xml version=1.0 encoding=UTF-8?
pipeline xmlns=http://marklogic.com/cpf/pipelines;
  pipeline-nameEmail Alert Pipeline/pipeline-name
  pipeline-descriptionPipeline to send email alert messages/pipeline-description
  success-action
module/MarkLogic/cpf/actions/success-action.xqy/module
  /success-action
  failure-action
module/MarkLogic/cpf/actions/failure-action.xqy/module
  /failure-action
  state-transition
statehttp://marklogic.com/states/initial/state
on-successhttp://marklogic.com/states/sent/on-success
on-failurehttp://marklogic.com/states/error/on-failure
execute
  condition
module/MarkLogic/cpf/actions/mimetype-condition.xqy/module
options xmlns=/MarkLogic/cpf/actions/mimetype-condition.xqy
  mime-typetext/xml/mime-type
/options
  /condition
  action
module/app/lib/actions/send.xqy/module
  /action
/execute
  /state-transition
  state-transition
statehttp://marklogic.com/states/sent/state
on-successhttp://marklogic.com/states/sent/on-success
on-failurehttp://marklogic.com/states/error/on-failure
execute
  condition
module/MarkLogic/cpf/actions/mimetype-condition.xqy/module
options xmlns=/MarkLogic/cpf/actions/mimetype-condition.xqy
  mime-typetext/xml/mime-type
/options
  /condition
  action
module/app/lib/actions/delete.xqy/module
  /action
/execute
  /state-transition
/pipeline
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Mount Db error while ML upgrade from 6 to 8

2015-06-04 Thread Indrajeet Verma
Hi,

Please help me if somebody has faced below issue while upgrading ML from 6
to 8.

This forest is unavailable due to the following error:
XDMP-FORESTERR: Error in startup of forest FilingsTool-Content:
XDMP-RECOVERY: Recovery error on forest FilingsTool-Content after 27697
redo records -- {{fsn=631207, chksum=0xacd80f40, words=1837}, op=insert,
time=1430744401, mfor=4421201772788570268, mtim=1416568023807,
mfsn=631207, fmcl=17422642808301536264, fmf=4421201772788570268,
fmt=1416568023807, fmfsn=631207, sk=3735405548654489927}
XDMP-FORESTNOT: Forest FilingsTool-Content not available: XDMP-FORESTERR:
Error in merge of forest FilingsTool-Content: XDMP-BAD: Bad expr index

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


Re: [MarkLogic Dev General] XDMP:BADPINAME while doing an xdmp:unquote

2015-06-03 Thread Indrajeet Verma
Hi Raghu,

Can you send the content for which you are doing xdmp:unquote(). It seems
some issues related to processing instructions that are inside content.

Regards,
Indy
:

On Wed, Jun 3, 2015 at 7:36 PM, Raghu raghupathy.visweswa...@gmail.com
wrote:

 Hi all,



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


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


Re: [MarkLogic Dev General] query on xml

2015-05-15 Thread Indrajeet Verma

 b/b -- Law

 c/c --- LEI

 result

 /result



 Am not able to understand , because in below xml also you have only two
 combinations . IS name element is mandatory?



 Thanks and regards

 Raja 



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Kapoor, Pragya
 *Sent:* Friday, May 15, 2015 9:35 AM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] query on xml



 Thanks Indy.

 But, The input result could have 'n' number of dynamic elements.
   --

 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of Indrajeet Verma 
 indrajeet.ve...@gmail.com
 *Sent:* Thursday, May 14, 2015 6:16 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] query on xml



 Pragya,



 See if below code works for you.



 If your input result can contain only two elements combination, Try
 below code changes in Raja's code,



 declare function local:transform($result as node()){



 let $elements := fn:distinct-values($result/child::*/name(.))

 for $token_one in $result/*[name(.) eq ($elements)[1]], $token_two in
 $result/*[name(.) eq ($elements)[2]]

 return result{($token_one,$token_two)}/result

 };





 Regards,

 Indy



 On Thu, May 14, 2015 at 4:42 PM, Kapoor, Pragya pkapo...@innodata.com
 wrote:

 Yes Raja, I mean two or more elements other than name and law.



 So my input xml could be:



 results

 result

 Namethg/Name

 LEIrty/LEI

 /result

 result

 Namegux/Name

 LEIrty/LEI

 /result

 result

 Nameabc/Name

 Namexyz/Name

 Namecde/Name

 ​LEIfgd/LEI

 /result

 /results​


   --

 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of
 rajamani.marimu...@cognizant.com rajamani.marimu...@cognizant.com
 *Sent:* Thursday, May 14, 2015 3:05 PM


 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] query on xml



 Hi Pragya,



 You meant, you will get some other  element than “ name” and “Law” ? If
 that is not a case and will get these two elements with different count
 then will use the same code.



 Thanks and regards

 Raja 



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Kapoor, Pragya
 *Sent:* Thursday, May 14, 2015 2:56 PM
 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] query on xml



 Thanks for the solution, but as mentioned in my previous mail,

 the elements in input xml are dynamic, so I cant use



 for $name in $result/Name, $law in $result/Law

 return result{($name,$law)}/result​



 Thanks

 Pragya


   --

 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of
 rajamani.marimu...@cognizant.com rajamani.marimu...@cognizant.com
 *Sent:* Thursday, May 14, 2015 1:39 PM
 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] query on xml



 Hi Pragya,



 Following code should give the expected result ,

 xquery version 1.0-ml;

 declare namespace html = http://www.w3.org/1999/xhtml;;



 declare function local:transform($result as node()){



 for $name in $result/Name, $law in $result/Law

 return result{($name,$law)}/result



 };

 let $data := results

 result

 Namethg/Name

 Namerty/Name

 LawEngland and Wales/Law

 LawLatvia/Law

 /result

 result

 Namegux/Name

 LawIndia/Law

 /result

 result

 Nameabc/Name

 Namexyz/Name

 Namecde/Name

 LawEngland/Law

 /result

 /results



 let $result :=results{ for $result in $data/result

   return local:transform($result)

   }/results

 return $result



 Thanks and regards

 Raja 





 *From:* general-boun...@developer.marklogic.com [
 mailto:general-boun...@developer.marklogic.com
 general-boun...@developer.marklogic.com] *On Behalf Of *Kapoor, Pragya
 *Sent:* Thursday, May 14, 2015 1:05 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* [MarkLogic Dev General] query on xml



 Hi,



 I need to convert the below input to the desired output.

 The elements in the input xml is dynamic(it could be one
 element,two,three n so on, not fixed).



 Input:





 results

 result

 Namethg/Name

 Namerty/Name

 LawEngland and Wales/Law

 LawLatvia/Law

 /result

 result

 Namegux/Name

 LawIndia/Law

 /result

 result

 Nameabc/Name

 Namexyz/Name

 Namecde/Name

 LawEngland/Law

 /result

 /results​



 desired output:



 results

 result

 Namethg/Name

Re: [MarkLogic Dev General] query on xml

2015-05-14 Thread Indrajeet Verma
Pragya,

See if below code works for you.

If your input result can contain only two elements combination, Try below
code changes in Raja's code,

declare function local:transform($result as node()){

let $elements := fn:distinct-values($result/child::*/name(.))
for $token_one in $result/*[name(.) eq ($elements)[1]], $token_two in
$result/*[name(.) eq ($elements)[2]]
return result{($token_one,$token_two)}/result
};


Regards,
Indy

On Thu, May 14, 2015 at 4:42 PM, Kapoor, Pragya pkapo...@innodata.com
wrote:

  Yes Raja, I mean two or more elements other than name and law.


  So my input xml could be:


   results

 result

 Namethg/Name

 LEIrty/LEI

 /result

 result

 Namegux/Name

 LEIrty/LEI

 /result

 result

 Nameabc/Name

 Namexyz/Name

 Namecde/Name

 ​LEIfgd/LEI

 /result

 /results​


  --
 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of
 rajamani.marimu...@cognizant.com rajamani.marimu...@cognizant.com
 *Sent:* Thursday, May 14, 2015 3:05 PM

 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] query on xml


 Hi Pragya,



 You meant, you will get some other  element than “ name” and “Law” ? If
 that is not a case and will get these two elements with different count
 then will use the same code.



 Thanks and regards

 Raja 



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Kapoor, Pragya
 *Sent:* Thursday, May 14, 2015 2:56 PM
 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] query on xml



 Thanks for the solution, but as mentioned in my previous mail,

 the elements in input xml are dynamic, so I cant use



 for $name in $result/Name, $law in $result/Law

 return result{($name,$law)}/result​



 Thanks

 Pragya


   --

 *From:* general-boun...@developer.marklogic.com 
 general-boun...@developer.marklogic.com on behalf of
 rajamani.marimu...@cognizant.com rajamani.marimu...@cognizant.com
 *Sent:* Thursday, May 14, 2015 1:39 PM
 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] query on xml



 Hi Pragya,



 Following code should give the expected result ,

 xquery version 1.0-ml;

 declare namespace html = http://www.w3.org/1999/xhtml;;



 declare function local:transform($result as node()){



 for $name in $result/Name, $law in $result/Law

 return result{($name,$law)}/result



 };

 let $data := results

 result

 Namethg/Name

 Namerty/Name

 LawEngland and Wales/Law

 LawLatvia/Law

 /result

 result

 Namegux/Name

 LawIndia/Law

 /result

 result

 Nameabc/Name

 Namexyz/Name

 Namecde/Name

 LawEngland/Law

 /result

 /results



 let $result :=results{ for $result in $data/result

   return local:transform($result)

   }/results

 return $result



 Thanks and regards

 Raja 





 *From:* general-boun...@developer.marklogic.com [
 mailto:general-boun...@developer.marklogic.com
 general-boun...@developer.marklogic.com] *On Behalf Of *Kapoor, Pragya
 *Sent:* Thursday, May 14, 2015 1:05 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* [MarkLogic Dev General] query on xml



 Hi,



 I need to convert the below input to the desired output.

 The elements in the input xml is dynamic(it could be one element,two,three
 n so on, not fixed).



 Input:





 results

 result

 Namethg/Name

 Namerty/Name

 LawEngland and Wales/Law

 LawLatvia/Law

 /result

 result

 Namegux/Name

 LawIndia/Law

 /result

 result

 Nameabc/Name

 Namexyz/Name

 Namecde/Name

 LawEngland/Law

 /result

 /results​



 desired output:



 results

 result

 Namethg/Name

 LawEngland and Wales/Law/result

 result

 Namethg/Name

 LawLatvia/Law/result

 result

 Namerty/Name

 LawEngland and Wales/Law​/result

 result

 Namerty/Name

 LawLatvia/Law​/result

 result

 Namegux/Name

 LawIndia/Law

 /result

 result

 Nameabc/Name

 LawEngland/Law

 /result

 result

 Namexyz/Name

 LawEngland/Law

 /result

 result

 Namecde/Name

 LawEngland/Law

 /result

 /results​



 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,
 

Re: [MarkLogic Dev General] Forest Warning

2015-05-11 Thread Indrajeet Verma
Hi Wayne,

Thank your for correcting me however I was just suggesting some options to
improve performance after solving that issue as he said, he is only one
forest in the DB with TB data.

Regards,
Indy

On Mon, May 11, 2015 at 11:57 PM, Wayne Feick wayne.fe...@marklogic.com
wrote:

  Creating more forests won't help, because they'll all have the same
 in-memory limits and the rebalancer will run into the same issue as the
 reindexer if it tries to move the document to a different forest.

 Wayne.



 On 05/11/2015 11:18 AM, Indrajeet Verma wrote:

  Shashi,

  I am sure, this file size must be large.

  This is not good that you have created only one forest. There should be
 more than that. I would recommend around 8-10 forests.

  However these should be based on core of CPUs. per 2 core 1 forest but
 if your server is having 32 cores, 8-10 forest should be sufficient. Please
 correct somebody if I am wrong.

  As per my understanding you should to do following things to solve your
 problem,

  1. Delete this large file size. I would not recommend to increase memory
 size just for the heck. Your performance will be degraded.

  2. Create more forest and attach to the database. if you are using 7+,
 this automatically re-balance the data.

  3. After re-balancing the content, you might perform manual merge to
 claim memory immediately.

  3. Split your files into smaller size

  Regards,
 Indy


 On Mon, May 11, 2015 at 11:30 PM, Wayne Feick wayne.fe...@marklogic.com
 wrote:

  Looping in some additional information from private email. Since your
 list size is already configured to the maximum (32768), you could try to
 identify some index settings that you don't actually need and turn them off.

 If that isn't an option, you could try breaking it up into multiple
 documents, and then deleting the original document with
 xdmp:document-delete().

 Wayne.



 On 05/11/2015 10:52 AM, Wayne Feick wrote:

 Hi Shashidhar,

 It sounds like the document was close to the limit when it was originally
 ingested, and that turning on additional index setting put it over the top.

 The error message says that your in-memory list storage is full, so if
 you go to the Admin UI and look at the database settings, you'll see an
 entry for in memory list size. Configure a larger value there and you
 should be able to finish your reindex.

 Wayne.


 On 04/23/2015 01:28 AM, Shashidhar Rao wrote:

  Hi,

  Can somebody help me how to fix this issue

  There is currently an XDMP-FORESTERR: Error in reindex of forest
 PROD_DB_1: XDMP-REINDEX: Error reindexing
 fn:doc(/home/data/Folder2/US07625699-20091201-T2.XML):
 XDMP-FRAGTOOLARGE: Fragment of
 /home/data/Folder2/US07625699-20091201-T2.XML too large for in-memory
 storage: XDMP-INMMLISTFULL: In-memory list storage full; list: table=100%,
 wordsused=50%, wordsfree=25%, overhead=25%; tree: table=0%, wordsused=6%,
 wordsfree=94%, overhead=0% exception. Information on this page may be
 missing.

 It says US07625699-20091201-T2.XML too large.
  what are the other options any suggestions would be helpful.

  Is deleting this file an option as the last resort?

  Thanks



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


 --
 Wayne Feick
 Principal Engineer
 MarkLogic corporationwayne.fe...@marklogic.com
 Phone: +1 650 655 2378www.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.



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


 --
 Wayne Feick
 Principal Engineer
 MarkLogic corporationwayne.fe...@marklogic.com
 Phone: +1 650 655 2378www.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.


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




 ___
 General mailing listgene...@developer.marklogic.com

Re: [MarkLogic Dev General] XDMP-FRAGTOOLARGE

2015-05-11 Thread Indrajeet Verma
Shashi,

I think you should see your logic of splitting/loading of the XML document.
What method/tool are you using to ingest content (mlcp and recordloader
etc...) You can write your logic to split files based on a element which
you want to create a root element.

Also please take a look the suggestions of the journal size that Geert has
suggested.

I am sure there is some problem in your ingestion and XML size otherwise
default configurations also works without any issues. of-course later you
can optimize them if needed.

Also you should see on your number of forests otherwise you can not show
the actual power of ML to your customer. (mainly search performance and Big
Data management etc..)

Records,
Indy


Regards,
Indy


On Mon, May 11, 2015 at 11:49 PM, Geert Josten geert.jos...@marklogic.com
wrote:

  Hi Shashidhar,

  I’m wondering how large the original file was, probably not 32gb. I’m
 also wondering how it ended up getting inserted without trouble. Almost as
 if memory values have been tuned down afterwards.

  I’d decrease memory list size to a more reasonable value, and instead
 take a look at in memory tree size as well. It is also suggested to keep
 journal size larger than list size + tree size at minimum.

  You could of course delete the file, that should just work, but I can’t
 judge whether the file contains valuable information or not.

  It is also suggested to split that file into smaller parts. Best to do
 that at ingest time, but if that is not an option, fragmentation might help
 here. But word of warning fragmentation also influences how queries behave,
 and have some other side effects as well. We typically recommend against
 it..

  Kind regards,
 Geert

   From: Shashidhar Rao raoshashidhar...@gmail.com
 Date: Monday, May 11, 2015 at 6:52 PM
 To: Geert Josten geert.jos...@marklogic.com
 Subject: XDMP-FRAGTOOLARGE

Hi Geert,

  I am getting this error. I tried posting but not getting any replies.

  Can you suggest anything to resolve this error.


 There is currently an XDMP-FORESTERR: Error in reindex of forest
 PROD_DB_1: XDMP-REINDEX: Error reindexing
 fn:doc(/home/data/TD078999.XML):
 XDMP-FRAGTOOLARGE: Fragment of /home/data/TD078999.XML too large for
 in-memory storage:
 : In-memory list storage full; list: table=100%, wordsused=50%,
 wordsfree=25%,
 overhead=25%; tree: table=0%, wordsused=6%, wordsfree=94%, overhead=0%
 exception. Information on this page may be missing.

 Any suggestion on how to resolve this error?

 My in memory list is 32699MB

  How can I increase this value or can I delete this file?

  Please help

  Thanks

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


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


Re: [MarkLogic Dev General] Forest Warning

2015-05-11 Thread Indrajeet Verma
Shashi,

I am sure, this file size must be large.

This is not good that you have created only one forest. There should be
more than that. I would recommend around 8-10 forests.

However these should be based on core of CPUs. per 2 core 1 forest but if
your server is having 32 cores, 8-10 forest should be sufficient. Please
correct somebody if I am wrong.

As per my understanding you should to do following things to solve your
problem,

1. Delete this large file size. I would not recommend to increase memory
size just for the heck. Your performance will be degraded.

2. Create more forest and attach to the database. if you are using 7+, this
automatically re-balance the data.

3. After re-balancing the content, you might perform manual merge to claim
memory immediately.

3. Split your files into smaller size

Regards,
Indy


On Mon, May 11, 2015 at 11:30 PM, Wayne Feick wayne.fe...@marklogic.com
wrote:

  Looping in some additional information from private email. Since your
 list size is already configured to the maximum (32768), you could try to
 identify some index settings that you don't actually need and turn them off.

 If that isn't an option, you could try breaking it up into multiple
 documents, and then deleting the original document with
 xdmp:document-delete().

 Wayne.



 On 05/11/2015 10:52 AM, Wayne Feick wrote:

 Hi Shashidhar,

 It sounds like the document was close to the limit when it was originally
 ingested, and that turning on additional index setting put it over the top.

 The error message says that your in-memory list storage is full, so if you
 go to the Admin UI and look at the database settings, you'll see an entry
 for in memory list size. Configure a larger value there and you should be
 able to finish your reindex.

 Wayne.


 On 04/23/2015 01:28 AM, Shashidhar Rao wrote:

  Hi,

  Can somebody help me how to fix this issue

  There is currently an XDMP-FORESTERR: Error in reindex of forest
 PROD_DB_1: XDMP-REINDEX: Error reindexing
 fn:doc(/home/data/Folder2/US07625699-20091201-T2.XML):
 XDMP-FRAGTOOLARGE: Fragment of
 /home/data/Folder2/US07625699-20091201-T2.XML too large for in-memory
 storage: XDMP-INMMLISTFULL: In-memory list storage full; list: table=100%,
 wordsused=50%, wordsfree=25%, overhead=25%; tree: table=0%, wordsused=6%,
 wordsfree=94%, overhead=0% exception. Information on this page may be
 missing.

 It says US07625699-20091201-T2.XML too large.
  what are the other options any suggestions would be helpful.

  Is deleting this file an option as the last resort?

  Thanks



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


 --
 Wayne Feick
 Principal Engineer
 MarkLogic corporationwayne.fe...@marklogic.com
 Phone: +1 650 655 2378www.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.



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


 --
 Wayne Feick
 Principal Engineer
 MarkLogic corporationwayne.fe...@marklogic.com
 Phone: +1 650 655 2378www.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.


 ___
 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] json namespace changes in json:transform-from-json($input)

2015-05-05 Thread Indrajeet Verma
Hi David,

I have modified the condition like below in router.xqy itself from where
data is being set in map:map and now this is working fine without changing
in the code above. Hope this should be fine and better solution :)

else if (xdmp:get-request-body()/node() instance of object-node()) then
xdmp:to-json(xdmp:get-request-body()/node())/node()
else ()
Complete condition in router.xqy-

if (fn:exists(xdmp:get-request-body())) then
(

map:put($req:request, req-body,
if (xdmp:get-request-body()/node() instance of element()) then
xdmp:get-request-body()/node()
else if (xdmp:get-request-body()/node() instance of text()) then
xdmp:quote(xdmp:get-request-body()/node())
else if (xdmp:get-request-body()/node() instance of object-node()) then
xdmp:to-json(xdmp:get-request-body()/node())/node()
else ()
)
)

On Tue, May 5, 2015 at 2:22 PM, Indrajeet Verma indrajeet.ve...@gmail.com
wrote:

 Hi David,

 Thank you for explaining all the things. I went through the documentation
 that you have shared with me again.

 What I understand, my code could be fixed in following two ways,

 1. First convert JOSN object to string format however the jsonLib:parse()
 is not accepting the value that returns from xdmp:to-json($params)/node().
 It says, this is not a string and If I apply xdmp:quote(), this starts
 working with existing code that requires xs:string as input. The 
 json:transform-to-json()
 is not working however logically this should as based on the documentation,
 this also returns xs:string and take json as object. I want input json as
 xs:string for my function.

   let $params := xdmp:get-request-body()
   let $json := xdmp:to-json($params)/node()
   let $json := try{ jsonLib:parse(xdmp:quote($json)) } catch ($e)
 {xdmp:log($json)} (: doing xdmp:quote() is strange here as
 xdmp:to-json()/node() returns string itself.:)

 2. Using ML8 function and wrapping the result with in json that requires
 for my API code.

  let $params := xdmp:get-request-body()
  let $custom :=
 let $config := json:config(custom)
 return
   (
map:put($config, element-namespace, 
 http://marklogic.com/json;),
$config
   )
   let $json := try{ (json:transform-from-json($params, $custom)) } catch
 ($e) {()}
   let $json := json type=object xmlns=http://marklogic.com/json
 {$json}/json


 The json functions those requires xs:string to convert into my APP
 specific output.

 declare function json:parse(
 $json as xs:string,
 $enableExtensions as xs:boolean
 ) as element(json:json)
 {
 let $test := if($isSupported) then () else
 error(xs:QName(json:UNSUPPORTED), The JSON library isn't supported under
 this version of MarkLogic, upgrade to 4.2 or later)
 let $tokens := json:tokenize($json)
 let $value := json:parseValue($tokens, 1, (), $enableExtensions)
 let $test :=
 if(xs:integer($value/@position) != count($tokens) + 1)
 then json:outputError($tokens, xs:integer($value/@position),
 Unhandled tokens)
 else ()
 return json:json{ $value/(@type, @boolean), $value/node()
 }/json:json
 };

 declare function json:parse(
 $json as xs:string
 ) as element(json:json)
 {
 json:parse($json, true())
 };

 Please advise if I am doing wrong thing.

 Regards,
 Indrajeet


 On Tue, May 5, 2015 at 4:17 AM, David Lee david@marklogic.com wrote:

  I will start you in the right direction ...

 XDMP-AS: (err:XPTY0004) $json as element(json:json) -- Invalid coercion:
 lt;error:error xsi:schemaLocation=http://marklogic.com/xdmp/error
 error.xsd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:error=http://marklogic.com/xdmp/errorgt;lt;error:codegt;XDMP-ASlt;/error:codegt;lt;error:namegt;err:XPTY0004lt;/error:...lt;/error:errorgt;
 as element(json:json)





 This is explained in the compatibilty doc, I suggest you start there.
 Most of the internal JSON API's have changed signatures to use the native
 JSON nodes - this requires app level changes.



 https://docs.marklogic.com/guide/relnotes/chap4



 See:

 https://docs.marklogic.com/guide/relnotes/chap4#id_94947

  The json:transform-to-json
 https://docs.marklogic.com/json:transform-to-json function uses
 xdmp:to-json https://docs.marklogic.com/xdmp:to-json, so it also
 returns a document-node() in MarkLogic 8



 The error below are to be expected  as a side effect of this.



 Any pre V8 code that uses the marklogic JSON functions is likely to need
 changing - ­That change may percolate up the API Layer - or it can be
 issolated within the function/api to expose the same signatures as before -
 which is best depends on your use case - but in any case its going to take
 some work.   The actual changes can be very simple in most cases - it is
 quite easy to convert between representations, most of the work is design -
 where do you want to make the changes, is it better to hide them as much as
 possible or to convert to the native JSON data model.  There are advantages
 to both

Re: [MarkLogic Dev General] Searching elements

2015-05-05 Thread Indrajeet Verma
Hi Chad Bishop,





*You can try using cts:element-values() as well to get distinct subject
values based on your input,*let $qtext := whatever searchlet $terms :=
 fn:tokenize($qtext, )let $q := cts:and-query((
cts:collection-query(content),
cts:element-attribute-value-query(xs:QName(subj-group),
xs:QName(subj-group-type),heading),
cts:element-word-query(xs:QName(subject), $terms))) return
cts:element-values(xs:QName(subject), (), (), $q)

If you want exact subject values, use cts:element-value-query and
case-insensitive option OR cts:element-range-query

Note - You would need to create range index for the subject to run above
code.
[image: Inline image 1]

Regards,
Indy




On Wed, May 6, 2015 at 9:17 AM, Asitmohan Nautiyal asitmoha...@hcl.com
wrote:

  Hi Chad,

  For searching a specific element and returning the matching values of
 that element use cts:element-value-query() function. Please refer
 https://docs.marklogic.com/cts:element-value-query

  Avoid use  fn:distinct-values() function as its again a expensive in
 terms of performance. Use cts:values() function to get distinct terms from
  a specified element. Refer https://docs.marklogic.com/cts:values

  sample code is here :

  cts:values(cts:path-reference(*:subject,
 http://marklogic.com/collation//S2;),(),(),
 cts:and-query((
 cts:collection-query(content),
 cts:element-attribute-value-query(xs:QName(subj-group),
 xs:QName(subj-group-type),xs:string(heading)


  Note : Create path range index for subject element in your database.


  Regards,
 Asit Nautiyal
  --
 *From:* general-boun...@developer.marklogic.com [
 general-boun...@developer.marklogic.com] on behalf of Chad Bishop [
 cbis...@sciencesocieties.org]
 *Sent:* Wednesday, May 06, 2015 3:04 AM
 *To:* general@developer.marklogic.com
 *Subject:* [MarkLogic Dev General] Searching elements

   Greetings,



 I’m wondering if someone can help with the best way to approach searching
 a specific element and returning the matching values of that element.



 I figured xpath would be best so set this up:



 let $term1 := what

 let $term2 := ever



 let $subjects :=
 fn:collection(content)/article/front/article-meta/article-categories/subj-group[@subj-group-type
 = heading]/subject[fn:contains(., $term1) and fn:contains(., $term2)]



 for $subject in fn:distinct-values($subjects)

 return $subject



 However, the number of terms will be variable, so I created this:



 let $qtext := whatever search

 let $terms :=  fn:tokenize($qtext, )

 let $contains := for $term in $terms

  return

   if ($term != $terms[fn:last()])

   then fn:concat(fn:contains(., , , $term, , )
 and )

   else fn:concat(fn:contains(., , , $term, , ))



 let $containsText := fn:string-join($contains)



 let $subjects :=
 fn:collection(content)/article/front/article-meta/article-categories/subj-group[@subj-group-type
 = heading]/subject[$containsText]



 for $subject in fn:distinct-values($subjects)

 return $subject



 The problem is the $containsText isn’t evaluated as a function(s).



 Is there a way to do that or should I be using something different?



 Any help or advice is much appreciated,



 -Chad









 ~~~

 Chad Bishop

 Lead Developer

 Science Societies



 Synergy in Science: Partnering for Solution*s*

 2015 ASA, CSSA, and SSSA International Annual Meeting

 *with the Entomological Society of America*

 November 15-18 | Minneapolis, Minnesota

 www.acsmeetings.org





 ::DISCLAIMER::

 

 The contents of this e-mail and any attachment(s) are confidential and
 intended for the named recipient(s) only.
 E-mail transmission is not guaranteed to be secure or error-free as
 information could be intercepted, corrupted,
 lost, destroyed, arrive late or incomplete, or may contain viruses in
 transmission. The e mail and its contents
 (with or without referred errors) shall therefore not attach any liability
 on the originator or HCL or its affiliates.
 Views or opinions, if any, presented in this email are solely those of the
 author and may not necessarily reflect the
 views or opinions of HCL or its affiliates. Any form of reproduction,
 dissemination, copying, disclosure, modification,
 distribution and / or publication of this message without the prior
 written consent of authorized representative of
 HCL is strictly prohibited. If you have received this email in error
 please delete it and notify the sender immediately.
 Before opening any email and/or attachments, please check them for viruses
 and other defects.


 

 ___
 General mailing list

Re: [MarkLogic Dev General] json namespace changes in json:transform-from-json($input)

2015-05-05 Thread Indrajeet Verma
Hi David,

Thank you for explaining all the things. I went through the documentation
that you have shared with me again.

What I understand, my code could be fixed in following two ways,

1. First convert JOSN object to string format however the jsonLib:parse()
is not accepting the value that returns from xdmp:to-json($params)/node().
It says, this is not a string and If I apply xdmp:quote(), this starts
working with existing code that requires xs:string as input. The
json:transform-to-json()
is not working however logically this should as based on the documentation,
this also returns xs:string and take json as object. I want input json as
xs:string for my function.

  let $params := xdmp:get-request-body()
  let $json := xdmp:to-json($params)/node()
  let $json := try{ jsonLib:parse(xdmp:quote($json)) } catch ($e)
{xdmp:log($json)} (: doing xdmp:quote() is strange here as
xdmp:to-json()/node() returns string itself.:)

2. Using ML8 function and wrapping the result with in json that requires
for my API code.

 let $params := xdmp:get-request-body()
 let $custom :=
let $config := json:config(custom)
return
  (
   map:put($config, element-namespace, http://marklogic.com/json;),

   $config
  )
  let $json := try{ (json:transform-from-json($params, $custom)) } catch
($e) {()}
  let $json := json type=object xmlns=http://marklogic.com/json
{$json}/json


The json functions those requires xs:string to convert into my APP specific
output.

declare function json:parse(
$json as xs:string,
$enableExtensions as xs:boolean
) as element(json:json)
{
let $test := if($isSupported) then () else
error(xs:QName(json:UNSUPPORTED), The JSON library isn't supported under
this version of MarkLogic, upgrade to 4.2 or later)
let $tokens := json:tokenize($json)
let $value := json:parseValue($tokens, 1, (), $enableExtensions)
let $test :=
if(xs:integer($value/@position) != count($tokens) + 1)
then json:outputError($tokens, xs:integer($value/@position),
Unhandled tokens)
else ()
return json:json{ $value/(@type, @boolean), $value/node()
}/json:json
};

declare function json:parse(
$json as xs:string
) as element(json:json)
{
json:parse($json, true())
};

Please advise if I am doing wrong thing.

Regards,
Indrajeet


On Tue, May 5, 2015 at 4:17 AM, David Lee david@marklogic.com wrote:

  I will start you in the right direction ...

 XDMP-AS: (err:XPTY0004) $json as element(json:json) -- Invalid coercion:
 lt;error:error xsi:schemaLocation=http://marklogic.com/xdmp/error
 error.xsd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:error=http://marklogic.com/xdmp/errorgt;lt;error:codegt;XDMP-ASlt;/error:codegt;lt;error:namegt;err:XPTY0004lt;/error:...lt;/error:errorgt;
 as element(json:json)





 This is explained in the compatibilty doc, I suggest you start there.
 Most of the internal JSON API's have changed signatures to use the native
 JSON nodes - this requires app level changes.



 https://docs.marklogic.com/guide/relnotes/chap4



 See:

 https://docs.marklogic.com/guide/relnotes/chap4#id_94947

  The json:transform-to-json
 https://docs.marklogic.com/json:transform-to-json function uses
 xdmp:to-json https://docs.marklogic.com/xdmp:to-json, so it also
 returns a document-node() in MarkLogic 8



 The error below are to be expected  as a side effect of this.



 Any pre V8 code that uses the marklogic JSON functions is likely to need
 changing - ­That change may percolate up the API Layer - or it can be
 issolated within the function/api to expose the same signatures as before -
 which is best depends on your use case - but in any case its going to take
 some work.   The actual changes can be very simple in most cases - it is
 quite easy to convert between representations, most of the work is design -
 where do you want to make the changes, is it better to hide them as much as
 possible or to convert to the native JSON data model.  There are advantages
 to both.

 But it starts by reading the above docs, and then looking at your code and
 any dependent code to make the right choices for you.






 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Indrajeet Verma
 *Sent:* Monday, May 04, 2015 1:35 PM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] json namespace changes in
 json:transform-from-json($input)



 Hi David,



 Thank you for your explanation and help!



 1. Could you explain what issues you are having ?



 XDMP-AS: (err:XPTY0004) $json as element(json:json) -- Invalid coercion:
 lt;error:error xsi:schemaLocation=http://marklogic.com/xdmp/error
 error.xsd xmlns:xsi=http://www.w3

[MarkLogic Dev General] json namespace changes in json:transform-from-json($input)

2015-05-04 Thread Indrajeet Verma
Hi,


While upgrading ML6 to ML8, I needed to modify the JSON format and I did it
based on my understanding on ML8 JSON handling however my senior is not
convince with this solution so wanted to know if my approach is not best
fit and could be better solution.


Please someone take a look on my code and suggest any better solution?


let $input := '{docTitle:histories: Search for apple, type:Search,
searchParameter:{page:1, pageLength:10}}'

When I am using json:transform-from-json($input), getting below output with
namespace  http://marklogic.com/xdmp/json/basic;

json type=object xmlns=http://marklogic.com/xdmp/json/basic;
docTitle type=string
histories: Search for apple
/docTitle
type type=string
Search
/type
searchParameter type=object
page type=number
1
/page
pageLength type=number
10
/pageLength
/searchParameter

/json


However I wanted the results with the namespace http://marklogic.com/json;
so I have coded like below,


let $custom :=

let $config := jsonl:config(custom)

return

  (

   map:put($config, element-namespace, http://marklogic.com/json;),


   $config

  )

  let $json := try{ (jsonl:transform-from-json($input, $custom)) } catch
($e) {()}

  let $json := json type=object xmlns=http://marklogic.com/json
{$json}/json

  return $json


*output:*

json type=object xmlns=http://marklogic.com/json;
docTitle
histories: Search for apple
/docTitle
type
Search
/type
searchParameter
page
1
/page
pageLength
10
/pageLength
/searchParameter

/json


Regards,

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


Re: [MarkLogic Dev General] json namespace changes in json:transform-from-json($input)

2015-05-04 Thread Indrajeet Verma
Hi David,

Might be I am wrong here and I will raise a ticket in roxy as well however
in this case roxy is sending the request body same as it receives from the
request.

The manipulation and transformation logic is happening inside modules and
that by using ML server functions.

Regards,
Indy


On Mon, May 4, 2015 at 9:12 PM, David Lee david@marklogic.com wrote:

  You mention Roxy.  That adds another layer.   I suggests the Roxy forum
 for discussing this.



 https://github.com/marklogic/roxy/issues



 Roxy is a community developed project, Not part of the core MarkLogic
 product.

 I don't know to what extent Roxy has been modified to work with ML8 or
 what changes to suggest to code using it.



 Many of the low level JSON related API's changed in ML8 and not all the
 community developed libraries have incorporated those yet.  The Application
 APIs provided by MarkLogic (like the Java Client API, XCC etc) are updated
 in-sync with the server update releases, externally managed products and
 libraries are independently managed by their authors and/or the community
 (for OS projects).










 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Indrajeet Verma
 *Sent:* Monday, May 04, 2015 11:27 AM

 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] json namespace changes in
 json:transform-from-json($input)



 Thank you Eric and David for your response however our system is working
 fine in ML6 and details are,



 Same I wanted to achieve in ML8 without changing in UI and other search
 API that are being used for retrieval.



 Input request in body via roxy,



 {

   docTitle: histories: Search for apple,

   type: Search,

   searchParameter: {

 page: 1,

 pageLength: 10,

 queryText: apple AND microsoft,

 contentCollection: All Content

   }

 }



 Output that is being saved in ML,



 XML document  http://localhost:8000/qconsole/

 ?xml version=1.0 encoding=UTF-8?

 resource wk-pid=HIS-954e3f8f-2bbb-e79b-3747-7480b73db65b

 docType

 Histories

 /docType

 docTitle

 histories: Search for apple

 /docTitle

 ownerId

 USR-2fe944cc-013e-5b5a-0dba-7e98c3ffab00

 /ownerId

 created

 2015-05-04T17:13:40.126+05:30

 /created

 modified

 2015-05-04T17:13:40.126+05:30

 /modified

 shared

 /shared

 parameter

 type

 Search

 /type

 /parameter

 json type=object xmlns=http://marklogic.com/json;

 type

 Search

 /type

 searchParameter

 page

 1

 /page

 pageLength

 10

 /pageLength

 queryText

 Apple AND microsoft

 /queryText

 contentCollection

 All Content

 /contentCollection

 /searchParameter

 /json

 /resource







 On Mon, May 4, 2015 at 7:36 PM, David Lee david@marklogic.com wrote:

   Erik addressed the most likely issue/question.

 As a follow-up , for clarification -

   your 2 examples are fundamentally different use cases of
 json:transform-to-xml()

 The first use (without the $config)  is intended *only* for the pre-V8
  use case of transforming

 arbitrary JSON into a 'black box' XML format with 100% fidelity.   While
 it is a fairly readable format,

 Its not intended to be used directly  - it is an implementation used by V7
 before we had native JSON data types in the database.

 It is maintained for backwards compatibility for that use case only (if
 you have existing data in V7 format).



 The second example (with the 'custom' strategy and a $config)  is  not
 intended as a refinement or otherwise

 replacement for the first case.  Its designed to allow for custom
 transformations between JSON and XML -

 possibly bi-directionally  - at the expense of losing 100%  fidelity.
   Many of these use cases are no longer necessary in V8

 due to native support for JSON directly.



 It *can* be used as you have done - it should not be confused with the
 first  case ( making any modifications

 at all to the 'basic' strategy transformation produces XML which will
 break any code expecting the V7 internal format),

 and I don't recommend it for API's that have a JSON interface - its much
 better to use that directly if possible.
 For API's that accept either JSON or XML - the formats for both are well
 defined - but the transformation between those formats
 can be very complex to get 100% right.  So if you have JSON and using an
 API that accepts JSON - its much easier and better

 (and more efficient) to not attempt to transform it to XML.








 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun

Re: [MarkLogic Dev General] json namespace changes in json:transform-from-json($input)

2015-05-04 Thread Indrajeet Verma
'])
then (
element contentCollectionId
{res:extractCollectionId($doc/ownerId,$searchParameter/element()[fn:local-name(.)
='contentCollection']/fn:string())}
)
else ()
  )
  else (),
  element {fn:node-name($json)} {
$json/@*,
$json/node()[fn:not(fn:local-name(.) =
(docUrl,docId,docTitle,created,modified))]
  }
}
  return (
$update,
tools:invoke(document-insert,
  (
$uri,
$update
  ),
  $cfg:RESOURCE-DB
)
  )[1]
};

(:~
 : Converts incoming JSON structure into internal search parameter
structure.
 : It will be stored into user resources and used for query construction.
 :)
declare function m:json-search-params( $json as element(json:json))
as element (searchParameter)?
{
  if ($json/json:searchParameter) then
element searchParameter {
  for $item in $json/json:searchParameter/*
  where $item/@type != 'object'
  return
element {fn:local-name($item)} {
  if ($item/@type = 'array') then (
for $value in $item/json:item[fn:not(@type =
('object','array'))]
return
  element value {
attribute type {if ($value/@type = number) then
xs:unsignedLong else xs:string},
$value/text()
  }
  ) else (
attribute type {if ($item/@type = number) then
xs:unsignedLong else xs:string},
$item/text()
  )
}
}
  else
()
};






On Mon, May 4, 2015 at 9:44 PM, David Lee david@marklogic.com wrote:

  If those modules are custom modules (written by you or your team, not by
 marklogic or roxy), then yes this is the right place to ask.



 If you goal is to minimize client side changes - then you will need to
 modify your XQuery code wherever V6 vs V8 compatibility has changed.



 Here is a good place to start in order to identify potential changes
 needed.



 https://docs.marklogic.com/guide/relnotes/chap4



 I am not familiar with where this element would be used by a ML API

   json type=object xmlns=http://marklogic.com/json;



 That is neither directly compatible with V6,7 or  8  'basic' JSON format,

 nor is it the namespace or format for a ML server side API that I am aware
 of.



 In the original question regarding use of xml:transform-to-xml  , in
 general

 what you are doing is correct - the JSON is being translated to XML to the
 extent

 you describe you wanted.

 Since you don't reference exactly what it is that you are having problems
 with, its hard to guess ...

 Could you explain what issues you are having ?

 Where is this document used ?

 could you show the XQuery code that uses it?

 What is not working, what you expected vs what you are getting etc.






 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Indrajeet Verma
 *Sent:* Monday, May 04, 2015 11:48 AM

 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] json namespace changes in
 json:transform-from-json($input)



 Hi David,



 Might be I am wrong here and I will raise a ticket in roxy as well however
 in this case roxy is sending the request body same as it receives from the
 request.



 The manipulation and transformation logic is happening inside modules and
 that by using ML server functions.



 Regards,

 Indy





 On Mon, May 4, 2015 at 9:12 PM, David Lee david@marklogic.com wrote:

   You mention Roxy.  That adds another layer.   I suggests the Roxy forum
 for discussing this.



 https://github.com/marklogic/roxy/issues



 Roxy is a community developed project, Not part of the core MarkLogic
 product.

 I don't know to what extent Roxy has been modified to work with ML8 or
 what changes to suggest to code using it.



 Many of the low level JSON related API's changed in ML8 and not all the
 community developed libraries have incorporated those yet.  The Application
 APIs provided by MarkLogic (like the Java Client API, XCC etc) are updated
 in-sync with the server update releases, externally managed products and
 libraries are independently managed by their authors and/or the community
 (for OS projects).










 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Indrajeet Verma
 *Sent:* Monday, May 04, 2015 11:27 AM


 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] json namespace changes in
 json:transform-from-json

Re: [MarkLogic Dev General] XDMP-TOOMANYSTANDS

2015-05-01 Thread Indrajeet Verma
Hi Shashi,

I agree with Christopher. I also suspect, you might have only one forest
and data size is large, ingestion is high and
your merge policy is not set-up properly to clean deleted fragments.

Could you tell me how many deleted fragments in your forest? To fix this
issue right now, I think you can perform manual merge in the forests if you
have a lot of deleted fragments.

Also what version of ML are you using? In ML7 onwards, ML provides facility
to distribute content in all the forest equally.
You just create new forests and attach them into DB.

For more information, refer
https://developer.marklogic.com/pubs/architecture/inside-marklogic-server-r7.pdf

Regards,
Indy


On Fri, May 1, 2015 at 7:06 PM, Christopher Hamlin cbham...@gmail.com
wrote:

 Hi,

 In general, 32 GB is a good default.  You can use 64 also, at the
 expense of larger merges (since it is allowed to create 2x larger
 stands).

 Your problem is not that the merge max size is bigger, since this
 would let the stands merge down to fewer, larger stands.

 Most likely the problem is that you have too much in a single forest.
 Generally, before you get to max-stands you should scale out, in
 forests/machines.

 How large is the forest as a whole?  How large are the stands?  Do you
 only have one forest?  How much free disk space do you have?


 /ch

 On Fri, May 1, 2015 at 8:36 AM, Shashidhar Rao
 raoshashidhar...@gmail.com wrote:
  Hi ,
 
  Based on the below link this
  https://docs.marklogic.com/8.0/messages/XDMP-en/XDMP-TOOMANYSTANDSHi
 
  for the above too many stands I have set the
 
  MAX-MERGE-SIZE to 64GB instead of 32 GB
 
  Can someone help me whether this 64gb is ok
 
  Thanks
 
 
 
  ___
  General mailing list
  General@developer.marklogic.com
  Manage your subscription at:
  http://developer.marklogic.com/mailman/listinfo/general
 
 ___
 General mailing list
 General@developer.marklogic.com
 Manage your subscription at:
 http://developer.marklogic.com/mailman/listinfo/general

___
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-04-30 Thread Indrajeet Verma
Thank you Danny for your detailed explanation!

Regards,
Indy

On Thu, Apr 30, 2015 at 6:25 PM, Danny Sinang d.sin...@gmail.com wrote:

 Hi Indy,

 We ran into the same problems after we upgraded to ML8.

 That forced us to create the necessary indexes and also make sure that we
 don't specify a collation attribute if the sortby index is not of type
 string.

 Also, if the index is of type int, you should use xs:int, not
 xs:integer for sort-order/@type.

 Regards,
 Danny


 On Thu, Apr 30, 2015 at 2:16 AM, Indrajeet Verma 
 indrajeet.ve...@gmail.com wrote:

 Hi Joe Bryan,

 Thank you for your suggestions!

 The same code was working in ML6 without any error however this is
 showing exception in ML8 as SEARCH-BADORDERBY.

 So is it mandatory in ML8 but not in ML6? However going through the
 documentations, it suggests the range index must be there even in ML6.

 Regards,
 Indrajeet

 On Thu, Apr 30, 2015 at 11:01 AM, Joe Bryan joe.br...@marklogic.com
 wrote:

  Hi Indrajeet,

  The documentation you linked is for optimizing order by clauses in
 XQuery. The sort-order/ element is part of the Search API query options,
 which are documented here:
 http://docs.marklogic.com/search:search?q=search:searchv=8.0api=true#opt-sort-order

  Thanks.

  -jb

   From: Indrajeet Verma indrajeet.ve...@gmail.com
 Reply-To: MarkLogic Developer Discussion 
 general@developer.marklogic.com
 Date: Thursday, April 30, 2015 at 1:24 AM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: [MarkLogic Dev General] SEARCH-BADORDERBY

   Hi,

  I was having issues in ML8 as SEARCH-BADORDERBY: (err:FOER)
 Indexes are required to support element, element-attribute, json-property,
 or field sort specifications.

  So I created range index for the element name as It was being used
 in sort-order

  I just wanted to confirm whether range index are mandatory in ML8 for
 the elements that we use in sort-order as a search option.

  I have gone through the link as well for the documentation and I did
 not see that the error will be thrown in case indexes will not present.
 Please let me know if I am missing anything.

  https://docs.marklogic.com/guide/performance/order_by#id_29515

 Thank you for your help.

  Regards,
 Indy

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



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



 ___
 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


[MarkLogic Dev General] SEARCH-BADORDERBY

2015-04-29 Thread Indrajeet Verma
Hi,

I was having issues in ML8 as SEARCH-BADORDERBY: (err:FOER) Indexes are
required to support element, element-attribute, json-property, or field
sort specifications.

So I created range index for the element name as It was being used in
sort-order

I just wanted to confirm whether range index are mandatory in ML8 for the
elements that we use in sort-order as a search option.

I have gone through the link as well for the documentation and I did not
see that the error will be thrown in case indexes will not present. Please
let me know if I am missing anything.

https://docs.marklogic.com/guide/performance/order_by#id_29515

Thank you for your help.

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


[MarkLogic Dev General] JSON sending in the request body is not being converted into map:map in ML8 using roxy however working fine with ML6

2015-04-28 Thread Indrajeet Verma
Hi,

Please help us if you have encountered same kind of problem.

We are upgrading ML6 to ML8 and using roxy as well. The roxy is customized
based on the customer requirement.


For one of the REST request /setcache, we are sending below data to cache
and that is being converted into map (key value pair)

ML6-

Request in Body-
---

{USERSESSION:a57e7e98cae8a7857285cd9a66de813f|4/28/2015 9:48:14
PM:{user:user-profile
wk-pid=\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39\docTypeUsers/docTypeusername
type=\string\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernameuserId
type=\string\lrunne...@wk.com/userIdemail type=\string\
lrunne...@wk.com/emailuserStatus
type=\string\Active/userStatusdefaultContentCollectionALL/defaultContentCollectionrole
type=\string\user/roletrialEndDate type=\string\/activationDate
type=\string\2013-12-25/activationDatephoneNumber
type=\string\/sendWelcomeEmail type=\string\/additionalEmail
type=\string\/filingContent
type=\string\Allowed/filingContentfirstName
type=\string\John/firstNamelastName
type=\string\Doe/lastNameorgCode
type=\string\WK001/orgCodeorgName
type=\string\LoadRunner/orgNamesalesTerritory
type=\string\/password5f4dcc3b5aa765d61d8327deb882cf99/passwordpwpassword/pwcountOfLoggedIn11/countOfLoggedIncreated2014-07-11T11:05:11.589-05:00/createdcreatedBy
type=\string\System/createdBymodified2014-07-11T11:05:11.589-05:00/modifiedmodifiedBy
yun.y...@wolterskluwer.com/modifiedBy/user-profile,
session:session wk-pid=\a57e7e98cae8a7857285cd9a66de813f|4/28/2015
9:48:14
PM\usernameUSR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernamecreated2015-04-28T17:48:14.661+05:30/createdexpiration2015-04-28T21:48:14.661+05:30/expirationcurrenttime2015-04-28T17:48:14.661+05:30/currenttimevalidfalse/valid/session}}

Converted into below map using ML6-
--

map:map(map:map xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:xsi=
http://www.w3.org/2001/XMLSchema-instance;
xmlns:map=http://marklogic.com/xdmp/map;map:entry
key=USERSESSION:97f7d8ec0b5bba928cb025bd1d4d28d4|4/28/2015 9:57:24
PMmap:valuemap:mapmap:entry key=usermap:valueuser-profile
wk-pid=USR-59fb4f7d-de03-1e37-a23c-5c3d71552eaausernameUSR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa/usernamedocTypeUsers/docTypeuserId
type=stringsjauh...@innodata.com/userIdfirstName
type=stringshruti/firstNamelastName
type=stringjauhari/lastNameorgCode
type=stringFORD-101/orgCodeorgName type=stringFord Motor
Company/orgNamefilingContent
type=stringAllowed/filingContentuserStatus
type=stringActive/userStatustrialEndDate
type=string2018-12-31/trialEndDaterole
type=stringuser/roletelephoneNumber
type=string212-555-1212/telephoneNumbersalesTerritory
type=stringNortheast/salesTerritorysendWelcomeEmail
type=stringFalse/sendWelcomeEmaildefaultContentCollection
type=stringdefault/defaultContentCollectionadditionalEmail
type=stringskh...@innodata.com/additionalEmailpassword5f4dcc3b5aa765d61d8327deb882cf99/passwordpwpassword/pwcountOfLoggedIn11/countOfLoggedIncreated2015-04-22T15:37:32.151+05:30/createdcreatedByUSR-2fe944cc-013e-5b5a-0dba-7e98c3ffab00/createdBymodified2015-04-22T15:37:32.151+05:30/modifiedmodifiedByUSR-2fe944cc-013e-5b5a-0dba-7e98c3ffab00/modifiedBy/user-profile/map:value/map:entrymap:entry
key=sessionmap:valuesession
wk-pid=97f7d8ec0b5bba928cb025bd1d4d28d4|4/28/2015 9:57:24
PMusernameUSR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa/usernamecreated2015-04-28T17:57:24.34+05:30/createdexpiration2015-04-28T21:57:24.34+05:30/expirationcurrenttime2015-04-28T17:57:24.34+05:30/currenttimevalidfalse/valid/session/map:value/map:entry/map:map/map:value/map:entry/map:map)

ML8 -
---
Input and converted output is same. i.e. without map:

{USERSESSION:a57e7e98cae8a7857285cd9a66de813f|4/28/2015 9:48:14
PM:{user:user-profile
wk-pid=\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39\docTypeUsers/docTypeusername
type=\string\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernameuserId
type=\string\lrunne...@wk.com/userIdemail type=\string\
lrunne...@wk.com/emailuserStatus
type=\string\Active/userStatusdefaultContentCollectionALL/defaultContentCollectionrole
type=\string\user/roletrialEndDate type=\string\/activationDate
type=\string\2013-12-25/activationDatephoneNumber
type=\string\/sendWelcomeEmail type=\string\/additionalEmail
type=\string\/filingContent
type=\string\Allowed/filingContentfirstName
type=\string\John/firstNamelastName
type=\string\Doe/lastNameorgCode
type=\string\WK001/orgCodeorgName
type=\string\LoadRunner/orgNamesalesTerritory
type=\string\/password5f4dcc3b5aa765d61d8327deb882cf99/passwordpwpassword/pwcountOfLoggedIn11/countOfLoggedIncreated2014-07-11T11:05:11.589-05:00/createdcreatedBy
type=\string\System/createdBymodified2014-07-11T11:05:11.589-05:00/modifiedmodifiedBy
yun.y...@wolterskluwer.com/modifiedBy/user-profile,
session:session wk-pid=\a57e7e98cae8a7857285cd9a66de813f|4/28/2015
9:48:14

Re: [MarkLogic Dev General] JSON sending in the request body is not being converted into map:map in ML8 using roxy however working fine with ML6

2015-04-28 Thread Indrajeet Verma
Thank you David for your explanation. I also have same understanding
however not able to find exact method/module which is not converting into
map.

I identified router.xqy (line 67) and request.xqy where the conversion is
happening and setting map to the request.

Might be good to open a ticket in the github/roxy and see if I get some
resolution.

However I am attaching the router.xqy and request.xqy for your reference.
if possible please take a look and suggest some resolution.

Could you please help me to get the link of the APIs that have modified as
you said in your comments? OR Should we look into release notes?

Thank you for your time and help.

Regards,
Indrajeet

On Tue, Apr 28, 2015 at 8:16 PM, David Lee david@marklogic.com wrote:

  This is probably best addressed by filing an issue on the Roxy github
 issue tracker.



 https://github.com/marklogic/roxy



 Roxy is a community/developer supported product.



 I suspect the issue is due to the (not backwards compatible, but
 documented) change to many JSON related API's in MarkLogic.



 The JSON API's have been converted to work directly with the native JSON
 data types in ML8.



 All of the internal MarkLogic libraries and apps have been updated as well
 to adjust to this change.   Exactly where in Roxy this is breaking I don't
 know, but the errors suggest is likely due to the ML8 changes in JSON.



 Happy to help with any specific questions on the changes to ML APIs.



 -David










 -

 David Lee
 Lead Engineer
 *Mark**Logic* Corporation
 d...@marklogic.com
 Phone: +1 812-482-5224

 Cell:  +1 812-630-7622
 www.marklogic.com



 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Indrajeet Verma
 *Sent:* Tuesday, April 28, 2015 10:15 AM
 *To:* MarkLogic Developer Discussion
 *Subject:* [MarkLogic Dev General] JSON sending in the request body is
 not being converted into map:map in ML8 using roxy however working fine
 with ML6



 Hi,



 Please help us if you have encountered same kind of problem.



 We are upgrading ML6 to ML8 and using roxy as well. The roxy is customized
 based on the customer requirement.


 For one of the REST request /setcache, we are sending below data to
 cache and that is being converted into map (key value pair)

 ML6-

 Request in Body-
 ---

 {USERSESSION:a57e7e98cae8a7857285cd9a66de813f|4/28/2015 9:48:14
 PM:{user:user-profile
 wk-pid=\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39\docTypeUsers/docTypeusername
 type=\string\USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernameuserId
 type=\string\lrunne...@wk.com/userIdemail type=\string\
 lrunne...@wk.com/emailuserStatus
 type=\string\Active/userStatusdefaultContentCollectionALL/defaultContentCollectionrole
 type=\string\user/roletrialEndDate type=\string\/activationDate
 type=\string\2013-12-25/activationDatephoneNumber
 type=\string\/sendWelcomeEmail type=\string\/additionalEmail
 type=\string\/filingContent
 type=\string\Allowed/filingContentfirstName
 type=\string\John/firstNamelastName
 type=\string\Doe/lastNameorgCode
 type=\string\WK001/orgCodeorgName
 type=\string\LoadRunner/orgNamesalesTerritory
 type=\string\/password5f4dcc3b5aa765d61d8327deb882cf99/passwordpwpassword/pwcountOfLoggedIn11/countOfLoggedIncreated2014-07-11T11:05:11.589-05:00/createdcreatedBy
 type=\string\System/createdBymodified2014-07-11T11:05:11.589-05:00/modifiedmodifiedBy
 yun.y...@wolterskluwer.com/modifiedBy/user-profile,
 session:session wk-pid=\a57e7e98cae8a7857285cd9a66de813f|4/28/2015
 9:48:14
 PM\usernameUSR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/usernamecreated2015-04-28T17:48:14.661+05:30/createdexpiration2015-04-28T21:48:14.661+05:30/expirationcurrenttime2015-04-28T17:48:14.661+05:30/currenttimevalidfalse/valid/session}}

 Converted into below map using ML6-
 --

 map:map(map:map xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance;

 xmlns:map=http://marklogic.com/xdmp/map;map:entry
 key=USERSESSION:97f7d8ec0b5bba928cb025bd1d4d28d4|4/28/2015 9:57:24
 PMmap:valuemap:mapmap:entry key=usermap:valueuser-profile
 wk-pid=USR-59fb4f7d-de03-1e37-a23c-5c3d71552eaausernameUSR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa/usernamedocTypeUsers/docTypeuserId
 type=stringsjauh...@innodata.com/userIdfirstName
 type=stringshruti/firstNamelastName
 type=stringjauhari/lastNameorgCode
 type=stringFORD-101/orgCodeorgName type=stringFord Motor
 Company/orgNamefilingContent
 type=stringAllowed/filingContentuserStatus
 type=stringActive/userStatustrialEndDate
 type=string2018-12-31/trialEndDaterole
 type=stringuser/roletelephoneNumber 
 type=string212-555-1212/telephoneNumbersalesTerritory
 type=stringNortheast/salesTerritorysendWelcomeEmail
 type=stringFalse/sendWelcomeEmaildefaultContentCollection
 type=stringdefault

Re: [MarkLogic Dev General] Error in getting map keys in ML8

2015-04-28 Thread Indrajeet Verma
Thank you Bryan for your help!

Regards,
Indy

On Wed, Apr 29, 2015 at 12:38 AM, Joe Bryan joe.br...@marklogic.com wrote:

  Hi Indrajeect,

  Your $params variable is an element (the serialization of a map), not a
 map. You can use the map constructor function to convert the XML
 serialization of a map to map:

  return map:keys(map:map($params))

  Thanks.

  -jb

   From: Indrajeet Verma indrajeet.ve...@gmail.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Tuesday, April 28, 2015 at 3:05 PM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: [MarkLogic Dev General] Error in getting map keys in ML8

   Hi,

  Could somebody help me what I am missing in below query. I am using this
 code in ML8

  let $params := map:map xmlns:map=http://marklogic.com/xdmp/map;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:xs=http://www.w3.org/2001/XMLSchema;
 map:entry key=USERSESSION:483d4d2f1a54a7f0eb42f6f1dfa6518c|4/29/2015
 3:41:5 AM
 map:value
 map:map
 map:entry key=user
 map:value
 user-profile
 wk-pid=USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39
 docTypeUsers/docType
 username type=string

 USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/username

 /user-profile
 /map:value
 /map:entry
 map:entry key=session
 map:value
 session
 wk-pid=483d4d2f1a54a7f0eb42f6f1dfa6518c|4/29/2015 3:41:5 AM

 usernameUSR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/username

 created2015-04-28T23:41:05.172+05:30/created
 /session
 /map:value
 /map:entry
 /map:map
 /map:value
 /map:entry
 /map:map
 return map:keys($params)

  Error that I am seeing,

   [1.0-ml] XDMP-ARGTYPE: (err:XPTY0004) map:keys(map:map xmlns:xs=
 http://www.w3.org/2001/XMLSchema; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xmlns:map=
 http://marklogic.com/xdmp/map;map:entry
 key=USERSESSION:483d4d2f1a54a7f0eb42f6f1dfa6518c|4/2.../map:map) -- arg1
 is not of type map:map


 ___
 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


[MarkLogic Dev General] Error in getting map keys in ML8

2015-04-28 Thread Indrajeet Verma
Hi,

Could somebody help me what I am missing in below query. I am using this
code in ML8

let $params := map:map xmlns:map=http://marklogic.com/xdmp/map;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:xs=http://www.w3.org/2001/XMLSchema;
map:entry key=USERSESSION:483d4d2f1a54a7f0eb42f6f1dfa6518c|4/29/2015
3:41:5 AM
map:value
map:map
map:entry key=user
map:value
user-profile
wk-pid=USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39
docTypeUsers/docType
username type=string

USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/username

/user-profile
/map:value
/map:entry
map:entry key=session
map:value
session
wk-pid=483d4d2f1a54a7f0eb42f6f1dfa6518c|4/29/2015 3:41:5 AM

usernameUSR-b740cbc5-5e27-8b1c-d97a-1329625f6b39/username

created2015-04-28T23:41:05.172+05:30/created
/session
/map:value
/map:entry
/map:map
/map:value
/map:entry
/map:map
return map:keys($params)

Error that I am seeing,

[1.0-ml] XDMP-ARGTYPE: (err:XPTY0004) map:keys(map:map xmlns:xs=
http://www.w3.org/2001/XMLSchema; xmlns:xsi=
http://www.w3.org/2001/XMLSchema-instance; xmlns:map=
http://marklogic.com/xdmp/map;map:entry
key=USERSESSION:483d4d2f1a54a7f0eb42f6f1dfa6518c|4/2.../map:map) -- arg1
is not of type map:map
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] XDMP:SPAWN - Load Distribution Issue

2015-04-22 Thread Indrajeet Verma
If you are using Java to call XQuery modules via XDBC, you can use
MarkLogic provided Java code with round robin approach to send requests to
ML nodes.

However corb/recordloader are nice to use for ingestion/bulk upload and
easy to configure

Regards,
Indrajeet

On Wed, Apr 22, 2015 at 5:20 PM, Dave Cassel dave.cas...@marklogic.com
wrote:

   I believe you can use Taskbot https://github.com/mblakele/taskbot for
 this. If not that, then I'd go with Corb2
 https://github.com/marklogic/corb2.

  --
 Dave Cassel http://davidcassel.net, @dmcassel
 https://twitter.com/dmcassel
 Developer Community Manager
 MarkLogic Corporation http://www.marklogic.com/
  Data Innovation Summit
 http://fedscoop.com/events/datainnovationsummit/2015/ May 7th in DC


   From: abhishek.srivas...@cognizant.com 
 abhishek.srivas...@cognizant.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Wednesday, April 22, 2015 at 12:10 AM
 To: general@developer.marklogic.com general@developer.marklogic.com
 Subject: [MarkLogic Dev General] XDMP:SPAWN - Load Distribution Issue

  Hi All,


  We are using xdmp:spawn-function to bulk process content. Somehow the
 task is not getting distributed across each node of the cluster but stick
 to the machine it is initiated. Is there any way to spawn load across all
 nodes of the cluster?


  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


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


Re: [MarkLogic Dev General] XDMP:SPAWN - Load Distribution Issue

2015-04-22 Thread Indrajeet Verma
If you are using Java to call XQuery modules via XDBC, you can use
MarkLogic provided Java code with round robin approach to send requests to
ML nodes.

However corb/recordloader are nice to use for ingestion/bulk upload.

Regards,
Indrajeet

On Wed, Apr 22, 2015 at 5:20 PM, Dave Cassel dave.cas...@marklogic.com
wrote:

   I believe you can use Taskbot https://github.com/mblakele/taskbot for
 this. If not that, then I'd go with Corb2
 https://github.com/marklogic/corb2.

  --
 Dave Cassel http://davidcassel.net, @dmcassel
 https://twitter.com/dmcassel
 Developer Community Manager
 MarkLogic Corporation http://www.marklogic.com/
  Data Innovation Summit
 http://fedscoop.com/events/datainnovationsummit/2015/ May 7th in DC


   From: abhishek.srivas...@cognizant.com 
 abhishek.srivas...@cognizant.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Wednesday, April 22, 2015 at 12:10 AM
 To: general@developer.marklogic.com general@developer.marklogic.com
 Subject: [MarkLogic Dev General] XDMP:SPAWN - Load Distribution Issue

  Hi All,


  We are using xdmp:spawn-function to bulk process content. Somehow the
 task is not getting distributed across each node of the cluster but stick
 to the machine it is initiated. Is there any way to spawn load across all
 nodes of the cluster?


  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


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


Re: [MarkLogic Dev General] snip:truncate-text() has been renamed to snip:truncate( ) in ML8

2015-04-22 Thread Indrajeet Verma
Thank you Erik for your response!

Regards,
Indrajeet

On Wed, Apr 22, 2015 at 7:23 PM, Erik Hennum erik.hen...@marklogic.com
wrote:

  Hi, Indrajeet:

 The search.xqy module has the public, documented interfaces for the Search
 API.

 The snippet.xqy module is an implementation module. None of the functions
 declared in that module are documented as public interfaces. Even if a
 function of the same name and signature happens to exist in a new release
 of MarkLogic, the semantics could still change, even in a point release.

 Probably, that's already well understood, but I wanted to make sure.  If
 you're comfortable taking responsibility for that risk, you might want to
 test the inputs and outputs of the implementation function to see if the
 cases you need to support happen to be implemented consistently (not only
 for this upgrade but for future upgrades as well).


   Erik Hennum

--
 *From:* general-boun...@developer.marklogic.com [
 general-boun...@developer.marklogic.com] on behalf of Indrajeet Verma [
 indrajeet.ve...@gmail.com]
 *Sent:* Wednesday, April 22, 2015 12:52 AM
 *To:* MarkLogic Developer Discussion
 *Subject:* [MarkLogic Dev General] snip:truncate-text() has been renamed
 to snip:truncate( ) in ML8

   Hi,

  We are using snip:truncate-text() in our code in ML6 and after upgrading
 it to ML8, It is showing XDMP-UNDFUN: (err:XPST0017) Undefined function
 snip:truncate-text().

  We looked into below module and found this function has been modified .
 We found similar function snip:truncate().
 import module namespace snip = 
 http://marklogic.com/appservices/search-snippet; at
 /MarkLogic/appservices/search/snippet.xqy;

  So wanted suggestions if we can use snip:truncate() in ML8 as a
 replacement of snip:truncate-text() in ML6.

  Regards,
 Indrajeet

 ___
 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] Wildcarded author search

2015-04-22 Thread Indrajeet Verma
Hi Danny,

I am not sure if below query fits in your requirement however see if this
can. You can create your search:query based on your need and also enhance
$options

declare variable $OPTIONS :=
 options xmlns=http://marklogic.com/appservices/search;
 values name=author-path
 range type=xs:string

path-index/contrib-group/contrib[@contrib-type='author']/author-name-string/path-index
   /range
/values
return-valuestrue/return-values
/options ;

let $options :=
options xmlns=http://marklogic.com/appservices/search;
{$OPTIONS/*}
/options
let $results := search:values('author-path', $options,
search:parse(John, (), search:query))
return $results

Regards,
Indrajeet


On Wed, Apr 22, 2015 at 7:37 AM, Danny Sinang d.sin...@gmail.com wrote:

 I came up with the solution below.

 Maybe someone else here has a better approach.

 *let **$path* :=
 /contrib-group/contrib[@contrib-type='author']/author-name-string

 *let* *$collation* := 
 http://marklogic.com/collation/en/S2;
 *let* *$options* := (type=string, collation= ||
 *$collation*)
 *let* *$ref* := *cts:path-reference*(*$path*, *$options*)
 *let* *$value-matches* := *let **$matches* :=
 *cts:value-match* (*$ref*, *$author*)
   *return*
 *if* (*$matches*) *then*
 *$matches*
 *else*
 
 *return*
 *cts:path-range-query* (*$path*, =,
 *$value-matches*, collation= || *$collation*)

 On Tue, Apr 21, 2015 at 8:39 PM, Danny Sinang d.sin...@gmail.com wrote:

 We've got article authors stored like this :

 contrib-group
 contrib contrib-type=author 
 author-name-stringJohn Baker, Ph.D./
 author-name-string

 /contrib
 contrib contrib-type=author 
 author-name-stringSarah Reynolds, Ph.D./
 author-name-string

 /contrib
 /contrib-group


 And we'd like the following search strings match the first contrib node
 above :

 1. john*

 2. john Bak*

 3. *Baker*

 And we'd like this search string match both both contrib nodes above :

 *Ph.D.


 My questions are :

 1. What database index settings do I need to set (e.g. trailing wildcard,
 etc) ?

 2. What kind of indexes do I need to make ?

 3. What search API options do I need to create ?

 4. If I need to create a custom constraint that returns a cts query, what
 cts query option should I use ?


 I've tried creating custom constraints that return either
 cts:element-value-query or cts:element-word-query but I seem to be getting
 false positives. For example, if I search for john ba*, I get articles with
 authors named John (some other surname), or Brian Bass.


 Regards,

 Danny








 ___
 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


[MarkLogic Dev General] snip:truncate-text() has been renamed to snip:truncate( ) in ML8

2015-04-22 Thread Indrajeet Verma
Hi,

We are using snip:truncate-text() in our code in ML6 and after upgrading it
to ML8, It is showing XDMP-UNDFUN: (err:XPST0017) Undefined function
snip:truncate-text().

We looked into below module and found this function has been modified . We
found similar function snip:truncate().
import module namespace snip = 
http://marklogic.com/appservices/search-snippet; at
/MarkLogic/appservices/search/snippet.xqy;

So wanted suggestions if we can use snip:truncate() in ML8 as a replacement
of snip:truncate-text() in ML6.

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


Re: [MarkLogic Dev General] Upgrade ML6 to ML8

2015-04-21 Thread Indrajeet Verma
We are using,


   - ROXY
   - RecordLoader
   - XQSync
   - Corb

Regards,
Indrajeet

On Tue, Apr 21, 2015 at 6:15 PM, Indrajeet Verma indrajeet.ve...@gmail.com
wrote:

 Thank you Danny  Asit for your suggestions!

 Regards,
 Indy

 On Tue, Apr 21, 2015 at 5:55 PM, Danny Sinang d.sin...@gmail.com wrote:

 We had to take the following steps after we upgraded one of our DEV
 servers to ML8 :

 *1. Use marklogic-xcc-8.0.1.jar for XQSync and RecordLoader calls.*

 Using lower versions of ML xcc would cause the above tools to fail
 when syncing / loading records to an ML database.

 *2. Remove collation attribute in our sort-order search API options
 elements of type xs:int*

 Previous versions appear to be more forgiving in that they overlook
 the presence of the collation element for sort-order types of xs:int :

 sort-order direction=ascending type=xs:int collation=
 http://marklogic.com/collation/; xmlns=
 http://marklogic.com/appservices/search;element ns=
 name=qId//sort-order


 ML8 seems to be stricter.


 On Tue, Apr 21, 2015 at 6:30 AM, Indrajeet Verma 
 indrajeet.ve...@gmail.com wrote:

 Hi,

 We are upgrading ML6 to ML8 and gone through release notes of ML7  ML8
 for the incapability between 6 and 8.

 Just wondering if someone has done this activity already and could share
 his findings/suggestions.


 Thank you!

 ___
 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] Converting date format using xquery?

2015-04-21 Thread Indrajeet Verma
Hi Mark,

Could you try this. Hope this should replace your date value.

declare namespace xh=http://newnamespace/;;
for $t in (/xh:TABLE)/xh:CURRENTDATE
let $tt := $t/string
let $parts := fn:tokenize($t,  )
let $datepart := fn:tokenize($parts[1], /)
let $timestamp := fn:concat($datepart[3],-,
$datepart[1],-,$datepart[2],T,$parts[2])
return xdmp:node-replace($t/text(), text{$timestamp} )

Thank you!
Indrajeet

On Wed, Apr 22, 2015 at 2:07 AM, Mark Shanks markshanks...@hotmail.com
wrote:

 Hi,

 I have some data ingested into Marklogic, but found that marklogic cannot
 interpret dates in the form sql typically outputs, e.g., 03/17/2014
 09:55:22. Instead, it should be in the xml form 2014-04-30T05:30:41. I
 wrote the following xquery to convert all of the dates in the referenced
 column, but it puts the entry in as a node but marklogic doesn't recognize
 it as a node. What is going wrong?

 declare namespace xh=http://newnamespace/;;
 for $t in (/xh:TABLE)/xh:CURRENTDATE
 let $tt := $t/string
 let $parts := fn:tokenize($t,  )
 let $datepart := fn:tokenize($parts[1], /)
 let $timestamp := fn:concat($datepart[3],-,
 $datepart[1],-,$datepart[2],T,$parts[2])
 return xdmp:node-replace($t,
 text{fn:concat(CURRENTDATE,$timestamp,/CURRENTDATE)} )

 Note that I tried the element statement in the node-replace, but this
 would rewrite the node with an empty namespace. It wasn't clear to me how
 to reference the correct namespace. Is there also a general function to
 convert all dates in marklogic into xml format?

 Thanks.

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


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


[MarkLogic Dev General] Upgrade ML6 to ML8

2015-04-21 Thread Indrajeet Verma
Hi,

We are upgrading ML6 to ML8 and gone through release notes of ML7  ML8 for
the incapability between 6 and 8.

Just wondering if someone has done this activity already and could share
his findings/suggestions.


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 find particular element using path index

2015-04-13 Thread Indrajeet Verma
Thank you Geert for correcting me. I tried by excluding / ( e.g.
product-reference/product-id/date) from path index and it is working fine.

Could you please give some more reasons/suggestions why should we not use
/ or //?  as we tried with /  // and It was returning same result
as without these path separators.


Thank you!

On Mon, Apr 13, 2015 at 12:32 PM, Geert Josten geert.jos...@marklogic.com
wrote:

  Just a small addition: the expression that you provide to path indexes
 does not have to start with / nor with //. Compare it with XSLT match
 expressions, as opposed to XSLT select expressions.

  Kind regards,
 Geert

   From: Indrajeet Verma indrajeet.ve...@gmail.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Sunday, April 12, 2015 at 8:52 PM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] How to find particular element using
 path index

   Shashidhar - It's nice to hear that your problem solved. This should
 work with //product-reference/product-id/date as well. Main point is your
 path should point/return the value that you are trying to search/get.

  As per my understanding this should be proper XPath that is searchable.

 On Mon, Apr 13, 2015 at 1:11 AM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

   Thanks Indrajeet for the code. But as I look into your range path
 index admin ui configuration one thing I observed, you started from the
 root element and whereas I started in the from product reference. Probably
 you path is correct one i guess

  Maybe this is where I got it wrong , but do you really have to start
 from the root element say in this case I could start say
 //product-reference/product-id/date .


  But yes I think I forgot that product id.

  Thanks a lot

 On Mon, Apr 13, 2015 at 12:02 AM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

 My search values in java code

 QueryOptionsManager optionsMgr = client.newServerConfigManager()
 .newQueryOptionsManager();
 String optionXml = search:options 
 + xmlns:search='http://marklogic.com/appservices/search
 '
 + search:values name='datepath'
 + search:range collation='
 http://marklogic.com/collation/' type='xs:string'
 +
 search:path-index/product-reference/date/search:path-index +
 /search:range
 + /search:values + /search:options;

 StringHandle writeHandle = new StringHandle(optionXml);
 optionsMgr.writeOptions(datepath, writeHandle);

 QueryManager queryMgr = client.newQueryManager();
 ValuesDefinition query = queryMgr.newValuesDefinition(
 datepath,datepath);
 ValuesHandle values = queryMgr.values(query, new
 ValuesHandle());

   for (CountedDistinctValue value : values.getValues()) {
 String textValue = value.get(xs:string, String.class);
 System.out.println(textValue );
   }

 On Sun, Apr 12, 2015 at 11:19 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

  Sorry that was a typo from my side and yes I created the path index
 in admin ui
 constraint name='date'
 range collation='http://marklogic.com/collation/'
 type='xs:string' facet='false'
 path-index/product-reference/date/path-index
/range
  /constraint
  But still I could not get the results.
  Error : Local message: search failed: Bad Request. Server Message: null



 On Sun, Apr 12, 2015 at 9:43 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

Hi ,
 Below is the structure of my document. I want to find the date under
 the product-reference and not the date from the store-reference.

 XML-STRUCTURE

 product-reference
 product-id
 countryIND/country
 product-numberAA-503/product-number
 product-typeapparel/product-type
 date20130105/date
 /product-id
 /product-reference
 store-reference
 store-id
 countryJP/country
 store-number8369/store-number
 date20120906/date
 /store-id
 /store-reference

  I have create this optionsname as date-product and constraint as

 constraint name='date'
 range collation='http://marklogic.com/collation/'
 type='xs:string' facet='false'
 path-index/publication-reference/date/path-index
/range
  /constraint

  JAVA CODE

   QueryManager queryMgr = client.newQueryManager();
 ValuesDefinition query =
 queryMgr.newValuesDefinition(date-product,
 date);
   ValuesHandle values = queryMgr.values(query, new ValuesHandle());

 for (CountedDistinctValue value : values.getValues()) {
 String textValue = value.get(xs:string, String.class);
  System.out.println(textValue );
 }
  I am not getting any results.

  Am I missing something or could somebody correct my code or help me
 with how to find values with path-index with range element index I am
 getting the results.

  Thanks

Re: [MarkLogic Dev General] How to find particular element using path index

2015-04-13 Thread Indrajeet Verma
Thank you Geert!

On Mon, Apr 13, 2015 at 7:57 PM, Geert Josten geert.jos...@marklogic.com
wrote:

  Hi,

  Using / makes it work for only one path. Using // or nothing in front
 means the same. I don’t really have a preference myself..

  Cheers,
 Geert

   From: Indrajeet Verma indrajeet.ve...@gmail.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Monday, April 13, 2015 at 8:33 AM

 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] How to find particular element using
 path index

   Thank you Geert for correcting me. I tried by excluding / ( e.g.
 product-reference/product-id/date) from path index and it is working fine.

  Could you please give some more reasons/suggestions why should we not
 use / or //?  as we tried with /  // and It was returning same
 result as without these path separators.


  Thank you!

 On Mon, Apr 13, 2015 at 12:32 PM, Geert Josten geert.jos...@marklogic.com
  wrote:

  Just a small addition: the expression that you provide to path indexes
 does not have to start with / nor with //. Compare it with XSLT match
 expressions, as opposed to XSLT select expressions.

  Kind regards,
 Geert

   From: Indrajeet Verma indrajeet.ve...@gmail.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 
 Date: Sunday, April 12, 2015 at 8:52 PM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] How to find particular element
 using path index

   Shashidhar - It's nice to hear that your problem solved. This should
 work with //product-reference/product-id/date as well. Main point is your
 path should point/return the value that you are trying to search/get.

  As per my understanding this should be proper XPath that is searchable.

 On Mon, Apr 13, 2015 at 1:11 AM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

   Thanks Indrajeet for the code. But as I look into your range path
 index admin ui configuration one thing I observed, you started from the
 root element and whereas I started in the from product reference. Probably
 you path is correct one i guess

  Maybe this is where I got it wrong , but do you really have to start
 from the root element say in this case I could start say
 //product-reference/product-id/date .


  But yes I think I forgot that product id.

  Thanks a lot

 On Mon, Apr 13, 2015 at 12:02 AM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

 My search values in java code

 QueryOptionsManager optionsMgr = client.newServerConfigManager()
 .newQueryOptionsManager();
 String optionXml = search:options 
 + xmlns:search='
 http://marklogic.com/appservices/search'
 + search:values name='datepath'
 + search:range collation='
 http://marklogic.com/collation/' type='xs:string'
 +
 search:path-index/product-reference/date/search:path-index +
 /search:range
 + /search:values + /search:options;

 StringHandle writeHandle = new StringHandle(optionXml);
 optionsMgr.writeOptions(datepath, writeHandle);

 QueryManager queryMgr = client.newQueryManager();
 ValuesDefinition query = queryMgr.newValuesDefinition(
 datepath,datepath);
 ValuesHandle values = queryMgr.values(query, new
 ValuesHandle());

   for (CountedDistinctValue value : values.getValues()) {
 String textValue = value.get(xs:string, String.class);
 System.out.println(textValue );
   }

 On Sun, Apr 12, 2015 at 11:19 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

  Sorry that was a typo from my side and yes I created the path index
 in admin ui
 constraint name='date'
 range collation='http://marklogic.com/collation/'
 type='xs:string' facet='false'
 path-index/product-reference/date/path-index
/range
  /constraint
  But still I could not get the results.
  Error : Local message: search failed: Bad Request. Server Message:
 null



 On Sun, Apr 12, 2015 at 9:43 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

Hi ,
 Below is the structure of my document. I want to find the date under
 the product-reference and not the date from the store-reference.

 XML-STRUCTURE

 product-reference
 product-id
 countryIND/country
 product-numberAA-503/product-number
 product-typeapparel/product-type
 date20130105/date
 /product-id
 /product-reference
 store-reference
 store-id
 countryJP/country
 store-number8369/store-number
 date20120906/date
 /store-id
 /store-reference

  I have create this optionsname as date-product and constraint as

 constraint name='date'
 range collation='http://marklogic.com/collation/'
 type='xs:string' facet='false'
 path-index/publication-reference/date/path-index
/range
  /constraint

  JAVA CODE

   QueryManager queryMgr = client.newQueryManager

Re: [MarkLogic Dev General] How to find particular element using path index

2015-04-12 Thread Indrajeet Verma
Shashidhar - I think, your path range index is not right.

I did below steps and showing result. Please see if this helps.

XML-
---
product
  product-reference
product-id
  countryIND/country
  product-numberAA-503/product-number
  product-typeapparel/product-type
  date20130105/date
/product-id
  /product-reference
  store-reference
store-id
  countryJP/country
  store-number8369/store-number
  date20120906/date
/store-id
  /store-reference
/product



CODE-
--
import module namespace search = http://marklogic.com/appservices/search;
at /MarkLogic/appservices/search/search.xqy;

declare variable $OPTIONS :=
 options xmlns=http://marklogic.com/appservices/search;
 values name=datepath
 range type=xs:string
path-index/product/product-reference/product-id/date/path-index
   /range
/values
return-valuestrue/return-values
/options ;

let $options :=
options xmlns=http://marklogic.com/appservices/search;
{$OPTIONS/*}
/options
let $search-results := search:values('datepath', $options)
return $search-results

RESULT-
---
values-response name=datepath type=xs:string xmlns=
http://marklogic.com/appservices/search; xmlns:xs=
http://www.w3.org/2001/XMLSchema;
  distinct-value frequency=120130105/distinct-value
  metrics
values-resolution-timePT0.001S/values-resolution-time
total-timePT0.002S/total-time
  /metrics
/values-response

Range Index-
-

[image: Inline image 1]


On Mon, Apr 13, 2015 at 12:15 AM, Erik Hennum erik.hen...@marklogic.com
wrote:

  Hi, Shashidhar:

 Does the configuration of the path index in the Admin UI specify the same
 data type (string with the same collation)?

 If so, it might be time to add search:debugtrue/search:debug to the
 options and get the response with a string handle so you can see what's
 being executed on the server.


   Erik Hennum

--
 *From:* general-boun...@developer.marklogic.com [
 general-boun...@developer.marklogic.com] on behalf of Shashidhar Rao [
 raoshashidhar...@gmail.com]
 *Sent:* Sunday, April 12, 2015 11:32 AM
 *To:* general@developer.marklogic.com
 *Subject:* Re: [MarkLogic Dev General] How to find particular element
 using path index

   My search values in java code

 QueryOptionsManager optionsMgr = client.newServerConfigManager()
 .newQueryOptionsManager();
 String optionXml = search:options 
 + xmlns:search='http://marklogic.com/appservices/search
 '
 + search:values name='datepath'
 + search:range collation='
 http://marklogic.com/collation/' type='xs:string'
 +
 search:path-index/product-reference/date/search:path-index +
 /search:range
 + /search:values + /search:options;

 StringHandle writeHandle = new StringHandle(optionXml);
 optionsMgr.writeOptions(datepath, writeHandle);

 QueryManager queryMgr = client.newQueryManager();
 ValuesDefinition query = queryMgr.newValuesDefinition(
 datepath,datepath);
 ValuesHandle values = queryMgr.values(query, new
 ValuesHandle());

   for (CountedDistinctValue value : values.getValues()) {
 String textValue = value.get(xs:string, String.class);
 System.out.println(textValue );
   }

 On Sun, Apr 12, 2015 at 11:19 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

  Sorry that was a typo from my side and yes I created the path index in
 admin ui
 constraint name='date'
 range collation='http://marklogic.com/collation/' type='xs:string'
 facet='false'
 path-index/product-reference/date/path-index
/range
  /constraint
  But still I could not get the results.
  Error : Local message: search failed: Bad Request. Server Message: null



 On Sun, Apr 12, 2015 at 9:43 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

Hi ,
 Below is the structure of my document. I want to find the date under the
 product-reference and not the date from the store-reference.

 XML-STRUCTURE

 product-reference
 product-id
 countryIND/country
 product-numberAA-503/product-number
 product-typeapparel/product-type
 date20130105/date
 /product-id
 /product-reference
 store-reference
 store-id
 countryJP/country
 store-number8369/store-number
 date20120906/date
 /store-id
 /store-reference

  I have create this optionsname as date-product and constraint as

 constraint name='date'
 range collation='http://marklogic.com/collation/' type='xs:string'
 facet='false'
 path-index/publication-reference/date/path-index
/range
  /constraint

  JAVA CODE

   QueryManager queryMgr = client.newQueryManager();
 ValuesDefinition query =
 queryMgr.newValuesDefinition(date-product,
 date);
   ValuesHandle values = queryMgr.values(query, new ValuesHandle());

 for (CountedDistinctValue value : 

Re: [MarkLogic Dev General] How to find particular element using path index

2015-04-12 Thread Indrajeet Verma
Shashidhar - It's nice to hear that your problem solved. This should work
with //product-reference/product-id/date as well. Main point is your path
should point/return the value that you are trying to search/get.

As per my understanding this should be proper XPath that is searchable.

On Mon, Apr 13, 2015 at 1:11 AM, Shashidhar Rao raoshashidhar...@gmail.com
wrote:

 Thanks Indrajeet for the code. But as I look into your range path index
 admin ui configuration one thing I observed, you started from the root
 element and whereas I started in the from product reference. Probably you
 path is correct one i guess

 Maybe this is where I got it wrong , but do you really have to start from
 the root element say in this case I could start say
 //product-reference/product-id/date .


 But yes I think I forgot that product id.

 Thanks a lot

 On Mon, Apr 13, 2015 at 12:02 AM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

 My search values in java code

 QueryOptionsManager optionsMgr = client.newServerConfigManager()
 .newQueryOptionsManager();
 String optionXml = search:options 
 + xmlns:search='http://marklogic.com/appservices/search
 '
 + search:values name='datepath'
 + search:range collation='
 http://marklogic.com/collation/' type='xs:string'
 +
 search:path-index/product-reference/date/search:path-index +
 /search:range
 + /search:values + /search:options;

 StringHandle writeHandle = new StringHandle(optionXml);
 optionsMgr.writeOptions(datepath, writeHandle);

 QueryManager queryMgr = client.newQueryManager();
 ValuesDefinition query = queryMgr.newValuesDefinition(
 datepath,datepath);
 ValuesHandle values = queryMgr.values(query, new
 ValuesHandle());

   for (CountedDistinctValue value : values.getValues()) {
 String textValue = value.get(xs:string, String.class);
 System.out.println(textValue );
   }

 On Sun, Apr 12, 2015 at 11:19 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

 Sorry that was a typo from my side and yes I created the path index in
 admin ui
 constraint name='date'
 range collation='http://marklogic.com/collation/' type='xs:string'
 facet='false'
 path-index/product-reference/date/path-index
/range
  /constraint
 But still I could not get the results.
 Error : Local message: search failed: Bad Request. Server Message: null



 On Sun, Apr 12, 2015 at 9:43 PM, Shashidhar Rao 
 raoshashidhar...@gmail.com wrote:

 Hi ,
 Below is the structure of my document. I want to find the date under
 the product-reference and not the date from the store-reference.

 XML-STRUCTURE

 product-reference
 product-id
 countryIND/country
 product-numberAA-503/product-number
 product-typeapparel/product-type
 date20130105/date
 /product-id
 /product-reference
 store-reference
 store-id
 countryJP/country
 store-number8369/store-number
 date20120906/date
 /store-id
 /store-reference

 I have create this optionsname as date-product and constraint as

 constraint name='date'
 range collation='http://marklogic.com/collation/'
 type='xs:string' facet='false'
 path-index/publication-reference/date/path-index
/range
  /constraint

 JAVA CODE

   QueryManager queryMgr = client.newQueryManager();
 ValuesDefinition query =
 queryMgr.newValuesDefinition(date-product,
 date);
   ValuesHandle values = queryMgr.values(query, new ValuesHandle());

 for (CountedDistinctValue value : values.getValues()) {
 String textValue = value.get(xs:string, String.class);
  System.out.println(textValue );
 }
 I am not getting any results.

 Am I missing something or could somebody correct my code or help me
 with how to find values with path-index with range element index I am
 getting the results.

 Thanks






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


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


Re: [MarkLogic Dev General] last inserted or modified document

2015-04-09 Thread Indrajeet Verma
Sudhakar,

I saw a very useful code by using  built in xdmp:document index if you
create file name in sequence. Please see the link that Asit shared with you.

However I am not sure if this will be fit in you requirement.

Code looks like, This code is written by jimfuller2012
https://disqus.com/by/jimfuller2012/

let $startVal := /restaurant/115.xml
let $endVal := /restaurant/121.xml
return
cts:uris( $startVal, (document,item-order), cts:and-query((
cts:directory-query(/, infinity),
cts:element-range-query( xs:QName(xdmp:document), =, $endVal,
collation=http://marklogic.com/collation...
http://marklogic.com/collation/codepoint)
)) )

I see cts:uri-match() also very useful by using bulit-in index.

However I would recommend you to use/create date-modified in your data
model for individual document and use cts:query() inside cts:uri() or
cts:uri-match() to get latest document without enabling uri-lexicon and
creating extra range index if possible.  Though if you have already
date-modified element in your data model, creating range index for this
will help to improve performance.


On Thu, Apr 9, 2015 at 1:03 PM, Sudhakar Reddy sudhakar.re...@marklogic.com
 wrote:

  Thanks Asit. I’ll try that.

   From: Asitmohan Nautiyal asitmoha...@hcl.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Thursday, April 9, 2015 at 12:17 AM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: Re: [MarkLogic Dev General] last inserted or modified document

   Hi Sudhakar,



 Yes, You can get is very easily. You can use cts:uris() function and
 inside the function( as third argument) you can use element-value-query for
 element “prop:last-modified” with your value.



 NOTE : This function requires the uri-lexicon database configuration
 parameter to be enabled and also create range index for prop:last-modified
 for great performance.



 Please refer https://docs.marklogic.com/cts:uris?q=cts:urisv=8.0api=true



 Regards,

 Asit Nautiyal



 *From:* general-boun...@developer.marklogic.com [
 mailto:general-boun...@developer.marklogic.com
 general-boun...@developer.marklogic.com] *On Behalf Of *Sudhakar Reddy
 *Sent:* 09 April 2015 12:35
 *To:* MarkLogic Developer Discussion
 *Subject:* [MarkLogic Dev General] last inserted or modified document



 Hi,



 Is there a straight forward way to get the document URI of the last
 document that was inserted or modified?



 Thanks

 Sudhakarprop:last-modified





 ::DISCLAIMER::

 

 The contents of this e-mail and any attachment(s) are confidential and
 intended for the named recipient(s) only.
 E-mail transmission is not guaranteed to be secure or error-free as
 information could be intercepted, corrupted,
 lost, destroyed, arrive late or incomplete, or may contain viruses in
 transmission. The e mail and its contents
 (with or without referred errors) shall therefore not attach any liability
 on the originator or HCL or its affiliates.
 Views or opinions, if any, presented in this email are solely those of the
 author and may not necessarily reflect the
 views or opinions of HCL or its affiliates. Any form of reproduction,
 dissemination, copying, disclosure, modification,
 distribution and / or publication of this message without the prior
 written consent of authorized representative of
 HCL is strictly prohibited. If you have received this email in error
 please delete it and notify the sender immediately.
 Before opening any email and/or attachments, please check them for viruses
 and other defects.


 

 ___
 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] text() Vs String() Vs data()

2015-04-09 Thread Indrajeet Verma
I used $x//text() in place of $x/text()  as it try to get text from a
direct child of the context element. i.e. head. that is the reason you are
not seeing any result.

If you add any text inside head then your $x/text() will return the
result.

If you have to check the text present in any level, you need to use //.

Use data and string like below,

Please correct somebody if I am wrong here.

let $x :=
head xmlns=http://www.w3.org/1999/xhtml;
script type=text/javascript/script
title /title
/head
return data($x/node()[fn:normalize-space(.) ne ''])


let $x :=
head xmlns=http://www.w3.org/1999/xhtml;
script type=text/javascript/script
title /title
/head
return string($x/node()[fn:normalize-space(.) ne ''])

Please note, performance will be poor in these cases

Please don't use $x//string() or $x//data(), It will give you multiple
results based on element hierarchy.

On Thu, Apr 9, 2015 at 1:17 PM, Indrajeet Verma indrajeet.ve...@gmail.com
wrote:

 Rahul - I am not completely sure on your question however could you try
 below code and see if this helps,

 let $x :=
 head xmlns=http://www.w3.org/1999/xhtml;
 script type=text/javascript/script
 title/title
 /head
 return $x//text()[fn:normalize-space(.) ne '']



 On Thu, Apr 9, 2015 at 1:05 PM, Asitmohan Nautiyal asitmoha...@hcl.com
 wrote:

  Hi Rahul,



 Please refer below link for your clarification written by David log back
 ago :



 http://blog.davidcassel.net/2011/06/text-fnstring-and-fndata/





 Regards,

 Asit Nautiyal

 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Rahul Gupta
 *Sent:* 09 April 2015 12:41
 *To:* general@developer.marklogic.com
 *Subject:* [MarkLogic Dev General] text() Vs String() Vs data()



 I have come across a problem. I want to check here whether the given xml
 contains any kind of text. I don’t want any output if any of the children
 doesn’t have any text. Like in the example given, it should not give me
 anything.

 let $x :=

 head xmlns=http://www.w3.org/1999/xhtml;

 script type=text/javascript/script

 title/title

 /head

 (1) $x/text() will yield nothing. But if I change Hi David, then also it
 is returning nothing since text() works on the self-node. That’s fine.

 (2) $x/string() will yield something but dont know what? I was expecting
 it should not give me anything in the example mentioned. Can you please
 help?

 (3) $x/data gives “XDMP-NONMIXEDCOMPLEXCONT: Node has complex type with
 non-mixed complex content.” since the head node is under some namespace
 {WHY??}. Removing the namespace solves this error but behaving same like
 string.



 Thanks  Regards,

 Rahul



 ::DISCLAIMER::

 

 The contents of this e-mail and any attachment(s) are confidential and
 intended for the named recipient(s) only.
 E-mail transmission is not guaranteed to be secure or error-free as
 information could be intercepted, corrupted,
 lost, destroyed, arrive late or incomplete, or may contain viruses in
 transmission. The e mail and its contents
 (with or without referred errors) shall therefore not attach any
 liability on the originator or HCL or its affiliates.
 Views or opinions, if any, presented in this email are solely those of
 the author and may not necessarily reflect the
 views or opinions of HCL or its affiliates. Any form of reproduction,
 dissemination, copying, disclosure, modification,
 distribution and / or publication of this message without the prior
 written consent of authorized representative of
 HCL is strictly prohibited. If you have received this email in error
 please delete it and notify the sender immediately.
 Before opening any email and/or attachments, please check them for
 viruses and other defects.


 

 ___
 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] text() Vs String() Vs data()

2015-04-09 Thread Indrajeet Verma
Rahul - I am not completely sure on your question however could you try
below code and see if this helps,

let $x :=
head xmlns=http://www.w3.org/1999/xhtml;
script type=text/javascript/script
title/title
/head
return $x//text()[fn:normalize-space(.) ne '']



On Thu, Apr 9, 2015 at 1:05 PM, Asitmohan Nautiyal asitmoha...@hcl.com
wrote:

  Hi Rahul,



 Please refer below link for your clarification written by David log back
 ago :



 http://blog.davidcassel.net/2011/06/text-fnstring-and-fndata/





 Regards,

 Asit Nautiyal

 *From:* general-boun...@developer.marklogic.com [mailto:
 general-boun...@developer.marklogic.com] *On Behalf Of *Rahul Gupta
 *Sent:* 09 April 2015 12:41
 *To:* general@developer.marklogic.com
 *Subject:* [MarkLogic Dev General] text() Vs String() Vs data()



 I have come across a problem. I want to check here whether the given xml
 contains any kind of text. I don’t want any output if any of the children
 doesn’t have any text. Like in the example given, it should not give me
 anything.

 let $x :=

 head xmlns=http://www.w3.org/1999/xhtml;

 script type=text/javascript/script

 title/title

 /head

 (1) $x/text() will yield nothing. But if I change Hi David, then also it
 is returning nothing since text() works on the self-node. That’s fine.

 (2) $x/string() will yield something but dont know what? I was expecting
 it should not give me anything in the example mentioned. Can you please
 help?

 (3) $x/data gives “XDMP-NONMIXEDCOMPLEXCONT: Node has complex type with
 non-mixed complex content.” since the head node is under some namespace
 {WHY??}. Removing the namespace solves this error but behaving same like
 string.



 Thanks  Regards,

 Rahul



 ::DISCLAIMER::

 

 The contents of this e-mail and any attachment(s) are confidential and
 intended for the named recipient(s) only.
 E-mail transmission is not guaranteed to be secure or error-free as
 information could be intercepted, corrupted,
 lost, destroyed, arrive late or incomplete, or may contain viruses in
 transmission. The e mail and its contents
 (with or without referred errors) shall therefore not attach any liability
 on the originator or HCL or its affiliates.
 Views or opinions, if any, presented in this email are solely those of the
 author and may not necessarily reflect the
 views or opinions of HCL or its affiliates. Any form of reproduction,
 dissemination, copying, disclosure, modification,
 distribution and / or publication of this message without the prior
 written consent of authorized representative of
 HCL is strictly prohibited. If you have received this email in error
 please delete it and notify the sender immediately.
 Before opening any email and/or attachments, please check them for viruses
 and other defects.


 

 ___
 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] Data size and forest

2015-04-01 Thread Indrajeet Verma
Hi Sudhakar,

As per MarkLogic Documentation (I took below information from
the inside-marklogic-server-r7.pdf).

A single machine may manage several forests, or in a cluster (when acting
as an E-node, an evaluator) it might manage none. Forests can be queried in
parallel, so placing more forests on a multi-core server can help with
concurrency. Depending on the workload, you might have one forest
corresponding to every physical core on a box, or sometimes a forest for
every two cores, with each forest holding millions or tens of millions of
documents and perhaps a hundred gigabytes. In a clustered environment, you
can have a set of servers, each managing their own set of forests, all
unified into a single database

However as per my experience, number of documents should be less in the
forest for better performance. Data must be distribute evenly in all the
nodes in your clustered environment. ML7 has built-in feature. you have to
select appropriate settings only.

For long Database, make sure merging policy is also defined properly.

Please read the PDF for more information,

https://developer.marklogic.com/pubs/architecture/inside-marklogic-server-r7.pdf

Hope this helps!

Thank You!



On Wed, Apr 1, 2015 at 2:03 PM, Shashidhar Rao raoshashidhar...@gmail.com
wrote:

 Hi,

 Can someone help me with configuring the optimum number of Forests for a
 database . Details below

 Size of data is 1 TB. Format all xml files.

 I would like to know which one will be better option

 1. 1 database say testdb and default forest- I think this would be slow.
 2.  1 database and say ( here how many forest should I create to extract
 maximum performance )
 What criteria should I decide to create the number of forest . I am
 thinking of 250GB per forest so around 4-5 forest. Is it correct?

 Please let me know.

 Thanks
 sd

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


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


Re: [MarkLogic Dev General] how to get values whose frequency greater than 1

2015-04-01 Thread Indrajeet Verma
Hi Mani,

Did you try in this way,

for $item in cts:element-values(xs:QName(a),1,())
where cts:frequency($item) 1
return $item




On Wed, Apr 1, 2015 at 8:05 PM, manimaran...@cognizant.com wrote:

  Hi,



 Is there any option (in any of these  cts:element-values,
 cts:element-value-co-occurences) to return only the fragments whose
 frequency is greater than 1 .



 *For example* :suppose the below root fragments, in where element ‘a’ is
 indexed. I need only the result ‘vala’ using cts:element-values with
 cts:frequency .



 1.root

 avala/a

 bvalb/b

 cvalc/c

 /root



 2. root

 a vala /a

 b valb /b

 c valc /c

 /root



 2. root

 avalues/a

 b valb /b

 c valc /c

 /root



 If it is not possible in any of these cts:element-values,
 cts:element-value-co-occurences,using which API I can achieve the above
 result?





 Thanks,

 Manimaran D S
  This e-mail and any files transmitted with it are for the sole use of the
 intended recipient(s) and may contain confidential and privileged
 information. If you are not the intended recipient(s), please reply to the
 sender and destroy all copies of the original message. Any unauthorized
 review, use, disclosure, dissemination, forwarding, printing or copying of
 this email, and/or any action taken in reliance on the contents of this
 e-mail is strictly prohibited and may be unlawful. Where permitted by
 applicable law, this e-mail and other e-mail communications sent to and
 from Cognizant e-mail addresses may be monitored.

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


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


Re: [MarkLogic Dev General] XDMP-LOCKED Roxy Deployment

2015-03-27 Thread Indrajeet Verma
Hi Abhishek,

For me, I created a below role and its working without any problem.
Modified default.properties/local.properties accordingly. We used to do
daily deployment and have no issues so far. Can you try it and see if this
helps.

local.properties

app-role=XYZ-Role

ML Security

alert-user

Executive compartment,

any-collectionany-uri

xdmp:valuexdmp:with-namespaces
xdmp:invokexdmp:invoke-in
xdmp:xslt-invoke


*role name (capability)*[Keep]XYZ-Role (read)XYZ-Role (insert)XYZ-Role
(update)XYZ-Role (execute)


On Fri, Mar 27, 2015 at 6:12 AM, abhishek.srivas...@cognizant.com wrote:

  Hi Geert,

  Its just xQuery file deployment using Roxy, Following privilege has been
 give to the role deploying xquery files [app-role in Roxy properties file]

  Inherited Role:
 manage-user, rest-admin

  Executive privilege:
 unprotected-uri, unprotected-collections, xdmp-invoke, xslt-eval,
 xdmp-value

  Looks like update permission of the xQuery file is causing locking since
 first time insert is working fine - but not sure about that.

  Thanks
 Abhishek

  --
 *From:* general-boun...@developer.marklogic.com [
 general-boun...@developer.marklogic.com] on behalf of Geert Josten [
 geert.jos...@marklogic.com]
 *Sent:* Thursday, March 26, 2015 4:02 AM
 *To:* MarkLogic Developer Discussion
 *Subject:* Re: [MarkLogic Dev General] XDMP-LOCKED Roxy Deployment

   Hi Abhishek,

  Bootstrap uses admin: and sec: functions. Those require a whole bunch of
 privs. I am kind of guessing that you are referring to deploying modules
 and content though. That should only require the priv to run through xcc,
 and permission to insert in the given uri/collection. The XDMP-LOCKED
 surprises me a bit, since I am unaware of Roxy acquiring locks explicitly
 itself.

  Can you confirm whether it concerned bootstrap of deploy modules, and
 can you also give more details about the no-admin user? Did you assign
 privs/roles?

  Kind regards,
 Geert

   From: abhishek.srivas...@cognizant.com 
 abhishek.srivas...@cognizant.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Thursday, March 26, 2015 at 1:14 AM
 To: general@developer.marklogic.com general@developer.marklogic.com
 Subject: [MarkLogic Dev General] XDMP-LOCKED Roxy Deployment

   Hi All,



 I am doing Roxy deployment using no-admin user. First time deployment of
 XQuery files went well but next successive deployment is throwing
 XDMP-LOCKED Document or directory is locked exception.



 Not sure If I am missing any special privilege or permission to deployer
 role.



 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.
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] Empty Results

2015-03-27 Thread Indrajeet Verma
Hi Pragya,

If you are using XSLT, please try below code and see if this helps,

 xsl:template match=@*|node()
xsl:choose
xsl:when test=descendant-or-self::text()[normalize-space(.)
ne '']
xsl:copy
xsl:apply-templates select=@* | node()/
/xsl:copy
/xsl:when
xsl:otherwise/
/xsl:choose
/xsl:template

Thank you!

On Fri, Mar 27, 2015 at 5:43 PM, Dave Cassel dave.cas...@marklogic.com
wrote:

  Pragya, you can do that using XSL or recursive descent in XQuery
 http://blog.davidcassel.net/2014/01/recursive-descent-in-xquery/. The
 typeswitch case would look something like:

  case element() return
   let $children := $node/node() ! local:change(.)
   return
 if (fn:exists($children)) then
   element { fn:node-name($node) } {
 $node/@*,
 $children
   }
 else ()
 …

  --
  Dave Cassel
 Developer Community Manager
 MarkLogic Corporation http://www.marklogic.com/
 MarkLogic World - San Francisco April 13 - 17
 http://world.marklogic.com/locations/san-francisco/


   From: Kapoor, Pragya pkapo...@innodata.com
 Reply-To: MarkLogic Developer Discussion general@developer.marklogic.com
 Date: Friday, March 27, 2015 at 7:53 AM
 To: MarkLogic Developer Discussion general@developer.marklogic.com
 Subject: [MarkLogic Dev General] Empty Results

Hi,


  I want to remove the empty result element from the dynamic xml.


  For example:

 In the below xml, I want to exclude the element(which has no values) The
 element name are not fixed as this xml is dynamically created.


  Exclude the below exlemnt
 result
  Currency/
  /result

  dynamic.xml:
  report
 columns
 titleCurrency/title
 /columns
 results
 result
 Currency/
 /result
 result
 Currency/
 /result
 result
 Currency/
 /result
 result
 CurrencyPound sterling/Currency
 /result
 result
 Currency/
 /result
 result
 CurrencyPound sterling/Currency
 /result
 /results
 /report


  Excepted output:

   report
  columns
  titleCurrency/title
  /columns
  results
  ​CurrencyPound sterling/Currency
  /result
  result
  CurrencyPound sterling/Currency
  /result
  /results
  /report

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


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