Hi Abhishek,
I think your sample query is working. You just need to have a document that
has a root element names story and a property with the QName prop:geography
containing the word "workspace". For example, this finds the inserted test.xml
document as a match:
xquery version "1.0-ml";
xdmp:document-insert("test.xml", <story/>),
xdmp:document-set-properties("test.xml",
<prop:geography>workspace</prop:geography>);
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
let $options := <options xmlns="http://marklogic.com/appservices/search">
<searchable-expression>/story</searchable-expression>
<constraint name="geo">
<properties name="prop:geography"/>
</constraint>
</options>
let $results := search:search("geo:workspace", $options, 1, 10)
return
$results
-Danny
From: [email protected]
[mailto:[email protected]] On Behalf Of Abhishek53 S
Sent: Thursday, April 28, 2011 11:34 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Property constraint
Hi All
I am going to use property constraint in my search module (not the
cts:property-query explicitly) . can any one suggest how to use with
example?The below sample query is not working.
let $options := <options xmlns="http://marklogic.com/appservices/search">
<searchable-expression>/story</searchable-expression>
<constraint name="geo">
<properties name="prop:geography"/>
</constraint>
</options>
let $results := search:search("geo:workspace", $options, 1, 10)
return
$results
The content property structure is like this.
<prop:geography>workspace</prop:geography>
Thanks in advance !
Abhishek Srivastav
Assistant Systems Engineer
Tata Consultancy Services
=====-----=====-----=====
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