Re: [MarkLogic Dev General] Bug in in-mem-update

2011-05-12 Thread Jason Hunter
Hi Ryan, I fixed this on github just now. Sorry for the delay. I filed a bug also so engineering can take care of the server's copy. -jh- On Apr 14, 2011, at 3:23 PM, seme...@hotmail.com wrote: > The following code throws this error: [1.0] XDMP-ATTRSEQ: (err:XQTY0024) > $node/@* -- Attribute

Re: [MarkLogic Dev General] slow query/profiler question

2011-05-12 Thread Evan Lenz
A little late on this thread, but I think I can explain why the initial predicate change (removing "/") didn't make much difference. "/" in a predicate is interpreted as "root of the tree containing the context node." That's true in both 1.0 and 1.0-ml. When a context node is not defined, "/" thro

Re: [MarkLogic Dev General] How To Get The "Content" of An Index?

2011-05-12 Thread Evan Lenz
No, the thing to remember is that the default axis is child::, not self:: (.//foo)[1] returns the same nodes as descendant::foo[1] because it is a syntactic shorthand for the following: (./descendant-or-self::node()/child::foo)[1] Similarly, (.//@foo)[1] is shorthand for: (./descendant-or-self

Re: [MarkLogic Dev General] How To Get The "Content" of An Index?

2011-05-12 Thread G. Ken Holman
At 2011-05-12 15:58 -0400, Mike Sokolov wrote: >On 05/12/2011 02:52 PM, Evan Lenz wrote: > > I think most beginners expect .//foo to be short for descendant::foo > > (which I'm guessing is what you meant), especially since in examples > > like that they return the exact same results. // is only a g

Re: [MarkLogic Dev General] How To Get The "Content" of An Index?

2011-05-12 Thread Mike Sokolov
On 05/12/2011 02:52 PM, Evan Lenz wrote: > I think most beginners expect .//foo to be short for descendant::foo > (which I'm guessing is what you meant), especially since in examples > like that they return the exact same results. // is only a gotcha when > you start using positional predicate

Re: [MarkLogic Dev General] MarkLogic and Cocoon

2011-05-12 Thread Geert Josten
Hi Gary, Perhaps this tutorial is of help: http://developer.marklogic.com/media/mluc11-talks/rewrite.pdf There is plenty more reading material on http://developer.marklogic.com/. Have a look around.. Kind regards, Geert Van: general-boun...@developer.marklogic.com [mailto:general-boun...@dev

Re: [MarkLogic Dev General] MarkLogic and Cocoon

2011-05-12 Thread Gary Larsen
Thanks Gert! That's a very interesting idea, and using 21st century technology J. I'm still on the learning curve and can't find any docs on the MarkLogic Rest API. Would you have a link handy? Thanks again, gary From: general-boun...@developer.marklogic.com [mailto:general-boun..

Re: [MarkLogic Dev General] How To Get The "Content" of An Index?

2011-05-12 Thread Evan Lenz
I think most beginners expect .//foo to be short for descendant::foo (which I'm guessing is what you meant), especially since in examples like that they return the exact same results. // is only a gotcha when you start using positional predicates (so be suspicious whenever you see them together

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread seme...@hotmail.com
Ok thanks Jason and everyone else. I know in my experience cts:search has been much faster. The one page I mentioned earlier that used to take 6 secs, now I've gotten it down to 0.188 on average, mostly due to changing out XPath queries to be cts. I'm not exactly sure why, and I'm hearing that

Re: [MarkLogic Dev General] How To Get The "Content" of An Index?

2011-05-12 Thread Mike Sokolov
I've always been baffled by this interpretation - thanks for explaining. Doesn't it seem as if .//foo *should* mean "descendant-or-self::foo" ? At least that is what every newcomer's interpretation seems to be. I guess one can't change the spec if that's not the case. If it did, then .//foo[

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread Jason Hunter
Let me try to answer the general question... The thing to remember about cts:search is it's a controlled vocabulary. You can only express constraints using cts:query constructs, and those constructs were designed and defined by our engineering team with our indexes in mind. XPath was designed

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread seme...@hotmail.com
I appreciate the help, but I'll just note that this is really just to satisfy my curiosity. I'm ok with my performance now, cuz I got my page time to 0.3 secs, down from 6 secs. But this is good for my learning so I appreciate it. I am using 4.2-3.2. Did you mean xdmp:query-trace? Cuz I don't s

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread Michael Blakeley
You can probably see the difference in query execution by comparing the output from xdmp:plan() or the log output using cts:query-trace(). You should also mention which server release you are using. -- Mike On 12 May 2011, at 09:29 , seme...@hotmail.com wrote: > Here are some queries that are

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread seme...@hotmail.com
That one takes 0.038 secs, slightly faster than the 0.04 other XPath one. But I'm really more interested in why the cts version performs better. From: breinhol...@ldschurch.org To: general@developer.marklogic.com Date: Thu, 12 May 2011 10:43:39 -0600 Subject: Re: [MarkLogic Dev General] Why is c

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread Keith L. Breinholt
You might try the moving the @key reference out of the filter like this: fn:collection()/resource-bundle/resource/@key[. eq $key]/..[fn:lang($lang-code)] Putting the attribute name in the filter sometimes doesn't allow the XPath to use an index for the query. Moving it to the p

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread seme...@hotmail.com
Here are some queries that are similar to the code I was talking about. XPath (0.04 secs) xquery version '1.0-ml'; let $key := "mykey" let $lang-code := "spa" return fn:collection()/resource-bundle/resource [@key = $key] [fn:lang($lang-code)] cts (0.015 sec) xquery version '1.0-ml'; l

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread Danny Sokolsky
I would echo what Kelly is saying, emphasizing the word "equivalent". XPath has a contract to return things in document order. cts:search has a contract to return things in relevance order. Depending on what you are doing, one can be less work than another (for example, it can create some work

[MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread Kelly Stirman
Equivalent XPath and cts:search expressions should perform the same. Can you share an example, and what version you are using? If they are equivalent and there is a performance difference, then there may be a bug. Kelly Message: 5 Date: Thu, 12 May 2011 09:05:16 -0600 From: "seme...@hotmail.co

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread Abishek N
I have encountered situations where Xpath is faster than cts:search.. It depends how the xpath has been constructed.. and how many results would the xpath return. If your Xpath has '//' then that would definitely slow down. On Thu, May 12, 2011 at 11:17 AM, seme...@hotmail.com wrote: > I mean

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread seme...@hotmail.com
I mean in general. I've always heard that cts:search is almost always as fast or faster than XPath. I'm finding that to be the case, and wondering why that is the case in general. From: breinhol...@ldschurch.org To: general@developer.marklogic.com Date: Thu, 12 May 2011 09:11:17 -0600 Subject:

Re: [MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread Keith L. Breinholt
Perhaps you could give us the XPath and the cts:search() code. It would make it easier to diagnose. - Keith From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of seme...@hotmail.com Sent: Thursday, May 12, 2011 9:05 AM To: general@develope

[MarkLogic Dev General] Why is cts:search so much faster than XPath?

2011-05-12 Thread seme...@hotmail.com
I wrote awhile ago that I thought it was usually best to use search:search for full text searching, cts:search for node selection out of the db, and XPath for node selection within a document. I just ran into a situation that doing the same query for nodes in the DB using cts:search was 6 times

Re: [MarkLogic Dev General] MarkLogic and Cocoon

2011-05-12 Thread Geert Josten
Hi Gary, There might be code around (someone in my company did some work on Java connectors for MarkLogic Server), but it might be easier to access MarkLogic Server through HTTP. I am doing so at home actually. It allows you to take a more functional approach. Here is an example how someone use

[MarkLogic Dev General] MarkLogic and Cocoon

2011-05-12 Thread Gary Larsen
I'm in the process of converting a Cocoon application to use MarkLogic as its database. If there were more time I would look at moving away from Cocoon and using MarkLogic pipelines but that's too much to tackle right now. Because of this I was wondering if anyone in this community might know

Re: [MarkLogic Dev General] Long date to Marklogic date format

2011-05-12 Thread Harry Bakken
I think you may find this blog post helpful: http://xquerywebappdev.wordpress.com/2010/08/27/xquery-pattern-date-formatter/ On Thu, May 12, 2011 at 4:51 AM, Abhishek53 S wrote: > > Hi All > > I have the date value stored into Marklogic as the long format (java date > to long utility). Is ther

[MarkLogic Dev General] Long date to Marklogic date format

2011-05-12 Thread Abhishek53 S
Hi All I have the date value stored into Marklogic as the long format (java date to long utility). Is there any way to convert the long date to marklogic compatible date format. Thanks in advance ! Abhishek Srivastav Systems Engineer Tata Consultancy Services Cell:- +91-9883389968 Mailto: abhis