Excellent.   That works great for strings which gets me half way.

The next hurdle is that we have some dates stored in attributes that we need
to query ranges for as well.  But if you put a function like
fn:starts-with() into the filter expression to grab the date portion of the
dateTime the expression becomes unsearchable.

We may need to pull the date values into an element.

Thanks for the suggestion Abhishek.

-Keith

On Fri, Aug 19, 2011 at 2:27 PM, Abhishek53 S <[email protected]> wrote:

> Hi Keith
>
> I guess the below givent query will help you .
>
> *xquery version "1.0-ml";*
> *import module namespace search = "http://marklogic.com/appservices/search
> "*
> *    at "/MarkLogic/appservices/search/search.xqy";*
> *
> *
> *search:search("kolkata",*
> *    <options xmlns="http://marklogic.com/appservices/search";>*
> *      <searchable-expression>/element()[@lang =
> "eng"]</searchable-expression>*
> *    </options>)*
>
> Regards
> Abhishek Srivastav
> Tata Consultancy Services
> Cell:- +91-9883389968
> Mailto: [email protected]
> Website: http://www.tcs.com
> ____________________________________________
> Experience certainty. IT Services
> Business Solutions
> Outsourcing
> ____________________________________________
>
> [email protected] wrote: -----
>
> To: [email protected]
> From: Keith Breinholt <[email protected]>
> Sent by: [email protected]
> Date: 08/20/2011 01:17AM
> Subject: [MarkLogic Dev General] How to query a attribute of a generic
> node...
>
>
> I want to display a set of documents that have a common attribute on the
> root node.  However, the root nodes of the documents can have any tag name
> such as <html>, <xml>, ...
>
> I can do this easily with XPath similar to this
>
>   element()/@lang[. eq 'eng']
>
> However, I'd like to use search:search for pagination and sorting of
> results.  The problem is I don't know a way to specify a generic parent for
> an attribute in a cts query.
>
> Any ideas or help is very appreciated.
>
> --
> Keith
> "Do what you can, with what you have, where you are." - Theodore Roosevelt
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
> =====-----=====-----=====
> 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
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>


-- 
Keith
"Do what you can, with what you have, where you are." - Theodore Roosevelt
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to