Sai,


cts:element-value-query() has absolutely nothing to do with range indexes.



--Mark



  _____

From: [email protected] 
[mailto:[email protected]] On Behalf Of sai shanker
Sent: Sunday, October 11, 2009 7:16 PM
To: General Mark Logic Developer Discussion
Subject: RE: [MarkLogic Dev General] help with cts-search



Hello Rahul,

Make sure you have range indexes set for the elements that you are using in the 
element-value-query.then try and see.

Sai.



--- On Sun, 10/11/09, Mark Helmstetter <[email protected]> wrote:


From: Mark Helmstetter <[email protected]>
Subject: RE: [MarkLogic Dev General] help with cts-search
To: "General Mark Logic Developer Discussion" <[email protected]>
Date: Sunday, October 11, 2009, 3:20 PM

The "explore" link in the upper left hand corner of CQ can be very helpful, if 
you haven't noticed already.  If you click on that with the appropriate 
database selected, you will probably see something like:



/documents/book1 - binary  (no properties)  (no collections)

/documents/book2 - binary  (no properties)  (no collections)



Notice that the documents are not XML, they are binary.



To correct this, add <format>xml</format> to your xdmp:document-load() options. 
 Or if you change your document URI to have a ".xml" extension.  Assuming that 
you haven't changed the default mimetype mappings, this would insert the 
document as XML.



After loading your documents as xml, you still have an issue with your query.  
There are no title elements with the value "Human".  You can change your query 
to a cts:element-word-query(), or change your search string to "Human *".



  _____

From: [email protected] 
[mailto:[email protected]] On Behalf Of Rahul Saluja
Sent: Sunday, October 11, 2009 2:51 PM
To: [email protected]
Subject: [MarkLogic Dev General] help with cts-search



Hello All,

I am doing hands on Marklogic where in i am using MLS4.1.2 and trying to use 
cts:search against a set of documents in my database which are loaded using

xdmp:document-load("C:\check\

book1.xml",
    <options xmlns="xdmp:document-load">
       <uri>/documents/book1</uri>
       <permissions>{xdmp:default-permissions()}</permissions>
       <repair>full</repair>
       <forests>
         <forest>{xdmp:forest("myPoc")}</forest>
       </forests>
    </options> ),
    xdmp:document-load("C:\check\book2.xml",
        <options xmlns="xdmp:document-load">
           <uri>/documents/book2</uri>
           <permissions>{xdmp:default-permissions()}</permissions>
           <repair>full</repair>
           <forests>
             <forest>{xdmp:forest("myPoc")}</forest>
           </forests>
    </options> )

structure most of the xml documents is as follows:


<?xml version="1.0" encoding="UTF-8"?>
<books>
    <book year="2001">
        <title>Human Anatomy</title>
        <author><first>Wesley</first><last>Martini</last></author>
        <publisher>Addison-Wesley</publisher>
        <price>139.00</price>
    </book>
</books>
now when i am trying to run following cts:search query against the database i 
get message saying  "your query returned an empty sequence" in cq

cts:search(collection()//descendant::books, cts:element-value-query(QName("", 
"title"), "Human", ("wildcarded", "case-insensitive")))

i have double checked the database documents are very much there .

can anybody suggest me where i am going wrong.

Looking forward to response.

regards
Rahul


-----Inline Attachment Follows-----

_______________________________________________
General mailing list
[email protected]<http://us.mc529.mail.yahoo.com/mc/[email protected]>
http://xqzone.com/mailman/listinfo/general



_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to