Hi, Dinesh:

You can set the number of per-match-tokens and max-snippet-chars passed to 
search:snippet() to increase the size of the snippet. The example in the 
documentation shows these options:

    http://docs.marklogic.com/search:snippet

If the built-in capabilities don't meet your requirements, you can create your 
own snippetting function:

    http://docs.marklogic.com/guide/search-dev/query-options#id_61707

Because snippeting is a low-level match extraction and result construction 
operation, you will probably want to compare the performance of different 
options or implementations on the documents in your corpus.


Hoping that helps,


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of Dinesh 
[[email protected]]
Sent: Friday, July 25, 2014 7:22 PM
To: [email protected]
Subject: [MarkLogic Dev General] Search Snippet

Hi All,

I would like to know if it is possible for the search:snippet in the search API 
to always return at least 2 lines of snippet with a defined number of words 
surrounding the search hits.

Is there any options that allows the search to parse through the XML and return 
the required number of words for the snippet ?

Thanks.

Regards,
Dinesh


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to