0
votes

I'm having different results when using default snippeting inside marklogic as opposed to modifying the transform-results within options. The problem is that I don't understand what snippeting is doing to return the different results. When I use default settings it doesn't return all matches. after just increasing all the default numbers I finally received all the matching nodes from the document. I am doing this search specifically on one document only. Here are my options:

  <options xmlns="http://marklogic.com/appservices/search">
    <additional-query>
      <cts:document-query depth="infinity" xmlns:cts="http://marklogic.com/cts">
        <cts:uri>{$uri}</cts:uri>
      </cts:document-query>
    </additional-query>
    <transform-results apply="snippet">
      <max-matches>100</max-matches>
      <max-snippet-chars>200000000000</max-snippet-chars>
    </transform-results>
    <search-option>filtered</search-option>
  </options>

What exactly does max-snippet-chars do? is this max char amount meant for the total of all snippet matches? What if I want all matches from the document to appear regardless of a character limit?

1

1 Answers

2
votes

The max-snippet-chars setting is the maximum number of contextual characters per match.

The per-match-tokens setting is the maximum number of words and non-words (exclusive of spaces) per match.

The max-matches setting is the maximum number of matches per snippet.

For more, please see:

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

You can always write your own snippeting routine, using the cts:highlight() function to highlight all of the matches. Please see:

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

Hoping that helps,