Jason: Thanks for pointing this out. I never knew it before, and it could definitely be a powerful tool to have in the toolbox!
Doug Glidden Software Engineer The Boeing Company [email protected] -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jason Hunter Sent: Wednesday, December 23, 2009 01:38 To: General Mark Logic Developer Discussion Subject: Re: [MarkLogic Dev General] How to get cts:element-value-query()tonotdecend to the depths of Hades Did you know you can use cts:contains() in an XPath expression? It accepts a cts:query so you can use all the powerful features of Mark Logic text indexes against basic XPath. Performance tip: XPath expressions like that will cross fragments. It's a way to have a cts:and-query evaluate across fragments. It just won't be efficient if you do something like that against a large data set, so be careful. -jh- On Dec 22, 2009, at 6:24 AM, Lee, David wrote: > Thanks, yes I considered that ... but the reason I'm not using it is because > I want to use the search capibilities such as wildcarding and case > insensitivity. Turning those into pure xquery expressions then results in > searches that dont perform very well (atleast for me). > > > From: [email protected] on behalf of Glidden, > Douglass A > Sent: Tue 12/22/2009 8:25 AM > To: [email protected] > Subject: RE: [MarkLogic Dev General] How to get > cts:element-value-query() tonotdecend to the depths of Hades > > David, > > I realize I'm a little late with my answer, but just to throw another option > into the pool, did you consider getting rid of the cts:search completely? > That is, if I were doing something like this, I would be inclined to do it > entirely with XPath: > fn:doc("doc")/doc[name="Sub Part"] > I realize your real query is probably significantly more complex than your > example, but it's just another idea to consider. > > Doug Glidden > Software Engineer > The Boeing Company > [email protected] > > From: [email protected] > [mailto:[email protected]] On Behalf Of Lee, > David > Sent: Monday, December 21, 2009 08:16 > To: [email protected] > Subject: [MarkLogic Dev General] How to get cts:element-value-query() > to notdecend to the depths of Hades > > I have a XML doc (not my own design) something like <doc> > <name>Title</name> > <part> > <name>Part</name> > <subpart> > <name>Sub Part<name> > </subpart> > </part> > ... > > </doc> > > > I want a cts:search query that will match <name>Title</name> but not > <name>Sub Part<name> or other names. > > cts:search( doc("doc")/doc , cts:element-value-query( xs:QName("name") , "Sub > Part") ) > > matches when I do not want it to. How can I restrict > cts:element-value-query from matching descendant nodes ? > I looked at adding an and-not-query but that wont work because its > possible for multiple name elements to have the same value and I dont want a > match discarded just because it matched in multiple places. > > Any suggestions ? > > > > > > > ---------------------------------------- > David A. Lee > Senior Principal Software Engineer > Epocrates, Inc. > [email protected] > 812-482-5224 > > > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
