[MarkLogic Dev General] snippets with cts:search

Danny Sokolsky Danny.Sokolsky at marklogic.com
Fri Oct 15 13:12:14 PDT 2010


Hi Mehul,

Yes, you would have to write code for that.  You can write your own snippet code for the search API too, and the search API has a mechanism to plug-in your own function (using the "apply" and "at" attributes).

-Danny

From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Shah, Mehul (LNG-NPV)
Sent: Friday, October 15, 2010 1:08 PM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] snippets with cts:search

Danny,

I saw that, however I would like to produce snippet with some important parameters (like words/chars around hit); more like search:search with options:

<transform-results apply="snippet">
   <per-match-tokens>30</per-match-tokens>
   <max-matches>4</max-matches>
   <max-snippet-chars>200</max-snippet-chars>
</transform-results>

Do I have to write some code to do that?

Thanks.

From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Friday, October 15, 2010 1:05 PM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] snippets with cts:search

You can use cts:highlight to highlight the results (in a for loop, for example) from a cts:search.  For some details, see the section "Using cts:highlight to Create Snippets" in the "Highlighting Search Term Matches" chapter of the Search Developer's Guide (page 93).

http://developer.marklogic.com/pubs/4.1/books/search-dev-guide.pdf

-Danny

From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Shah, Mehul (LNG-NPV)
Sent: Friday, October 15, 2010 9:41 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] snippets with cts:search

How do I produce snippets using cts:search, similar to search:search ?

Thanks,
Mehul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20101015/e4478977/attachment-0001.html 


More information about the General mailing list