The docs talk about comparing to values, but don't address buckets. Does this
work?
search:search('date LT 2000', $options)
Note that I'm using the value "2000" rather than the bucket "2000s".
--
Dave Cassel
Developer Community Manager
MarkLogic Corporation<http://www.marklogic.com/>
Cell: +1-484-798-8720
From: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Wednesday, November 26, 2014 at 9:32 AM
To: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] Relational operators on contraints
Hi Dave,
I did try inequality operators earlier as well. But it did not
work out. Please find the scr.shot.
Thanks,
Diwakar N
________________________________________
From:
[email protected]<mailto:[email protected]>
<[email protected]<mailto:[email protected]>>
on behalf of
[email protected]<mailto:[email protected]>
<[email protected]<mailto:[email protected]>>
Sent: 26 November 2014 19:13
To: [email protected]<mailto:[email protected]>
Subject: General Digest, Vol 125, Issue 40
Send General mailing list submissions to
[email protected]<mailto:[email protected]>
To subscribe or unsubscribe via the World Wide Web, visit
http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
[email protected]<mailto:[email protected]>
You can reach the person managing the list at
[email protected]<mailto:[email protected]>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."
Today's Topics:
1. Relational operators on contraints
([email protected]<mailto:[email protected]>)
2. Re: Relational operators on contraints (Dave Cassel)
----------------------------------------------------------------------
Message: 1
Date: Wed, 26 Nov 2014 07:10:17 +0000
From: <[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] Relational operators on contraints
To: <[email protected]<mailto:[email protected]>>
Message-ID:
<[email protected]<mailto:[email protected]>>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
I have created bucketed contraint as below on a date tag and i have
created range index for the same. All i could use is ':' operator on the
constraint while doing search. Am not able to using any relational operators.
let $options := <options xmlns="http://marklogic.com/appservices/search">
<return-results>false</return-results>
<constraint xmlns = "http://marklogic.com/appservices/search"
name="date">
<range type="xs:gYear" facet="true">
<bucket lt="1930" ge="1920" name="1920s">1920s</bucket>
<bucket lt="1940" ge="1930" name="1930s">1930s</bucket>
<bucket lt="1950" ge="1940" name="1940s">1940s</bucket>
<bucket lt="1960" ge="1950" name="1950s">1950s</bucket>
<bucket lt="1970" ge="1960" name="1960s">1960s</bucket>
<bucket lt="1980" ge="1970" name="1970s">1970s</bucket>
<bucket lt="1990" ge="1980" name="1980s">1980s</bucket>
<bucket lt="2000" ge="1990" name="1990s">1990s</bucket>
<bucket ge="2000" name="2000s">2000s</bucket>
<facet-option>limit=15</facet-option>
<element ns="http://dtd.cambridge.org/2007/CBML"
name="history-date"/>
</range>
</constraint>
</options>
for ex:
search:search('date:1990s',$options) is working fine. But
search:search('date lt 2000s',$options) or
search:search('date lt 2000s AND gt 1980s',$options) e.t.c are
not working at all.
Please let me know the correct way of using relational operators in
search:search.
Thanks,
Diwakar N
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not the
intended recipient, you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately and destroy all copies of this message and
any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted by this
email.
www.wipro.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20141126/1b521c28/attachment-0001.html
------------------------------
Message: 2
Date: Wed, 26 Nov 2014 13:43:45 +0000
From: Dave Cassel <[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] Relational operators on
contraints
To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Message-ID:
<d09b42de.80249%[email protected]<mailto:d09b42de.80249%[email protected]>>
Content-Type: text/plain; charset="us-ascii"
Hi Diwakar,
The default Search API's grammar uses LT, LE, GT, and GE for
inequalities<http://docs.marklogic.com/guide/search-dev/string-query#id_23164>,
so something like "date LT 2000s ought to work.
Dave.
--
Dave Cassel
Developer Community Manager
MarkLogic Corporation<http://www.marklogic.com/>
Cell: +1-484-798-8720
From:
"[email protected]<mailto:[email protected]><mailto:[email protected]>"
<[email protected]<mailto:[email protected]><mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]><mailto:[email protected]>>
Date: Wednesday, November 26, 2014 at 2:10 AM
To:
"[email protected]<mailto:[email protected]><mailto:[email protected]>"
<[email protected]<mailto:[email protected]><mailto:[email protected]>>
Subject: [MarkLogic Dev General] Relational operators on contraints
Hi,
I have created bucketed contraint as below on a date tag and i have
created range index for the same. All i could use is ':' operator on the
constraint while doing search. Am not able to using any relational operators.
let $options := <options xmlns="http://marklogic.com/appservices/search">
<return-results>false</return-results>
<constraint xmlns = "http://marklogic.com/appservices/search"
name="date">
<range type="xs:gYear" facet="true">
<bucket lt="1930" ge="1920" name="1920s">1920s</bucket>
<bucket lt="1940" ge="1930" name="1930s">1930s</bucket>
<bucket lt="1950" ge="1940" name="1940s">1940s</bucket>
<bucket lt="1960" ge="1950" name="1950s">1950s</bucket>
<bucket lt="1970" ge="1960" name="1960s">1960s</bucket>
<bucket lt="1980" ge="1970" name="1970s">1970s</bucket>
<bucket lt="1990" ge="1980" name="1980s">1980s</bucket>
<bucket lt="2000" ge="1990" name="1990s">1990s</bucket>
<bucket ge="2000" name="2000s">2000s</bucket>
<facet-option>limit=15</facet-option>
<element ns="http://dtd.cambridge.org/2007/CBML"
name="history-date"/>
</range>
</constraint>
</options>
for ex:
search:search('date:1990s',$options) is working fine. But
search:search('date lt 2000s',$options) or
search:search('date lt 2000s AND gt 1980s',$options) e.t.c are
not working at all.
Please let me know the correct way of using relational operators in
search:search.
Thanks,
Diwakar N
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not the
intended recipient, you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately and destroy all copies of this message and
any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted by this
email.
www.wipro.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20141126/1321ca8d/attachment.html
------------------------------
_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general
End of General Digest, Vol 125, Issue 40
****************************************
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general