Re: [MarkLogic Dev General] Fast order-by with multiple range indexes?

2013-08-02 Thread Gajanan Chinchwadkar
Path range indexes are not even available in ML5. The best you can request for 
is a 6.0 service release.
-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Ron Hitchens
Sent: Friday, August 02, 2013 1:28 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Fast order-by with multiple range indexes?


Thanks Gajanan,

   In this case there is no common root shared by the two document models.
That's kind of the point, to migrate to a new model.

   I may submit an RFE for this.  It would seem to be very useful to be able to 
specify different different sort elements for heterogeneous result documents, 
each of which could make use of a range index.  Do you think Stephen could get 
this RFE approved, implemented, back-ported to 5.x, tested and released by 
Monday?  Maybe not.

---
Ron Hitchens {mailto:r...@ronsoft.com}   Ronsoft Technologies
 +44 7879 358 212 (voice)  http://www.ronsoft.com
 +1 707 924 3878 (fax)  Bit Twiddling At Its Finest
"No amount of belief establishes any fact." -Unknown


On Aug 2, 2013, at 8:45 PM, Gajanan Chinchwadkar 
 wrote:

> In general I agree with Mike that you will be able to use an index of kindof 
> /a/(b|c).
> 
> But creating a good path range index for 
> $result/(old/path/date|new/path/m:sort-date) may not be easy. ML 6 doesn't 
> allow you to create an index with a top level grouping operator, i.e. 
> (old/path/date|new/path/m:sort-date). You can create an index of type say, 
> indexroot/(old/path/date|new/path/m:sort-date). But then in order to get that 
> index used by fast order by the "indexroot" must match against $result (in 
> fact it should be a leaf of $result).
> 
> It will be a good idea for Ron to contact Stephen Buxton and submit an RFE.
> 
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael 
> Blakeley
> Sent: Friday, August 02, 2013 10:49 AM
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] Fast order-by with multiple range 
> indexes?
> 
> With ML6 I think you could create a single, useful path range index on both 
> elements. There is a table of permitted XPath syntax at 
> http://docs.marklogic.com/guide/admin/range_index#id_54948 and syntax like 
> /a/(b|c) is supported.
> 
> So you're answer might be "this will be slow now, but we have a plan to make 
> it faster when we upgrade".
> 
> -- Mike
> 
> On 2 Aug 2013, at 10:40 , Ron Hitchens  wrote:
> 
>> 
>>  This one is on 5.x.  I plan to move them to 6.x for the next phase 
>> (where everything goes to a consistent model), but it's not possible 
>> now.
>> 
>>  If you know a way on 6.x I'd love to see it.  We can't use path 
>> range indexes, but how would that work?  Something like this?:
>> 
>> order by xs:date ($result/(old/path/date|new/path/m:sort-date))
>> 
>> On Aug 2, 2013, at 6:13 PM, Michael Blakeley  wrote:
>> 
>>> Which release?
>>> 
>>> So you're using an element-range index? What about using a path-range index?
>>> 
>>> -- Mike
>>> 
>>> On 2 Aug 2013, at 09:26 , Ron Hitchens  wrote:
>>> 
>>>> 
>>>> I have a sorting problem that I can't find a good solution for.  
>>>> I'm working on a project where a lot of content exists in one form 
>>>> which was not designed for efficient searching or sorting.
>>>> In fact, MarkLogic is not used at all for search at the moment, 
>>>> that's what I'm adding.
>>>> 
>>>> This existing format has multiple versions of the content in each 
>>>> document, with an element range index on an xs:date field.
>>>> I can do efficient sorts on this content alone using the ranged 
>>>> date field in an "order by" clause.
>>>> 
>>>> Here's the complication: a new type of content is being added in a 
>>>> newer, more MarkLogic-friendly schema.  These documents all have a 
>>>> common metadata section with a ranged date field.  Different name 
>>>> and namespace, but serving the same purpose.
>>>> 
>>>> My problem is that I need to do searches across both types of 
>>>> content and sort them together.  Searching one kind or the other 
>>>> and sorting by their respective date fields works great for massive 
>>>> result sets.  But doing them together blows the expanded tree cache 
>>>> if the result set is large.

Re: [MarkLogic Dev General] Fast order-by with multiple range indexes?

2013-08-02 Thread Gajanan Chinchwadkar
In general I agree with Mike that you will be able to use an index of kindof 
/a/(b|c).

But creating a good path range index for 
$result/(old/path/date|new/path/m:sort-date) may not be easy. ML 6 doesn't 
allow you to create an index with a top level grouping operator, i.e. 
(old/path/date|new/path/m:sort-date). You can create an index of type say, 
indexroot/(old/path/date|new/path/m:sort-date). But then in order to get that 
index used by fast order by the "indexroot" must match against $result (in fact 
it should be a leaf of $result).

It will be a good idea for Ron to contact Stephen Buxton and submit an RFE.

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Friday, August 02, 2013 10:49 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Fast order-by with multiple range indexes?

With ML6 I think you could create a single, useful path range index on both 
elements. There is a table of permitted XPath syntax at 
http://docs.marklogic.com/guide/admin/range_index#id_54948 and syntax like 
/a/(b|c) is supported.

So you're answer might be "this will be slow now, but we have a plan to make it 
faster when we upgrade".

-- Mike

On 2 Aug 2013, at 10:40 , Ron Hitchens  wrote:

> 
>   This one is on 5.x.  I plan to move them to 6.x for the next phase 
> (where everything goes to a consistent model), but it's not possible 
> now.
> 
>   If you know a way on 6.x I'd love to see it.  We can't use path 
> range indexes, but how would that work?  Something like this?:
> 
> order by xs:date ($result/(old/path/date|new/path/m:sort-date))
> 
> On Aug 2, 2013, at 6:13 PM, Michael Blakeley  wrote:
> 
>> Which release?
>> 
>> So you're using an element-range index? What about using a path-range index?
>> 
>> -- Mike
>> 
>> On 2 Aug 2013, at 09:26 , Ron Hitchens  wrote:
>> 
>>> 
>>> I have a sorting problem that I can't find a good solution for.  I'm 
>>> working on a project where a lot of content exists in one form which 
>>> was not designed for efficient searching or sorting.
>>> In fact, MarkLogic is not used at all for search at the moment, 
>>> that's what I'm adding.
>>> 
>>> This existing format has multiple versions of the content in each 
>>> document, with an element range index on an xs:date field.
>>> I can do efficient sorts on this content alone using the ranged date 
>>> field in an "order by" clause.
>>> 
>>> Here's the complication: a new type of content is being added in a 
>>> newer, more MarkLogic-friendly schema.  These documents all have a 
>>> common metadata section with a ranged date field.  Different name 
>>> and namespace, but serving the same purpose.
>>> 
>>> My problem is that I need to do searches across both types of 
>>> content and sort them together.  Searching one kind or the other and 
>>> sorting by their respective date fields works great for massive 
>>> result sets.  But doing them together blows the expanded tree cache 
>>> if the result set is large.
>>> 
>>> Because of the odd layout of the old content, my searchable 
>>> expression is rather funky and looks something like this:
>>> 
>>> cts:search 
>>> (fn:doc()/(/container/group[@state="live]/doc[fn:not(@foo)]|x:new1|x
>>> :new2), $q, "unfiltered")
>>> 
>>> Note that the first one returns a sub-element of the document, which 
>>> is actually a fragment root.  The other two on the end return root 
>>> elements.
>>> 
>>> A FLWOR like this doesn't work:
>>> 
>>> for $result in cts:search ( . . .)
>>> order by xs:date (($result/old/path/date, 
>>> $result/new/path/m:sort-date)[1]) return $result
>>> 
>>> It runs but ok and will do the right thing if the result set is 
>>> reasonably small (a few thousand) will blow the cache if there are 
>>> too many results.  Trying to ignore one of the dates also blows he 
>>> cache:
>>> 
>>> for $result in cts:search ( . . .)
>>> order by xs:date ($result/old/path/date) return $result
>>> 
>>> But removing the last two components of the XPath (|x:new1|x:new2) 
>>> will then run fast.  I'm not sure why this prevents the range index 
>>> from kicking in, probably because of the complexity of the XPath.
>>> 
>>> Sorting combined results by relevance in either direction is fast.
>>> 
>>> Does anyone have a voodoo trick to enable fast sorting using values 
>>> from two different range indexes?  I don't need to look into the 
>>> documents the get the sort keys, it seems like it shouldn't have to 
>>> consume expanded tree cache space for this.
>>> 
>>> ---
>>> Ron Hitchens {mailto:r...@ronsoft.com}   Ronsoft Technologies
>>>   +44 7879 358 212 (voice)  http://www.ronsoft.com
>>>   +1 707 924 3878 (fax)  Bit Twiddling At Its Finest
>>> "No amount of belief establishes any fact." -Unknown
>>> 
>>> 
>>> 
>>> 
>>> ___
>>> General mailing list
>>> General@developer.marklogic.com
>>> http://developer.ma

Re: [MarkLogic Dev General] Fast order-by with multiple range indexes?

2013-08-02 Thread Gajanan Chinchwadkar
Have you tried xdmp:plan on this query? If it shows that the index is not 
getting used, this may be a bug. Please contact MarkLogic support for this 
issue.

Basically determining that the path 
"//(ldse:schedule-publish/@dateTime|ldse:publish-date/@date)" completely covers 
the order by clause is a complex task. It may be that the ML6 server is not 
able determine the cover and it doesn't use the index.

Gajanan Chinchwadkar
-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Will Sawyer
Sent: Friday, August 02, 2013 12:06 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Fast order-by with multiple range indexes?

I am having troubles with this same thing and the path range index is not being 
used in the order by.  

I have a scheduled publish date and an actual published date.  I created 
dateTime path index on 
"//(ldse:schedule-publish/@dateTime|ldse:publish-date/@date)"
But the following query still throws an expanded tree cache error because it's 
returning every document.  Running ML 6.0-3.2

(
for $item in cts:search(fn:collection(), cts:and-query(()), 
"unfiltered")
order by 
$item//(ldse:schedule-publish/@dateTime|ldse:publish-date/@date) descending
return (
$item
)
)[1 to 25]

-Will


-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Friday, August 02, 2013 11:49 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Fast order-by with multiple range indexes?

With ML6 I think you could create a single, useful path range index on both 
elements. There is a table of permitted XPath syntax at 
http://docs.marklogic.com/guide/admin/range_index#id_54948 and syntax like 
/a/(b|c) is supported.

So you're answer might be "this will be slow now, but we have a plan to make it 
faster when we upgrade".

-- Mike

On 2 Aug 2013, at 10:40 , Ron Hitchens  wrote:

> 
>   This one is on 5.x.  I plan to move them to 6.x for the next phase 
> (where everything goes to a consistent model), but it's not possible 
> now.
> 
>   If you know a way on 6.x I'd love to see it.  We can't use path 
> range indexes, but how would that work?  Something like this?:
> 
> order by xs:date ($result/(old/path/date|new/path/m:sort-date))
> 
> On Aug 2, 2013, at 6:13 PM, Michael Blakeley  wrote:
> 
>> Which release?
>> 
>> So you're using an element-range index? What about using a path-range index?
>> 
>> -- Mike
>> 
>> On 2 Aug 2013, at 09:26 , Ron Hitchens  wrote:
>> 
>>> 
>>> I have a sorting problem that I can't find a good solution for.  I'm 
>>> working on a project where a lot of content exists in one form which 
>>> was not designed for efficient searching or sorting.
>>> In fact, MarkLogic is not used at all for search at the moment, 
>>> that's what I'm adding.
>>> 
>>> This existing format has multiple versions of the content in each 
>>> document, with an element range index on an xs:date field.
>>> I can do efficient sorts on this content alone using the ranged date 
>>> field in an "order by" clause.
>>> 
>>> Here's the complication: a new type of content is being added in a 
>>> newer, more MarkLogic-friendly schema.  These documents all have a 
>>> common metadata section with a ranged date field.  Different name 
>>> and namespace, but serving the same purpose.
>>> 
>>> My problem is that I need to do searches across both types of 
>>> content and sort them together.  Searching one kind or the other and 
>>> sorting by their respective date fields works great for massive 
>>> result sets.  But doing them together blows the expanded tree cache 
>>> if the result set is large.
>>> 
>>> Because of the odd layout of the old content, my searchable 
>>> expression is rather funky and looks something like this:
>>> 
>>> cts:search
>>> (fn:doc()/(/container/group[@state="live]/doc[fn:not(@foo)]|x:new1|x
>>> :new2), $q, "unfiltered")
>>> 
>>> Note that the first one returns a sub-element of the document, which 
>>> is actually a fragment root.  The other two on the end return root 
>>> elements.
>>> 
>>> A FLWOR like this doesn't work:
>>> 
>>> for $result in cts:search ( . . .)
>>> order by xs:date (($result/old/path/date,
>>> $result/new/path/m:sort-date)[1]) return $result
>>>

Re: [MarkLogic Dev General] cts:element-value-match and cts:element-range-query questions

2012-11-27 Thread Gajanan Chinchwadkar
Michael's suggestion is right. Fields is a better approach.

ML6 Path indexes will not help: the value in the path index is the same as an 
element index at the leaf level will have.

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Tuesday, November 27, 2012 9:22 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] cts:element-value-match and 
cts:element-range-query questions

Typically one wouldn't create a range index for complex elements like 
'chapter'. Range indexes are designed for simple element values and 
element-attribute values.

Have you considered creating a field and using 
http://docs.marklogic.com/cts:field-value-match or 
http://docs.marklogic.com/cts:field-word-match instead? You should be able to 
create a 'chapter' field that includes the 'chapter' element but excludes 'b'.

Or you *might* be able to do something with ML6 and a path index: see 
http://docs.marklogic.com/guide/admin/range_index#id_54948 for details. But the 
path '//chapter/text()' seems to be invalid so I'm not sure what the right 
approach would be.

-- Mike

On 26 Nov 2012, at 21:11 , John Zhong  wrote:

> Hi,
> 
> I am using ML 5.0-2 version, and configured a element range index (string 
> type) on a complex element, for example, chapter, which has both text node 
> and child element. Like:
> 
> This is chapter one.
> 
> Then, I used cts:element-value-match to search the value:
> 
> cts:element-value-match(
>   xs:QName("chapter"),
>   ("*one*"),
>   ("concurrent")
> )
> 
> It returned the:
> 
> This is chapter one.
> 
> Is this expected behavior? If so, how to constrain that if I just want to 
> match the direct text node? (In this case, I don't want this chapter element 
> returned)
> 
> Also, if I use cts:element-range-query to search all the chapter elements 
> that have the value "This is chapter one.", that chapter element is returned 
> too. Is this expected behavior either? Same question, if I don't want this 
> chapter element returned, how to do that?
> 
> Thanks,
> John
> ___
> General mailing list
> General@developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

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


Re: [MarkLogic Dev General] Range Index in Where Clause

2012-10-22 Thread Gajanan Chinchwadkar
If an xpath expression has a predicate with value, then element range index 
will be used, if available.
For example, in the following two cases a range index on xs:QName("title") will 
be used:
 a.  /bookstore/book[title="XQuery Programming"]
 b. /bookstore/book[title="XQuery Programming"]/author

However, if there is no value in the predicate then the range index will not be 
used:
 c. .  /bookstore/book[title]

The same logic applies to where clause. If there is a value in the where clause 
and a corresponding element range index, it will be used.
It is different in order by, where an index gets used even though there is no 
comparison predicate and value.

In 6.0.1-1, XPath based index can be defined. There are many situations when 
MarkLogic server attempts to find matching path range index. Again in order to 
use range index, there must be a comparison predicate in the query.

Thanks,

Gajanan

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Monday, October 22, 2012 9:47 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Range Index in Where Clause

I would rephrase this as "does the evaluator ever use indexes for where 
clauses?" If indexes are used at all, I would expect ranges to work too. And 
with 6.0-1.1 the answer seems to be "yes" - but I would still recommend doing 
as much as possible in XPath predicates.

Here's a contrived test. In real life it would be very odd to have a 
dls:created element in the main document, but since the range index comes 
preconfigured it's handy for testing.

declare namespace dls="http://marklogic.com/xdmp/dls";;

xdmp:document-insert(
  'test/1',
  element a {
element b { 'c' },
element dls:created { xs:dateTime(xs:date('2012-12-01')) } }), 
xdmp:document-insert(
  'test/2',
  element a {
element b { 'c' },
element dls:created { xs:dateTime(xs:date('2012-12-12')) } }) => ()

Now we have two documents that match the /a[b eq 'c'] portion of the 
expression, but with different dsl:created values. Let's write a test query 
that matches one, but not the other:

declare namespace dls="http://marklogic.com/xdmp/dls";;
xdmp:query-trace(true()),
for $n in /a[ b eq 'c' ]
where $n/dls:created < xs:dateTime(xs:date('2012-12-12'))
return $n

One document should match the dls:created constraint, and the other shouldn't. 
The actual results match expectations, but that could be due to filtering. 
Let's check the trace:

2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Analyzing path for $n: 
fn:collection()/a[b eq "c"]
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Step 1 is searchable: 
fn:collection()
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Step 2 is searchable: a[b eq 
"c"]
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Path is fully searchable.
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Gathering constraints.
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:14: Comparison contributed hash 
value constraint: b = "c"
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Step 2 predicate 1 contributed 
1 constraint: b eq "c"
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:14: Comparison contributed hash 
value constraint: b = "c"
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Step 2 predicate 1 contributed 
1 constraint: b eq "c"
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Step 2 contributed 2 
constraints: a[b eq "c"]
2012-10-22 09:06:18.661 Info: 8003-cq: at 5:9: Comparison contributed dateTime 
range value constraint: dls:created < xs:dateTime("2012-12-12T00:00:00")
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Where clause contributed 1 
constraint for $n: $n/dls:created < xs:dateTime("2012-12-12T00:00:00")
2012-10-22 09:06:18.661 Info: 8003-cq: at 4:11: Executing search.
2012-10-22 09:06:18.667 Info: 8003-cq: at 4:11: Selected 1 fragment to filter

That looks exactly as expected (aside from the duplication of b=c, anyway). If 
we increment the date to the 13th or the 31st, both fragments match. If we try 
to use a QName that doesn't have a range index, we lose the "Comparison 
contributed dateTime range value constraint" line. So it seems clear that the 
range index is used for the where-clause.

Note that the same expression will be unsearchable according to xdmp:plan, 
though. Presumably that's because the FLWOR expression taken as a whole is 
unsearchable. That's understandable, but a little frustrating.

Even knowing this, I would still recommend doing as much as possible in XPath 
predicates. For one thing, you can use xdmp:plan instead of xdmp:query-trace.

-- Mike

On 22 Oct 2012, at 08:02 , David Sargeant  wrote:

> I'm wondering if ML uses a range index in the where portion of a FLOWR 
> expression where applicable.  I could only find examples of 'order by'.  
> Thanks.
> 
> 
> 
> David
> 
> ___
> General mailing list
> General@developer.marklogic.com
> http://dev

Re: [MarkLogic Dev General] Advice on improving "join" on attribute performance

2012-03-16 Thread Gajanan Chinchwadkar
Nick,

Just curious- which version of MarkLogic server you are on?

Rgds,

Gajanan
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Geert Josten
Sent: Friday, March 16, 2012 9:00 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Advice on improving "join" on attribute 
performance

Hi Nick,

I guess David is referring to the xdmp:get-server-field() and 
xdmp:set-server-field() functions 
(http://community.marklogic.com/pubs/5.0/apidocs/AppServerBuiltins.html#xdmp:get-server-field).
 Make sure to check whether it is initialized. You could also insert the 
map:map into the database, but retrieval from database might be slower. Would 
be beneficial if you'd need to share info among hosts or initialization would 
be relatively slow, but perhaps that is not the case here.

I'm expecting ordering on $x/@id to be slow because there is no range index on 
it. Results might improve if you'd index the id attrib on 
elementa,elementb,etc. (You can supply multiple element names in a single 
index.) I also think the ordering might perform best if elementa, elementb, etc 
are declared as fragment roots, or stored as individual documents (not sure 
that would fit you data approach)..

Personally, I prefer to rely on the search and lexicon function of MarkLogic 
explicitly. That helps you writing you logic such that you optimally use the 
indexes, and you don't depend on the optimizer so much to translate your code 
to use the indexes.

Kind regards,
Geert


Van: 
general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.com]
 Namens Nick Tuckett
Verzonden: vrijdag 16 maart 2012 16:28
Aan: MarkLogic Developer Discussion
Onderwerp: Re: [MarkLogic Dev General] Advice on improving "join" on attribute 
performance

Many thanks, David - just tried creating and serialising a map version of the 
language data, and then using it inside my test query - massive speedup as you 
suggested; less than two seconds for the "experienced" user elapsed time, <0.24 
seconds reported by the profiler and only a small transient memory hit (~1%).

Please would you point me at appropriate documentation on system global 
properties?

On 16 March 2012 14:26, David Lee 
mailto:david@marklogic.com>> wrote:
That is a perfect use case for maps.
If the file doesn't change often you could even set it as a system global 
property.

Let me know if you'd like some sample code

-
David Lee
Lead Engineer
MarkLogic Corporation
d...@marklogic.com
Phone: +1 650-287-2531
Cell:  +1 812-630-7622
www.marklogic.com

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

From: 
general-boun...@developer.marklogic.com
 
[mailto:general-boun...@developer.marklogic.com]
 On Behalf Of Nick Tuckett
Sent: Friday, March 16, 2012 10:26 AM

To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Advice on improving "join" on attribute 
performance

It's just shy of 1.5Mb for one language with just over 13000 entries, so that 
might be feasible...?

We've got localised text for eight languages, so if used in production that 
would be about 12Mb total.

___
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] Endless DB reindexing after documents update

2011-12-05 Thread Gajanan Chinchwadkar
Igor,

I suggest you contact MarkLogic support on this. Please provide them info on 
your index settings and field definitions, if any.

Thanks,

Gajanan
-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Igor Senin
Sent: Monday, December 05, 2011 2:59 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Endless DB reindexing after documents update

Hello.
I have the problem with DB reindexing after updating documents in database. I 
need to extend existing in DB ~30 documents with additional attributes:


    device1
   ...


should be transformed to:


  Some data
  ...


I launch following script to perform such transformation:

for $uri in cts:uris()
$node := xdmp:xslt-invoke("../exteinsion.xsl", fn:doc($uri)) 
xdmp:document-insert($uri, $node)

After transformation documents are updated (checked it via WebDAV) and server 
starts DB reindexing. The problem is that reindexing of DB containing 30 
documents is endless. I checked DB status after 10 hours of reindexing, it is 
still in progress.
It is a bug, or i did something wrong? And what is the best practice of 
existing documents update? Thanks!
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Problem creating field word lexicon

2011-09-27 Thread Gajanan Chinchwadkar
Also check what collation was used when creating the lexicon.

Gajanan

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Brent Hartwig
Sent: Tuesday, September 27, 2011 6:44 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Problem creating field word lexicon

Hi, Gary,

Consider specifying the collation in cts:field-word-match().

-Brent

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gary Larsen
Sent: Tuesday, September 27, 2011 9:45 AM
To: 'General MarkLogic Developer Discussion'
Subject: [MarkLogic Dev General] Problem creating field word lexicon

I've defined what I believe are lexicons on a field definition, but queries 
complain that none exist.

cts:field-word-match('lineageSpecItem', 'Customer')

SystemID: C:\Untitled1.xquery
Location: 24:0
Description: XDMP-FIELDLXCNNOTFOUND: cts:field-word-match("lineageSpecItem", 
"Customer") -- No field word lexicon for lineageSpecItem 
http://marklogic.com/collation/

Is there something I'm missing?

Thanks,
gary

[cid:image001.png@01CC7CF2.597FA850]

[cid:image002.png@01CC7CF2.597FA850]

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


Re: [MarkLogic Dev General] Reg: Diacritic-insensitive lexicons

2011-09-07 Thread Gajanan Chinchwadkar
Here is what I am thinking:

If you set "fast diacritic sensitive searches" to false, then you will have 
diacritic insensitive value index. So a search query may work, but I am not 
sure if cts:frequency will work correctly on that o/p with desired performance. 
That's where you need to give it a try. Something like this:
cts:frequency(
  cts:search(
fn:doc(),
cts:element-value-query(xs:QName("name"), "Annie*", 
("diacritic-insensitive", "wildcarded")),
   "unfiltered)
)

Other alternative is (as you mentioned earlier) try out a different collation 
and continue using element-value-match(). I think "Base English" collation will 
flatten out all the diacritic characters in the value lexicon.

See if this helps,

Rgds,

Gajanan
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of ambika arumugam
Sent: Wednesday, September 07, 2011 11:04 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Reg: Diacritic-insensitive lexicons

Hi Gajanan,

The value of "fast diacritic sensitive searches" setting in the database is set 
to true.
Do you mean to say that if it is set to false will the indexes be regrouped as 
required to yield the results I need?

Regards,
Ambika

On Thu, Sep 8, 2011 at 11:07 AM, Gajanan Chinchwadkar 
mailto:gajanan.chinchwad...@marklogic.com>> 
wrote:
What's the value of "fast diacritic sensitive searches" setting on your 
database? If it is true, will it affect to other applications if you set it to 
false?

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 
[mailto:general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>]
 On Behalf Of ambika arumugam
Sent: Wednesday, September 07, 2011 10:31 PM

To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Reg: Diacritic-insensitive lexicons

Hi all,

I am running the cts:element-value-match query, I understand that indexes will 
be created for each unique value in the element 'name'. But is it possible to 
customize the indexing like creating a same index for Annie, Ánnie and Ànnie. 
So that if i perform cts:element-value-match query like

cts:element-value-match(xs:QName("name"), "Annie*") [1 to 10]

lets consider, if i have '3' matches for Annie in element 'name' and
'1' match for Ánnie in element 'name and
'2' matches for Ànnie in element 'name' in the database.

cts:frequency(cts:element-value-match(xs:QName("name"), "Annie*") [1 to 10])

Then performing the above query should return result of 6 (summing the 
individuals - Annie(3),Ánnie (1)m,Ànnie (2)). I also tried options of 
cts:element-value-match query still without any changes to the indexes i am not 
able to achieve this result.

Thanks in advance,

Regards,
Ambika

On Tue, Sep 6, 2011 at 11:23 AM, Gajanan Chinchwadkar 
mailto:gajanan.chinchwad...@marklogic.com>> 
wrote:
You mention that you are trying to count element names. But the query you are 
using seems to find all the elements named "name" whose value starts with 
"Annie".

Please clarify: what do you want to count exactly?

Also do you have a range index of type "string" set on the element named 
"name"? Basically the function element-value-match() simply reads all the 
values in the range index which match pattern "Annie*".

Thanks,

Gajanan
From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 
[mailto:general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>]
 On Behalf Of ambika arumugam
Sent: Monday, September 05, 2011 9:55 PM

To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Reg: Diacritic-insensitive lexicons

Hi all,


I am trying to get the count of element names using the query

cts:element-value-match(xs:QName("name"), 
"Annie*",("case-insensitive","collation=http://marklogic.com/collation/","diacritic-insensitive";)
 )[1 to 10]
I am using cts:frequency of the above query to get the results.

For this i want values of Ánnie and Ànnie to match this query using 
diacritic-insensitive option as the third parameter of element-value-match 
query. But i am not getting results for this query as expected.
Should the collation be changed from root collation to unicode collation to get 
this done?

Regards
Ambika

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


___
General mailing list
General@developer.marklogic.com<mailto: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] Reg: Diacritic-insensitive lexicons

2011-09-07 Thread Gajanan Chinchwadkar
What's the value of "fast diacritic sensitive searches" setting on your 
database? If it is true, will it affect to other applications if you set it to 
false?

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of ambika arumugam
Sent: Wednesday, September 07, 2011 10:31 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Reg: Diacritic-insensitive lexicons

Hi all,

I am running the cts:element-value-match query, I understand that indexes will 
be created for each unique value in the element 'name'. But is it possible to 
customize the indexing like creating a same index for Annie, Ánnie and Ànnie. 
So that if i perform cts:element-value-match query like

cts:element-value-match(xs:QName("name"), "Annie*") [1 to 10]

lets consider, if i have '3' matches for Annie in element 'name' and
'1' match for Ánnie in element 'name and
'2' matches for Ànnie in element 'name' in the database.

cts:frequency(cts:element-value-match(xs:QName("name"), "Annie*") [1 to 10])

Then performing the above query should return result of 6 (summing the 
individuals - Annie(3),Ánnie (1)m,Ànnie (2)). I also tried options of 
cts:element-value-match query still without any changes to the indexes i am not 
able to achieve this result.

Thanks in advance,

Regards,
Ambika


On Tue, Sep 6, 2011 at 11:23 AM, Gajanan Chinchwadkar 
mailto:gajanan.chinchwad...@marklogic.com>> 
wrote:
You mention that you are trying to count element names. But the query you are 
using seems to find all the elements named "name" whose value starts with 
"Annie".

Please clarify: what do you want to count exactly?

Also do you have a range index of type "string" set on the element named 
"name"? Basically the function element-value-match() simply reads all the 
values in the range index which match pattern "Annie*".

Thanks,

Gajanan
From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 
[mailto:general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>]
 On Behalf Of ambika arumugam
Sent: Monday, September 05, 2011 9:55 PM

To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Reg: Diacritic-insensitive lexicons

Hi all,


I am trying to get the count of element names using the query

cts:element-value-match(xs:QName("name"), 
"Annie*",("case-insensitive","collation=http://marklogic.com/collation/","diacritic-insensitive";)
 )[1 to 10]
I am using cts:frequency of the above query to get the results.

For this i want values of Ánnie and Ànnie to match this query using 
diacritic-insensitive option as the third parameter of element-value-match 
query. But i am not getting results for this query as expected.
Should the collation be changed from root collation to unicode collation to get 
this done?

Regards
Ambika

___
General mailing list
General@developer.marklogic.com<mailto: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] Reg: Diacritic-insensitive lexicons

2011-09-05 Thread Gajanan Chinchwadkar
You mention that you are trying to count element names. But the query you are 
using seems to find all the elements named "name" whose value starts with 
"Annie".

Please clarify: what do you want to count exactly?

Also do you have a range index of type "string" set on the element named 
"name"? Basically the function element-value-match() simply reads all the 
values in the range index which match pattern "Annie*".

Thanks,

Gajanan
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of ambika arumugam
Sent: Monday, September 05, 2011 9:55 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Reg: Diacritic-insensitive lexicons

Hi all,

I am trying to get the count of element names using the query

cts:element-value-match(xs:QName("name"), 
"Annie*",("case-insensitive","collation=http://marklogic.com/collation/","diacritic-insensitive";)
 )[1 to 10]
I am using cts:frequency of the above query to get the results.

For this i want values of Ánnie and Ànnie to match this query using 
diacritic-insensitive option as the third parameter of element-value-match 
query. But i am not getting results for this query as expected.
Should the collation be changed from root collation to unicode collation to get 
this done?

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


Re: [MarkLogic Dev General] Issue with element-attribute-value with query

2011-08-30 Thread Gajanan Chinchwadkar
Abhishek,

Can you try running the cts:search  as "unfiltered" and see if it throws out 
something? If it does, then perhaps the results you are seeing are correct.

The documentation for cts:element-attribute-values  says: The values do not 
need to match the query, but they must occur in fragments selected by the 
query. The fragments are not filtered to ensure they match the query, but 
instead selected in the same manner as "unfiltered" 
cts:search
 operations.

Gajanan

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Abhishek53 S
Sent: Tuesday, August 30, 2011 7:52 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Issue with element-attribute-value with query


Hi Folks

I am having some issue with getting element-attribute values with some 
additional query into the query option.

The query below is returning 0 records -- which is fine

cts:search(fn:doc(),
cts:and-query((
   cts:element-query(xs:QName("as-project-spec"),
   cts:and-query((

cts:element-attribute-value-query(xs:QName("as-project-spec"),xs:QName("div"),"0"),

cts:element-word-query(xs:QName("content"),"kolkata")
))
)
   ))
)


Where as the query below is simply returning me some values from the value 
lexicons -- ideally it should not

 cts:element-attribute-values(
   xs:QName("as-project-spec"),
   xs:QName("div"),
   (),
   (),
   cts:and-query((
   cts:element-query(xs:QName("as-project-spec"),
   cts:and-query((

cts:element-attribute-value-query(xs:QName("as-project-spec"),xs:QName("div"),"00050"),

cts:element-word-query(xs:QName("content"),"kolkata")
))
)
   ))
)

Though it is mentioned that this will return the values matching the 
fragments.Ideally as 0 fragments are matching the query 
..element-attribute-values should not return any value.

Let me know If I a wrong somewhere.

Thanks & Regards
Abhishek Srivastav
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com
Website: http://www.tcs.com

Experience certainty.IT Services
   Business Solutions
   Outsourcing


=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you

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


Re: [MarkLogic Dev General] wildcarding in constraining query

2011-06-24 Thread Gajanan Chinchwadkar
Have you looked at cts:word-query with phrase-through/phrase-around?

If you want to look at particular elements, you can also define a field on 
these elements and cts:use field-word-query.

Thanks,

Gajanan

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gary Larsen
Sent: Friday, June 24, 2011 9:36 AM
To: 'General MarkLogic Developer Discussion'
Subject: [MarkLogic Dev General] wildcarding in constraining query

I'm attempting to create both 'starts-with' and 'contains' queries (for a 
constraining query) on element values which needs to work across word 
boundaries.

cts:element-value-query() does not wildcard across word boundaries and  
cts:element-word query() only matches on single words.  cts:element-value-match 
does what I need but does not return a cts:query.   Are there any other options 
I have not looked at?

Thanks,
gary





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


Re: [MarkLogic Dev General] Marklogic database fields over large text

2011-06-14 Thread Gajanan Chinchwadkar
It *may* be a good approach.

However, there are many possible options:

1)  cts:field-word-queries

2)  cts:and-query to combine three cts:element-value-queries

3)  cts:and-query  to combine three cts:element-word-queries
...

and so on...
There are at least two different ways to define a field:

(1)As you said: defined a single field "test-field" and include all the 
necessary elements.

(2)Other possible way is to include "data" and exclude "inner" and "title".

Basically, right answer may or may not be a field based solution. It all 
depends on what kind of queries you want to run.

Thanks,

Gajanan
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Abhishek53 S
Sent: Tuesday, June 14, 2011 12:35 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Marklogic database fields over large text


Hi All

My question is related to the database field. Sample content as follows


EST


ABC.
Very large text.Very large text.Very 
large text.Very large text.Very large text.


XYZ.
Very large textVery large text.Very 
large text.Very large text.Very large text..


RST
Very large textVery large text.Very 
large text.Very large text.Very large text..




I need to perform constrained search over the elements text1,text2, and text3 
present under data element.
 If I will select database field approach  and select text1 2 & 3 are included 
elements into database field to write the constrained filed query,. Is this a 
good approach keeping performance in mind if text1 .2 & 3 have very large text.



Thanks in advance
Abhishek Srivastav
Systems Engineer
Tata Consultancy Services
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com
Website: http://www.tcs.com

Experience certainty.IT Services
   Business Solutions
   Outsourcing


=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you

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


Re: [MarkLogic Dev General] Fied creation over attribute value

2011-05-03 Thread Gajanan Chinchwadkar
Hi Abhishek,

You must have noticed in MarkLogic documentation that attribute values can be 
used to decide if a particular element gets included in a field or not. By 
defining a field with attribute value constraints you can do indirect queries. 
That may satisfy your requirement to some extent. For example, if an element 
"name" gets included only if the phone-no attribute is "1234567". Then you can 
search for a unique word (from the "name") in the field and infer that phone-no 
"1234567" is present or not.

A more direct and simpler way would be to represent the values of interest 
using elements in the XML doc instead of attributes. Then you can include these 
new elements in the field definition. However this needs transformation of the 
data. Not sure if it is possible to transform input docs in your particular 
situation.

Hope this helps,

Gajanan

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Abhishek53 S
Sent: Tuesday, May 03, 2011 7:14 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Fied creation over attribute value


Hi All

I want to create the FIELD over the values present in the attribute of some 
element means over the attribute value but not over the element value. As per 
my observation it is not possible. Can someone suggest something?

Thanks in advance

Abhishek Srivastav
Assistant Systems Engineer
Tata Consultancy Services
Plot  B-1, Block EP & GP, Sector 5
Salt Lake Electronics Complex,
Kolkata - 700 091,West Bengal
India
Cell:- +91-9883389968
Mailto: abhishek5...@tcs.com
Website: http://www.tcs.com

Experience certainty.IT Services
   Business Solutions
   Outsourcing


=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you

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


Re: [MarkLogic Dev General] Reg Time zone and daylight saving in marklogic

2011-04-21 Thread Gajanan Chinchwadkar
Hi Ambika,

As I suggested you earlier if you have a possibility of using 4.2.1 or up, you 
can get a very flexible XSLT compatible support for date/time formatting.

If not, one more thing that you can try is:


1)  On a linux/unix machine in the same timezone, see what's the output of 
the strftime() system function. You may have to write a small c/c++ program to 
test it.

2)  You can get details of system function strftime() using "man strftime" 
on linux/unix machines.

3)  If possible, please test both the system function and MarkLogic 
function on the same machine.

4)  If that produces different output than xdmp:strftime(), contact 
supp...@marklogic.com<mailto:supp...@marklogic.com>.

Rgds,

Gajanan

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of ambika arumugam
Sent: Thursday, April 21, 2011 1:38 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Reg Time zone and daylight saving in 
marklogic

Hi Gajanan,
 The mark logic version i am using is 4.1.6

The query i used is:

let $datevalue := xs:dateTime("2011-04-20T09:05:00.000-05:00")
return xdmp:strftime("%m/%d/%Y %H:%M:%S", xs:dateTime($datevalue))

it returned: 04/20/2011 19:35:00 which is one hour ahead of the local IST. How 
do i tackle this issue? it is related to daylight saving

regards,
Ambika
On Thu, Apr 21, 2011 at 1:16 PM, Gajanan Chinchwadkar 
mailto:gajanan.chinchwad...@marklogic.com>> 
wrote:
Hi Ambika,

Which version of MarkLogic Server are you using? Can you please post the exact 
query and the output?

If you are using MarkLogic server 4.2 and above, here is another possibility to 
print the dateTime in the format you want:

Q1)
let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00")
return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01] [Z]"),


returns: 04-20-11 09:05:00 -0500

Q2)
let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00")
return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01] [z]"),

returns: 04-20-11 09:05:00 GMT-05:00

Q3)
let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00")
return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01]")

returns: 04-20-11 09:05:00

Please note the [Z] in Q1, [z] in Q2 and neither in Q3. You can refer to W3C 
XSLT 2.0 spec for the exact syntax of format-dateTime() picture string, if you 
need more variations.

Do you have any particular question about time-zone and daylight savings in 
MarkLogic that you are experimenting for?

Rgds,

Gajanan

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 
[mailto:general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>]
 On Behalf Of ambika arumugam
Sent: Wednesday, April 20, 2011 11:59 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Reg Time zone and daylight saving in marklogic

Hi all,
I was just trying to understand about the time zone and the daylight saving in 
marklogic. The example I tried is as following:

1) I save a time with a time zone (say GMT -5:00 Eastern time (US and Canada)) 
(the data that I used looks like 2011-04-20T09:05:00.000-05:00)
2) I retrieve the time from the marklogic server and I pass the value to the 
xdmp:strftime() function to format the obtained value in the MM-DD-YY HH:MM:SS 
format.
3) In the output I obtain, I can see that the retrieved time is 1 hour ahead of 
my local time. My current local time zone is GMT +5:30

Is this advancement in time due to the daylight saving time setting?

Can anyone please help me out?
Thanks in advance.


___
General mailing list
General@developer.marklogic.com<mailto: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] Reg Time zone and daylight saving in marklogic

2011-04-21 Thread Gajanan Chinchwadkar
Hi Ambika,

Which version of MarkLogic Server are you using? Can you please post the exact 
query and the output?

If you are using MarkLogic server 4.2 and above, here is another possibility to 
print the dateTime in the format you want:

Q1)
let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00")
return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01] [Z]"),


returns: 04-20-11 09:05:00 -0500

Q2)
let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00")
return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01] [z]"),

returns: 04-20-11 09:05:00 GMT-05:00

Q3)
let $dt:= xs:dateTime("2011-04-20T09:05:00.000-05:00")
return format-dateTime($dt,"[M01]-[D01]-[Y01] [h01]:[m01]:[s01]")

returns: 04-20-11 09:05:00

Please note the [Z] in Q1, [z] in Q2 and neither in Q3. You can refer to W3C 
XSLT 2.0 spec for the exact syntax of format-dateTime() picture string, if you 
need more variations.

Do you have any particular question about time-zone and daylight savings in 
MarkLogic that you are experimenting for?

Rgds,

Gajanan

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of ambika arumugam
Sent: Wednesday, April 20, 2011 11:59 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Reg Time zone and daylight saving in marklogic

Hi all,
I was just trying to understand about the time zone and the daylight saving in 
marklogic. The example I tried is as following:

1) I save a time with a time zone (say GMT -5:00 Eastern time (US and Canada)) 
(the data that I used looks like 2011-04-20T09:05:00.000-05:00)
2) I retrieve the time from the marklogic server and I pass the value to the 
xdmp:strftime() function to format the obtained value in the MM-DD-YY HH:MM:SS 
format.
3) In the output I obtain, I can see that the retrieved time is 1 hour ahead of 
my local time. My current local time zone is GMT +5:30

Is this advancement in time due to the daylight saving time setting?

Can anyone please help me out?
Thanks in advance.

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


Re: [MarkLogic Dev General] Invalid Module Import path | XQDT Error

2010-10-29 Thread Gajanan Chinchwadkar
Hi SukuMaran,

If both of your lib.xqy and default.xqy are in 
C:\mls-projects\xquery\helloworld, then you don't need to specify full path of 
lib.xqy in the import statement of your default.xqy. For example, this works:

Default.xqy:
=
import module namespace lib = "http://marklogic.com/MLU/xqdt/examples"; at
   "\lib.xqy";

lib:user()
===

I created an appserver with root C:\mls-projects\xquery\helloworld, kept both 
the files in the same directory, invoked default.xqy through the appserver and 
it worked.
You will find a good explanation of how paths of imported modules are resolved 
in MarkLogic documentation. Look for "Importing XQuery Modules, XSLT 
Stylesheets, and Resolving Paths"  in application developers guide.
Thanks,
Gajanan

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of MaranSuku
Sent: Thursday, October 28, 2010 7:44 PM
To: general@developer.marklogic.com; general-requ...@developer.marklogic.com
Subject: [MarkLogic Dev General] Invalid Module Import path | XQDT Error

HI,

 I am getting the below error,
   XDMP-IMPORTPATH: Invalid Module Import path:
   C:\mls-projects\xquery\helloworld\lib.xqyin /eval, on line 3
   I have created a libraray Module @
   C:\mls-projects\xquery\helloworld\lib.xqy

   lib.xqy
   ___module namespace lib = 'http://marklogic.com/MLU/xqdt/examples';
   declare function lib:user(){
   xdmp:get-current-user()
   };
   and when I am importing the function in Main Module, I am getting the
   Invalid Import path,

   default.xqy


  ___ import module namespace lib = "http://marklogic.com/MLU/xqdt/examples"; at
   "C:\mls-projects\xquery\helloworld\lib.xqy";

   lib:user()

   I am using Eclipse and the following are installed.

 Eclipse IDE for Java Developers1.2.2.20100216-1730epp.package.java
 MarkLogic XQDT Adapter Feature0.7.0.v201001160647-17R-AkF7B77JBZFJF7
   org.eclipse.wst.xquery.marklogic.feature.feature.group
 XQuery Development Tools Feature0.7.0.v201001121118-47Z-BgJ9E99OEhJOJ9
   org.eclipse.wst.xquery.feature.feature.group


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