Hi

When I am querying data using custom constraint snippet is not displaying 
properly.

In my search option I have snippet code like that:
                                                 <transform-results 
apply="snippet" >
                                                                
<preferred-elements>
                                                                   <element 
name="title" />
                                                                
</preferred-elements>
                                                  </transform-results>

I have a two constraint
                                                   <constraint name="price">
                                                                  <range 
type="xs:int">
                                                                    <element 
name="price"/>
                                                                      <bucket 
name="less" lt="45">45$ less</bucket>
                                                                                
  <bucket name="medium" ge="45" lt="50">45$ to 50$</bucket>
                                                                      <bucket 
name="large" ge="50">More than 50$</bucket>
                                                                  </range>
                                                   </constraint>
                                                    <constraint 
name="filterprice" >
                                                                  <custom 
facet="false" >
                                                                        <parse 
apply="filterprice" ns="http://example/lib/search-lib"; 
at="/code/lib/search-lib.xqy"/>
                                                                  </custom>
                                                    </constraint>

My query  us search-content:search($query)

For $query = price:1 (first constraint will be invoked)

Result is correct (title of the book)
                             <search:snippet>





<search:match path="fn:doc(&quot;/content/test1.xml&quot;)/book">XML 
Developer's Guide</search:match>


</search:snippet>


For $query =filterprice:(large,less)(second constraint) I have written a range 
query for price in filterprice method
Result is incorrect (title of the book is not displaying )









<search:snippet>
<search:match path="fn:doc(&quot;/content/test1.xml&quot;)/book">





<search:highlight>23</search:highlight>





</search:match>





</search:snippet>



Sample xml is :
<book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>23</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications
      with XML.</description>
    </book>

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