Or, if all you want to do is use a different character than "-" for the not 
operator, then you can modify your search grammar and specify a different 
character.  The doc describes the grammar here:

http://docs.marklogic.com/4.2doc/docapp.xqy#display.xqy?fname=http://pubs/4.2doc/xml/search-dev-guide/search-api.xml%2344520

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Damon Feldman
Sent: Wednesday, October 05, 2011 6:20 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] implement a NOT condition for a constraint 
in search query.


Sachin,

I'm not sure exactly what you need, but consider adding an "additional-query" 
per the search:search documentation such as

cts:not-query(cts:element-value-query(xs:QName("uniqueref"), "695541627")).

These "cts" queries form the underlying and/or/not conditions of your 
search:search query and you can add them directly this way.

Yours,
Damon
________________________________
From: [email protected] 
[[email protected]] On Behalf Of sachin gill 
[[email protected]]
Sent: Wednesday, October 05, 2011 3:41 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] implement a NOT condition for a constraint 
in search query.
Hi Colleen ,
  Thanks for the response, but for my requirement I require a solution other 
than " - " opertaor as our standard does not allow to use this operator.
Thanks
Sachin

On Tue, Oct 4, 2011 at 9:30 PM, Colleen Whitney 
<[email protected]<mailto:[email protected]>> wrote:
Not query is part of the default grammar, using the "-" operator. So try  
querying for "-uniqueref:16633" (you can verify how that parses using 
search:parse). But are you asking whether you can bake that into the constraint?

Sent from my iPhone

On Oct 4, 2011, at 5:54 AM, "sachin gill" 
<[email protected]<mailto:[email protected]>> wrote:
Hi  ,
 I need to implement a  search query  where  constraints are mentioned below :
<options xmlns="http://marklogic.com/appservices/search";>
  <constraint name="contenttype">
<value>
<element ns=" name="contentType"/>
</value>
 </constraint>
 <constraint name="uniqueref">
<value>
<element ns="" name="uniqueref"/>
</value>
 </constraint>
 </options>
and below is the query, I need to implement NOT condition for uniqueref 
constraint.
let $query := fn:concat("contenttype:document","  uniqueref:1695541627")
how can I implement it because I m facing issues.

Thanks
Sachin
_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general

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

Reply via email to