Hi,
What about using element-range-query, like:
cts:search( fn:collection("UserDetails")//User,
cts:and-query((
cts:element-range-query(xs:QName(" Surname"),">=","S"),
cts:element-range-query(xs:QName(" Surname"),"<","T")
))
)
You need to setup a string range index on Surname
Szabolcs
On 10/02/2011 11:25, "Geert Josten" <[email protected]> wrote:
> Hi Mano,
>
> You could do fn:collection("UserDetails")//User//Surname[fn:starts-with(J¹,
> .)], but I don¹t really expect that to be faster than using the wildcard
> option of the query. Could even be that above expression is optimized to your
> query.
>
> Kind regards,
> Geert
>
>
> Van: [email protected]
> [mailto:[email protected]] Namens mano m
> Verzonden: donderdag 10 februari 2011 11:44
> Aan: [email protected]
> Onderwerp: [MarkLogic Dev General] Alternate for wildcard search
>
>
> Hi,
>
>
>
> In my application I have to display the list user name starts with the
> character choosen by the User. In the ML database all the Wildcard options are
> disabled. I have enabled the Wildcard in cts:element-word-query() directly ,
> which slow down the query execution. Is there anyother way to get the user
> names starts with specific character?
>
>
>
> Sample query:
>
> cts:search (fn:collection("UserDetails")//User,
> cts:element-word-query(xs:QName ("Surname"),"J*",
> "wildcarded"))
>
>
>
> Regards,
>
> Mano
>
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
********************************************************************************
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and
attachments (if any). No contracts may be concluded on behalf of Macmillan
Publishers Limited or its agents by means of e-mail communication. Macmillan
Publishers Limited Registered in England and Wales with registered number
785998
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS
********************************************************************************
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general