Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion document/field_geopoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,12 @@
prefixCoded := numeric.MustNewPrefixCodedInt64(int64(mhash), 0)

// docvalues are always enabled for geopoint fields, even if the
// indexing options are set to not include them
// indexing options are set to not include docvalues.
// snappy compression and chunking are always skipped for geopoint
// to avoid mem copies and faster lookups.
options |= index.DocValues
options |= index.SkipDVChunking

Check failure on line 189 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: index.SkipDVChunking

Check failure on line 189 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 189 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

undefined: index.SkipDVChunking

Check failure on line 189 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 189 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 189 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, macos-latest)

undefined: index.SkipDVChunking

Check failure on line 189 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

undefined: index.SkipDVChunking
options |= index.SkipDVCompression

Check failure on line 190 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: index.SkipDVCompression

Check failure on line 190 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 190 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

undefined: index.SkipDVCompression

Check failure on line 190 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 190 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 190 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, macos-latest)

undefined: index.SkipDVCompression

Check failure on line 190 in document/field_geopoint.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

undefined: index.SkipDVCompression

return &GeoPointField{
name: name,
Expand Down
8 changes: 8 additions & 0 deletions document/field_geoshape.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@

// docvalues are always enabled for geoshape fields, even if the
// indexing options are set to not include docvalues.
// snappy compression and chunking are always skipped for geoshape
// to avoid mem copies and faster lookups.
options |= index.DocValues
options |= index.SkipDVChunking

Check failure on line 186 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: index.SkipDVChunking

Check failure on line 186 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 186 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

undefined: index.SkipDVChunking

Check failure on line 186 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 186 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 186 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, macos-latest)

undefined: index.SkipDVChunking

Check failure on line 186 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

undefined: index.SkipDVChunking
options |= index.SkipDVCompression

Check failure on line 187 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: index.SkipDVCompression

Check failure on line 187 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 187 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

undefined: index.SkipDVCompression

Check failure on line 187 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 187 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 187 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, macos-latest)

undefined: index.SkipDVCompression

Check failure on line 187 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

undefined: index.SkipDVCompression

return &GeoShapeField{
shape: shape,
Expand Down Expand Up @@ -232,7 +236,11 @@

// docvalues are always enabled for geoshape fields, even if the
// indexing options are set to not include docvalues.
// snappy compression and chunking are always skipped for geoshape
// to avoid mem copies and faster lookups.
options |= index.DocValues
options |= index.SkipDVChunking

Check failure on line 242 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: index.SkipDVChunking

Check failure on line 242 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 242 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

undefined: index.SkipDVChunking

Check failure on line 242 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 242 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

undefined: index.SkipDVChunking

Check failure on line 242 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, macos-latest)

undefined: index.SkipDVChunking

Check failure on line 242 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

undefined: index.SkipDVChunking
options |= index.SkipDVCompression

Check failure on line 243 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: index.SkipDVCompression

Check failure on line 243 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 243 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

undefined: index.SkipDVCompression

Check failure on line 243 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 243 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

undefined: index.SkipDVCompression

Check failure on line 243 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, macos-latest)

undefined: index.SkipDVCompression

Check failure on line 243 in document/field_geoshape.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

undefined: index.SkipDVCompression

return &GeoShapeField{
shape: shape,
Expand Down
8 changes: 2 additions & 6 deletions index/scorch/snapshot_segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ import (
segment "github.com/blevesearch/scorch_segment_api/v2"
)

var TermSeparator byte = 0xff

var TermSeparatorSplitSlice = []byte{TermSeparator}

type SegmentSnapshot struct {
// this flag is needed to identify whether this
// segment was mmaped recently, in which case
Expand Down Expand Up @@ -233,7 +229,7 @@ func (cfd *cachedFieldDocs) prepareField(field string, ss *SegmentSnapshot) {
for err2 == nil && nextPosting != nil {
docNum := nextPosting.Number()
cfd.docs[docNum] = append(cfd.docs[docNum], []byte(next.Term)...)
cfd.docs[docNum] = append(cfd.docs[docNum], TermSeparator)
cfd.docs[docNum] = append(cfd.docs[docNum], index.DocValueTermSeparator)
cfd.size += uint64(len(next.Term) + 1) // map value
nextPosting, err2 = postingsItr.Next()
}
Expand Down Expand Up @@ -334,7 +330,7 @@ func (c *cachedDocs) visitDoc(localDocNum uint64,

if tlist, exists := cachedFieldDocs.docs[localDocNum]; exists {
for {
i := bytes.Index(tlist, TermSeparatorSplitSlice)
i := bytes.IndexByte(tlist, index.DocValueTermSeparator)
if i < 0 {
break
}
Expand Down
7 changes: 1 addition & 6 deletions search/searcher/search_geoshape.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ func NewGeoShapeSearcher(ctx context.Context, indexReader index.IndexReader, sha
return NewFilteringSearcher(ctx, mSearcher, buildRelationFilterOnShapes(ctx, dvReader, field, relation, shape)), nil
}

// Using the same term splitter slice used in the doc values in zap.
// TODO: This needs to be revisited whenever we change the zap
// implementation of doc values.
var termSeparatorSplitSlice = []byte{0xff}

func buildRelationFilterOnShapes(ctx context.Context, dvReader index.DocValueReader, field string,
relation string, shape index.GeoJSON,
) FilterFunc {
Expand Down Expand Up @@ -104,7 +99,7 @@ func buildRelationFilterOnShapes(ctx context.Context, dvReader index.DocValueRea
finishReading = true
}

dvShapeValue = append(dvShapeValue, termSeparatorSplitSlice...)
dvShapeValue = append(dvShapeValue, index.DocValueTermSeparator)
dvShapeValue = append(dvShapeValue, term...)
}

Expand Down
Loading