Skip to content

Commit bb17328

Browse files
FudgeErlend Simonsen
andauthored
Expose SnippetGenerator.set_max_num_chars() so changing the default is possible (#323)
Co-authored-by: Erlend Simonsen <[email protected]>
1 parent 4df19aa commit bb17328

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/snippet.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,8 @@ impl SnippetGenerator {
8080
let result = self.inner.snippet(&text);
8181
Snippet { inner: result }
8282
}
83+
84+
pub fn set_max_num_chars(&mut self, max_num_chars: usize) {
85+
self.inner.set_max_num_chars(max_num_chars);
86+
}
8387
}

tantivy/tantivy.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,3 +433,6 @@ class SnippetGenerator:
433433

434434
def snippet_from_doc(self, doc: Document) -> Snippet:
435435
pass
436+
437+
def set_max_num_chars(self, max_num_chars: int) -> None:
438+
pass

0 commit comments

Comments
 (0)