You can use search:snippet(), which is the same code search:search uses.

________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Shah, Mehul (LNG-NPV) 
[[email protected]]
Sent: Friday, October 15, 2010 1:07 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: [email protected] 
[mailto:[email protected]] 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: [email protected] 
[mailto:[email protected]] 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.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to