Skip to content

Commit

Permalink
Add max_analyzed_offset to highlighter
Browse files Browse the repository at this point in the history
Close #1591
  • Loading branch information
olivere committed Mar 19, 2022
1 parent 7ca4227 commit fa42b0c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions highlight.go
Expand Up @@ -18,6 +18,7 @@ type Highlight struct {
order *string
encoder *string
requireFieldMatch *bool
maxAnalyzedOffset *int
boundaryMaxScan *int
boundaryChars *string
boundaryScannerType *string
Expand Down Expand Up @@ -95,6 +96,11 @@ func (hl *Highlight) RequireFieldMatch(requireFieldMatch bool) *Highlight {
return hl
}

func (hl *Highlight) MaxAnalyzedOffset(maxAnalyzedOffset int) *Highlight {
hl.maxAnalyzedOffset = &maxAnalyzedOffset
return hl
}

func (hl *Highlight) BoundaryMaxScan(boundaryMaxScan int) *Highlight {
hl.boundaryMaxScan = &boundaryMaxScan
return hl
Expand Down Expand Up @@ -184,6 +190,9 @@ func (hl *Highlight) Source() (interface{}, error) {
if hl.requireFieldMatch != nil {
source["require_field_match"] = *hl.requireFieldMatch
}
if hl.maxAnalyzedOffset != nil {
source["max_analyzed_offset"] = *hl.maxAnalyzedOffset
}
if hl.boundaryMaxScan != nil {
source["boundary_max_scan"] = *hl.boundaryMaxScan
}
Expand Down

0 comments on commit fa42b0c

Please sign in to comment.