From 875e19ebd9920f16e5182069a7897bbb9097975f Mon Sep 17 00:00:00 2001 From: Casey Muller Date: Thu, 25 May 2017 08:23:39 -0700 Subject: [PATCH 1/2] Add comments to Location struct Closes #596 --- search/search.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/search/search.go b/search/search.go index a9bf9db9..2b4a8378 100644 --- a/search/search.go +++ b/search/search.go @@ -36,9 +36,14 @@ func (ap ArrayPositions) Equals(other ArrayPositions) bool { } type Location struct { + // Pos is the position of the term within the field, starting at 1 Pos uint64 `json:"pos"` + + // Start and End are the character offsets of the term in the field Start uint64 `json:"start"` End uint64 `json:"end"` + + // ArrayPositions contains the positions of the term within each array of subdocuments. ArrayPositions ArrayPositions `json:"array_positions"` } From 68b07c9e09ebbc0cc53583b30a6e7454ce1bf15c Mon Sep 17 00:00:00 2001 From: Casey Muller Date: Thu, 25 May 2017 08:32:10 -0700 Subject: [PATCH 2/2] Review feedback --- search/search.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/search.go b/search/search.go index 2b4a8378..cbbcfbfd 100644 --- a/search/search.go +++ b/search/search.go @@ -39,11 +39,11 @@ type Location struct { // Pos is the position of the term within the field, starting at 1 Pos uint64 `json:"pos"` - // Start and End are the character offsets of the term in the field + // Start and End are the byte offsets of the term in the field Start uint64 `json:"start"` End uint64 `json:"end"` - // ArrayPositions contains the positions of the term within each array of subdocuments. + // ArrayPositions contains the positions of the term within any elements. ArrayPositions ArrayPositions `json:"array_positions"` }