Hi ,

I am using MarkLogic 6.0 Rest Api's to search content and I have an query about 
facets.


I am getting by default facet for an element like "author" as below in my 
search result from content:

<search:facet name="author" type="xs:string">
 <search:facet-value name="" count="87462"/>
 <search:facet-value name=" " count="287"></search:facet-value>
 <search:facet-value name=" " count="7892"></search:facet-value>
 <search:facet-value name=" Marino" count="1">Marino</search:facet-value>
  <search:facet-value name="<i>from</i> ABC News" count="7"><i>from</i> ABC 
News</search:facet-value>
</search:facet>

In above result , I am getting facet-value for those author elements which  
values are null, single or more space, new line null values and text values as 
by default behavior of REST API's.

As per my requirement, I don't want those null, single or more space and new 
line null values, I want only those facet-values which contains only text value 
as below.

<search:facet name="author" type="xs:string">
 <search:facet-value name=" Marino" count="1">Marino</search:facet-value>
  <search:facet-value name="<i>from</i> ABC News" count="7"><i>from</i> ABC 
News</search:facet-value>
</search:facet>


I created following constraint in search option file and created range path 
index (*:author[. ne ""][. ne " "]) in MarkLogic also.

<search:constraint name="author">
    <search:range 
collation="http://marklogic.com/collation//S2<http://marklogic.com/collation/S2>"
 type="xs:string" facet="true">
      <search:facet-option>ascending</search:facet-option>
      <search:facet-option>limit=10</search:facet-option>
                   <search:path-index>*:author[. ne ""][. ne " 
"]</search:path-index>
    </search:range>
  </search:constraint>

But I am able to remove only facet-value for author's element null values. I 
need to also remove facet values for single or more space and new line null 
values.
And we can't use    *:author[fn:normalize-space(.) ne ""]  as path index.

Is there any solution to achieve this goal?

Regards,
Asit Nautiyal

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.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to