First of all thanks a lot Danny for your reply.
The problem with the property constraint is that it is over the entire property of the document.What I mean to say if you add one more property say
xdmp:document-set-properties("test.xml", (<prop:geography>workspace</prop:geography>,
(<prop:sector>coal</prop:sectory>);
 
to the document and search with below query the document will come.
 

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:coal", $options, 1,  10)

    return  

    $results

 In the above query the property constraint is formed over the property geography but the value is given is of property sector.

I guess the property constraint is over the entire property of the document but not over any specific property. Is there any way to over come this ?

Thanks & Regards

Abhishek Srivastav
Assistant Systems Engineer
Tata Consultancy Services
Plot  B-1, Block EP & GP, Sector 5
Salt Lake Electronics Complex,
Kolkata - 700 091,West Bengal
India
Cell:- +91-9883389968
Mailto: [email protected]
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________

[email protected] wrote: -----

To: General MarkLogic Developer Discussion <[email protected]>
From: Danny Sokolsky <[email protected]>
Sent by: [email protected]
Date: 04/30/2011 07:53AM
Subject: Re: [MarkLogic Dev General] Property constraint

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

=====-----=====-----=====
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

Reply via email to