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]>" 
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, November 26, 2014 at 2:10 AM
To: "[email protected]<mailto:[email protected]>" 
<[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
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to