Anil,

I meant to write "sequence of nodes" not "sequence of path expressions".  
Variables and constructed sequences are not searchable path expressions.  You 
are specifying a variable as a first argument to cts:search.  That's why the 
server is throwing the XDMP-UNSEARCHABLE exception.

These simplified examples, use your XML sample, may help illustrate the point:

let $speeches := fn:doc("/C/Users/ashekhar/Desktop/Mark 
Logic/Shakespeare/dream.xml")//SPEECH
return
  cts:search($speeches,
    cts:word-query("with flowers"))

=>

[0.9-ml] XDMP-UNSEARCHABLE: cts:search(doc("/C/Users/ashekhar/Desktop/Mark 
Logic/Shakespeare/dream.xml")/SPEECH, cts:word-query("with flowers", 
("lang=en"), 1)) -- Expression is unsearchable



cts:search(fn:doc("C/Users/ashekhar/Desktop/Mark 
Logic/Shakespeare/dream.xml")//SPEECH,
  cts:word-query("with flowers"))

=>

<SPEECH>
  <SPEAKER>PUCK</SPEAKER>
  <LINE>The king doth keep his revels here to-night:</LINE>
  <LINE>Take heed the queen come not within his sight;</LINE>
  <LINE>For Oberon is passing fell and wrath,</LINE>
  <LINE>Because that she as her attendant hath</LINE>
  <LINE>A lovely boy, stolen from an Indian king;</LINE>
  <LINE>She never had so sweet a changeling;</LINE>
  <LINE>And jealous Oberon would have the child</LINE>
  <LINE>Knight of his train, to trace the forests wild;</LINE>
  <LINE>But she perforce withholds the loved boy,</LINE>
  <LINE>Crowns him with flowers and makes him all her joy:</LINE>
  <LINE>And now they never meet in grove or green,</LINE>
  <LINE>By fountain clear, or spangled starlight sheen,</LINE>
  <LINE>But, they do square, that all their elves for fear</LINE>
  <LINE>Creep into acorn-cups and hide them there.</LINE>
</SPEECH>


--Ronnen


From: [email protected] 
[mailto:[email protected]] On Behalf Of Anil Shekhar
Sent: Friday, October 02, 2009 6:08 PM
To: [email protected]
Subject: RE: [MarkLogic Dev General] XDMP-UNSEARCHABLE: cts:search - Expression 
is unsearchable

Thanks Ronnen for your quick reply.  I did read up the doc on cts:search.
cts:search(


$expression as node()*,


$query as cts:query?,


[$options as xs:string*],


[$quality-weight as xs:double],


[$forest-ids as xs:unsignedLong*]

)  as  node()*


[http://developer.marklogic.com/pubs/4.0/apidocs/images/varspace.gif]

[http://developer.marklogic.com/pubs/4.0/apidocs/images/varspace.gif]Summary:

Returns a relevance-ordered sequence of nodes specified by a given query.

[http://developer.marklogic.com/pubs/4.0/apidocs/images/varspace.gif]Parameters:
[http://developer.marklogic.com/pubs/4.0/apidocs/images/varspace.gif]
$expression : An expression to be searched. This must be an inline fully 
searchable path expression.




Doesn't the following mean

" $expression as node()*, " => "0 or more nodes"?

In the example given in the doc,


  cts:search(//SPEECH,

    cts:word-query("with flowers"))



  => ... a sequence of 'SPEECH' element ancestors (or self)

     of any node containing the phrase 'with flowers'.

Doesn't //SPEECH yields all the SPEECH nodes in the XML file?

The data files I am referring to are Shakespeare XML files.  I am attaching 
this for your reference.

Thanks for your time and patience
Anil



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

Reply via email to