Are you looking for this?

      
<search:facet-option><search:facet-option>frequency-order</search:facet-option>


Here it is in a complete example from the 
docs<http://docs.marklogic.com/search:search?q=search:search&v=8.0&api=true>:

<options 
xmlns="http://marklogic.com/appservices/search";<http://marklogic.com/appservices/search>>
  ...
  <constraint name="color-facet">
    <range type="xs:string" facet="true">
      <element ns="" name="bodycolor"/>
      <!-- the facet-option values are passed directly to the
           underlying lexicon calls -->
      <facet-option>frequency-order</facet-option>
      <facet-option>descending</facet-option>
    </range>
  </constraint>
  ...
</options>



Sam Mefford
Senior Engineer
MarkLogic Corporation
[email protected]<mailto:[email protected]>
Cell: +1 801 706 9731
www.marklogic.com<http://www.marklogic.com>

This e-mail and any accompanying attachments are confidential. The information 
is intended
solely for the use of the individual to whom it is addressed. Any review, 
disclosure, copying,
distribution, or use of this e-mail communication by others is strictly 
prohibited. If you
are not the intended recipient, please notify us immediately by returning this 
message to
the sender and delete all copies. Thank you for your cooperation.


On 2/22/2015 9:00 PM, Maisnam Ns wrote:
Hi ,

Can someone help me in converting this JAVA API Options to xml options, I am 
stuck with the 'frequency-order' which is there below in Java formation but 
couldn't get how to put this 'frequency-order' in xml query options syntax:

JAVA :

QueryOptionsHandle options = new QueryOptionsHandle().withValues(
            qob.values("country",
                    qob.range(
                        qob.elementRangeIndex(new QName("country"),
                            
qob.stringRangeType(QueryOptions.DEFAULT_COLLATION))),
                    "frequency-order"));
optionsMgr.writeOptions(optionsName, options);

QueryManager queryMgr = client.newQueryManager();

ValuesDefinition valuesDef = queryMgr.newValuesDefinition("country", 
optionsName);

 valuesDef.setFrequency(Frequency.ITEM);


XML:

<search:options xmlns="http://marklogic.com/appservices/search";>
  <search:values name="country">

    <search:range type="xs:string"
      collation="http://marklogic.com/collation/";>
      <search:element ns="" name="country"/>
    </search:range>
  <search:values/><search:values/>
</search:options>



Above where to put frequency-order element? As I want to get the same


result using the above xml to that of Java formation



Thanks





_______________________________________________
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