[MarkLogic Dev General] Pipeline Error - Module not Found

2013-02-18 Thread sini narayanan
Hi All,

I have a DB named "ENV-Production".
And created an application "ENV-Production-Application" using app builder.

>From the application, when user clicks on a submit button, a new document
is inserted into DB.
The new document is geting inserted into the Content Source :
ENV-Production(ENV-Production-Application)

A pipeline is configured to the DB "ENV-Production".
The pipeline calls a module, that performs search:resolve on a json
transformed query.

Till this step everything is fine.

But, when in the pipeline, it is hitting the following error.
XDMP-MODNOTFOUND: (err:XQST0059) Module /application/constraint/geo.xqy not
found

In the pipeline module, I have the given all the search:options taken from
the v1/config/query/all.
Which include the following


 
http://marklogic.com/appservices/viz/geo";
at="/application/constraint/geo.xqy"/>
http://marklogic.com/appservices/viz/geo";
at="/application/constraint/geo.xqy"/>
http://marklogic.com/appservices/viz/geo";
at="/application/constraint/geo.xqy"/>
limit=1
gridded
 
 






 



How do I reslove the Error ?
The actual file it is referring to is the geo.xqy under the
"ENV-Production-Application-modules".


The same xquery code (pipeline module code) when executed in the QC was
working fine. It dint throw any error as above.


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


Re: [MarkLogic Dev General] (no subject)

2013-02-18 Thread Damon Feldman
Varun,

I sounds like you are running many searches (one per result) rather than one 
search, which will be N times slower, or worse.

You can use the transform=raw option in search:search() to return the entire 
document, then use XPath to find the portion you want, or build a custom 
transform to return the section you want.

Alternatively, since you have already figured out cts:search() (nice work) you 
can use that directly. cts:search underlies search:search() and is less 
sophisticated but naturally returns portions of documents rather than 
fully-formed search result structures.

If you post a working query we can give more specific advice.

Yours,
Damon

--
Damon Feldman
Sr. Principal Consultant, MarkLogic


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Varun Varunesh
Sent: Monday, February 18, 2013 12:01 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] (no subject)

Hi All,
I have written one search xqy which basically returns me a XML document. My ML 
database contains XML documents which structure is predefined i.e. like this

  sec data
<\sec>

What i did it.
1)  I am first searching for those document in my database which contains the 
searching string using search:search()
2)  Then for each document returned by search:search(), I am using cts:search() 
to take only that section in my result
But this xqy is taking more time as we are expecting. Is there any other way to 
do this...?

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


Re: [MarkLogic Dev General] range index on timestamp for unique date

2013-02-18 Thread Gary Larsen
Hi Brent,

 

Had to use a distinct-values() but since this is working with an index
should still be quick and avoid tree cache errors:

 

for $d in
fn:distinct-values(xs:date(cts:element-values(xs:QName('timestamp'

 

and able to use a filter on the query:

 

cts:element-value-query(xs:QName("timestamp"), concat(xs:string($d), '*'))

 

Thanks for the help!

 

Gary Larsen

Envisn Inc.

508 259-6465

 

From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Brent Hartwig
Sent: Monday, February 18, 2013 3:05 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] range index on timestamp for unique
date

 

Hi, Gary,

 

You could cast from dateTime to date, using the range index:

 

xquery version "1.0-ml";
xs:date(
   cts:element-values(
  fn:QName(
 "http://www.rsuitecms.com/rsuite/ns/materialized-view";, 
 "last-modified")))

I thought perhaps one could create two indexes against the same data with
different, yet compatible scalar types.  But when I defined another index of
type date against this data, cts:element-values() returned an empty
sequence.

 

-Brent

 

From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gary Larsen
Sent: Monday, February 18, 2013 2:46 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] range index on timestamp for unique date

 

Hi,

 

The documents I'm after have a timestamp element formatted like this:
2013-02-13T14:51:19.373

 

I need a list of distinct dates so that I can run a query on each date.
What I'm trying to avoid is using distinct-values() on the full result set
as that can be very large (and cause tree cache errors):

fn:distinct-values(for $a in $actions return
xs:date(xs:dateTime($a/nv:timestamp)))

 

Is it possible to make a range or field index with a function to convert to
date?  Tried a range index with scalar type of date but cts:element-values()
returns distinct date-time values.  The only solution I can think of is to
insert a date element all the docs.

 

Thanks for any advice.

 

Gary

 

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


Re: [MarkLogic Dev General] range index on timestamp for unique date

2013-02-18 Thread Brent Hartwig
Hi, Gary,

You could cast from dateTime to date, using the range index:

xquery version "1.0-ml";
xs:date(
   cts:element-values(
  fn:QName(
 "http://www.rsuitecms.com/rsuite/ns/materialized-view";,
 "last-modified")))

I thought perhaps one could create two indexes against the same data with 
different, yet compatible scalar types.  But when I defined another index of 
type date against this data, cts:element-values() returned an empty sequence.

-Brent

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gary Larsen
Sent: Monday, February 18, 2013 2:46 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] range index on timestamp for unique date

Hi,

The documents I'm after have a timestamp element formatted like this:  
2013-02-13T14:51:19.373

I need a list of distinct dates so that I can run a query on each date.  What 
I'm trying to avoid is using distinct-values() on the full result set as that 
can be very large (and cause tree cache errors):
fn:distinct-values(for $a in $actions return 
xs:date(xs:dateTime($a/nv:timestamp)))

Is it possible to make a range or field index with a function to convert to 
date?  Tried a range index with scalar type of date but cts:element-values() 
returns distinct date-time values.  The only solution I can think of is to 
insert a date element all the docs.

Thanks for any advice.

Gary

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


[MarkLogic Dev General] range index on timestamp for unique date

2013-02-18 Thread Gary Larsen
Hi,

 

The documents I'm after have a timestamp element formatted like this:
2013-02-13T14:51:19.373

 

I need a list of distinct dates so that I can run a query on each date.
What I'm trying to avoid is using distinct-values() on the full result set
as that can be very large (and cause tree cache errors):



fn:distinct-values(for $a in $actions return
xs:date(xs:dateTime($a/nv:timestamp)))

 

Is it possible to make a range or field index with a function to convert to
date?  Tried a range index with scalar type of date but cts:element-values()
returns distinct date-time values.  The only solution I can think of is to
insert a date element all the docs.

 

Thanks for any advice.

 

Gary

 

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


Re: [MarkLogic Dev General] (no subject)

2013-02-18 Thread Eric Bloch
There are a number of reasons why a your script is slow, so it's hard to tell 
without more detail.

- If you just do search:search, is it still slow?  Or is that part fast?   How 
many results are you getting?
- What are you trying to accomplish with the cts:search in (2) ?

Eric

On Feb 18, 2013, at 9:00 AM, Varun Varunesh 
 wrote:

> Hi All,
> I have written one search xqy which basically returns me a XML document. My 
> ML database contains XML documents which structure is predefined i.e. like 
> this  
> 
>   sec data
> <\sec>
> 
> What i did it.
> 1)  I am first searching for those document in my database which contains the 
> searching string using search:search()
> 2)  Then for each document returned by search:search(), I am using 
> cts:search() to take only that section in my result
> 
> But this xqy is taking more time as we are expecting. Is there any other way 
> to do this...?   
> 
> ___
> 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


[MarkLogic Dev General] (no subject)

2013-02-18 Thread Varun Varunesh
Hi All,
I have written one search xqy which basically returns me a XML document. My
ML database contains XML documents which structure is predefined i.e. like
this

  sec data
<\sec>

What i did it.
1)  I am first searching for those document in my database which contains
the searching string using search:search()
2)  Then for each document returned by search:search(), I am using
cts:search() to take only that section in my result

But this xqy is taking more time as we are expecting. Is there any other
way to do this...?
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] mandatory constraint in search:search

2013-02-18 Thread Erik Hennum
Hi, Rajesh:

The default element for term specifies a default treatment for terms that 
aren't qualified by a constraint.  The empty element specifies the treatment 
when the criteria consists of the empty string.  Making a constraint mandatory 
in the criteria is a different requirement.

One solution would be to search in three steps:

1.  Use search:parse() with "search:query" output to produce a search:query 
structure.
2.  Use an XPath to check for the required constraint query in the structure 
and fail if not found.
3.  Otherwise, use search:resolve-nodes() to execute the parsed query.

To take this approach in the REST API, you could create a resource service 
extension.


Hoping that's useful,


Erik Hennum


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Rajesh Kumar 
[rajava...@gmail.com]
Sent: Monday, February 18, 2013 5:39 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] mandatory constraint in search:search

Hi,

How to make a constraint(“coll”) mandatory in search:options while performing 
search:search

Ex:
   search:search("Book AND coll:abc",http://marklogic.com/appservices/search";>


 

   )
The above query should fetch me the results

  search:search("Book",http://marklogic.com/appservices/search";>


 

   )
This Query should return empty results.

We tried using below code snippet but not working, Please suggest the soultion.

  




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


Re: [MarkLogic Dev General] search:page-length

2013-02-18 Thread Damon Feldman
You should set that option to the largest number of documents your overall 
system or user can comfortably handle - at some point you will exceed various 
timeouts, exhaust memory, overwhelm your users, or cause system failures at all 
layers of your architecture (including but not limited to MarkLogic).

Which is really another way of saying that for very large results you want to 
use paging, so the page size parameter is always there for this API. If you are 
"displaying all search results" to a human per your email below, you probably 
want to limit to a couple hundred, since users usually won't want to deal with 
more than that efficiently, and probably more like 20.

Damon

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of sini narayanan
Sent: Monday, February 18, 2013 4:53 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] search:page-length

Hi All,

In the search:options (v1/config/query/all), how do I set the 
 value to display all the search results. Instead of giving 
a numeric value like 10 or 100, how do I set it to as many as the number of 
results.


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


Re: [MarkLogic Dev General] search:page-length

2013-02-18 Thread Erik Hennum
Hi, Sini:

The page length is typed as xs:unsignedLong, so you could just pass in the 
maximum value, which is 18446744073709551615:

   http://www.w3.org/TR/xmlschema-2/#unsignedLong


Hoping that helps,


Erik Hennum


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of sini narayanan 
[sini.isonl...@gmail.com]
Sent: Monday, February 18, 2013 1:52 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] search:page-length

Hi All,

In the search:options (v1/config/query/all), how do I set the 
 value to display all the search results. Instead of giving 
a numeric value like 10 or 100, how do I set it to as many as the number of 
results.


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


Re: [MarkLogic Dev General] Triggers Handling : Directory scope constraint and collection

2013-02-18 Thread Damon Feldman
Stéphane,

You are correct that properties and collections are conceptually similar but 
different mechanisms. You can use either one, but with different advantages and 
disadvantages. 

Properties are more expressive and don't cause document triggers to fire when 
updated. Properties fragments can be arbitrary XML documents though the 
xdmp:document-add-properties() and related functions use properties in a way 
that looks more like collections.

Collections are a bit faster and easier to query and cause document triggers to 
fire when changed.

>From a coding perspective, I see triggers used sometimes when
1) People are used to that being the only way to detect changes in a database
2) The .xqy code to update or add documents is too complex to reliably handle 
all updates in code without a trigger

As a design approach, I suggest all your updates should come in through a clean 
set of .xqy modules (e.g. update_orders.xqy and update_customer.xqy) so you can 
do the data-oriented logic you need in your .xqy without needing triggers.

But if you feel more comfortable with triggers, by all means use the properties 
mechanism which does not invoke triggers, or use a separate "set-definition" 
document to track "collections" (but in that case beware of lock contention on 
the set definition document). Or tolerate the extra triggers and ensure they do 
no harm when fired additional times.

Yours,
Damon

--
Damon Feldman
Sr. Principal Consultant, MarkLogic




-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Stephane Toussaint
Sent: Friday, February 15, 2013 4:47 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Triggers Handling : Directory scope 
constraint and collection

Damon,

Actually I understand  your explanation, but in a sense it seem's to be a 
technical assumption more than a functional concept.

I can explain my use case :

- I have 2 Content type A and B (in two different directories)
- A trigger on directory A so that when a content of type A is created or 
modified I wan't to detect if Content of type B match the content A (join both 
content base on one or two key elements)
- The content A is then flagged eligible to be send to a back-office.

My concern now is that if some part of another process needs to add a content A 
in a collection for whatever needs to be done (categorization, collection 
basket, ...), I don't wan't the trigger to be triggered to not overflowed the 
back office with non modified content.

Your proposition is that the client :
- Insert new/updates content (without trigger handling).
- Invoke the module to treat the detection as a post action.

I guess I can do it this way, but it's a pity that I can't rely on Marklogic's 
Triggers in order to do something it seems to be designed to.

The real question I can't find answer to is why Marklogic treat collections and 
properties in different manner from content-source triggers point of view. 
Reading your explanation, I'll say that properties should then work the same 
way.

Thank you for your comment,
Stéphane



Le 8 févr. 2013 à 15:54, Damon Feldman  a écrit :

> Stéphane,
> 
> Adding a collection to a document is actually a change to the document. The 
> "collection" works very much like an invisible element added to the document 
> - the collection does not exist as a separate entity outside these tags added 
> to the documents.
> 
> Can you tell us what you are trying to accomplish? When possible, I prefer 
> not to use triggers and instead build sensible data services that allow full 
> control of the updates. In that case, your update-content.xqy module would 
> invoke the functionality you want, but your add-to-collection.xqy module 
> would not, without using triggers in either case.
> 
> Yours,
> Damon
> 
> --
> Damon Feldman
> Sr. Principal Consultant, MarkLogic
> 
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Stephane 
> Toussaint
> Sent: Friday, February 08, 2013 9:12 AM
> To: MarkLogic Developer Discussion
> Subject: [MarkLogic Dev General] Triggers Handling : Directory scope 
> constraint and collection
> 
> Hi,
> 
> With a trigger defined as in the current Api Documentation 
> (trgr:create-trigger())
> 
>> xquery version "1.0-ml";
>> import module namespace trgr="http://marklogic.com/xdmp/triggers"; at 
>> "/MarkLogic/triggers.xqy";
>> 
>> trgr:create-trigger(
>>  "myTrigger",
>>  "Simple trigger example", 
>>  trgr:trigger-data-event(
>>  trgr:directory-scope("/myDir/", "1"),
>>  trgr:document-content("modify"),
>>  trgr:post-commit()
>>  ),
>>  trgr:trigger-module(xdmp:database("test"), "/modules/", "log.xqy"),
>>  fn:true(),
>>  xdmp:default-permissions()
>> )
> 
> 
> If a change is change is done on a document under 'myDir' directory, the

[MarkLogic Dev General] mandatory constraint in search:search

2013-02-18 Thread Rajesh Kumar
Hi,



How to make a constraint(“coll”) mandatory in search:options while
performing search:search



Ex:

   search:search("Book AND coll:abc",http://marklogic.com/appservices/search";>





 



   )

The above query should fetch me the results


  search:search("Book",http://marklogic.com/appservices/search";>





 



   )

This Query should return empty results.


We tried using below code snippet but not working, Please suggest the
soultion.


  








Thanks,

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


[MarkLogic Dev General] search:page-length

2013-02-18 Thread sini narayanan
Hi All,

In the search:options (v1/config/query/all), how do I set the
 value to display all the search results. Instead of
giving a numeric value like 10 or 100, how do I set it to as many as the
number of results.


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


Re: [MarkLogic Dev General] Big Data

2013-02-18 Thread Justin Makeig
Pradeep,
I appreciate your inquiry. Can you be a little more specific, though? What type 
of problem are you trying to solve? What does “Big Data” mean here? How else 
have you thought about tackling this problem? Any additional context will help 
to provide more relevant guidance.
In the meantime, for a basic technical background on MarkLogic, I’d start with 
the videos and articles on the developer web site 
.

Justin




Justin Makeig
Director, Product Management
MarkLogic Corporation
justin.mak...@marklogic.com
www.marklogic.com



On Feb 18, 2013, at 1:05 AM, Pradeep Maddireddy 
mailto:pradeep.marklo...@gmail.com>>
 wrote:

Hi..!

We would like to explore the Big Data capabilities of Marklogic. Please guide 
me in finding the right path. Are there any tutorial available?

Thanks
Pradeep Maddireddy
___
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


[MarkLogic Dev General] Big Data

2013-02-18 Thread Pradeep Maddireddy
Hi..!

We would like to explore the Big Data capabilities of Marklogic. Please
guide me in finding the right path. Are there any tutorial available?

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