[MarkLogic Dev General] Can we have different constraint name and facet name

Erik Hennum Erik.Hennum at marklogic.com
Thu May 2 07:06:55 PDT 2013


Hi, Gnana:

I can't think of a way to get the search API to return a label as part of the facet response.

One approach would be to maintain a mapping from constraint names to facet labels elsewhere (such as an XQuery or XSLT transform or in the view on the client).

Such a mapping could provide separation of the data and presentation layers (for instance, making it possible to show different labels to different users using familiar terminology).


Erik Hennum

________________________________
From: Gnanaprakash.Bodireddy at cognizant.com [Gnanaprakash.Bodireddy at cognizant.com]
Sent: Wednesday, May 01, 2013 11:53 PM
To: general at developer.marklogic.com; Erik Hennum
Subject: Can we have different constraint name and facet name

Hi Erik

I am trying to figure out whether we can have a different constraint name and facet name?

For example:
<search:constraint name="title">
    <search:range collation="http://marklogic.com/collation//S2" type="xs:string" facet="true">
      <search:facet-option>frequency-order</search:facet-option>
      <search:facet-option>descending</search:facet-option>
      <search:facet-option>limit=10</search:facet-option>
      <search:element ns=" " name="title"/>
    </search:range>
  </search:constraint>


In REST API, I can use title:<<value>> to limit the search results.

When I perform any search using REST API and when facets are returned, I want to have a different name i.e. instead of title I want to show “Book Title”.

Is it possible to have constraint name as title and facet name as “Book Title”?

Gnana

Gnanaprakash Bodireddy | Sr. Associate – Projects | IME | Cognizant Technology Solutions.
Address: Manyata Embassy Business Park, Outer Ring Road, Rachenahalli, Bangalore, Karnataka, Pin :560045
O: +91 (80) 66808000 extn: 502406| Mobile: +91 8197558899

Planned Vacation: May 13th to 24th

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20130502/3ea708e4/attachment.html 


More information about the General mailing list