Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ale
liber
Commits
28430343
Commit
28430343
authored
Jul 31, 2019
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dependencies
parent
1133933d
Pipeline
#3930
passed with stages
in 5 minutes and 21 seconds
Changes
418
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
2369 additions
and
621 deletions
+2369
-621
vendor/github.com/RoaringBitmap/roaring/LICENSE
vendor/github.com/RoaringBitmap/roaring/LICENSE
+33
-0
vendor/github.com/RoaringBitmap/roaring/bitmapcontainer.go
vendor/github.com/RoaringBitmap/roaring/bitmapcontainer.go
+1
-1
vendor/github.com/RoaringBitmap/roaring/go.mod
vendor/github.com/RoaringBitmap/roaring/go.mod
+15
-0
vendor/github.com/RoaringBitmap/roaring/go.sum
vendor/github.com/RoaringBitmap/roaring/go.sum
+29
-0
vendor/github.com/RoaringBitmap/roaring/roaring.go
vendor/github.com/RoaringBitmap/roaring/roaring.go
+32
-22
vendor/github.com/RoaringBitmap/roaring/roaringarray.go
vendor/github.com/RoaringBitmap/roaring/roaringarray.go
+16
-8
vendor/github.com/blevesearch/bleve/geo/geohash.go
vendor/github.com/blevesearch/bleve/geo/geohash.go
+111
-0
vendor/github.com/blevesearch/bleve/geo/parse.go
vendor/github.com/blevesearch/bleve/geo/parse.go
+32
-0
vendor/github.com/blevesearch/bleve/index.go
vendor/github.com/blevesearch/bleve/index.go
+10
-0
vendor/github.com/blevesearch/bleve/index/index.go
vendor/github.com/blevesearch/bleve/index/index.go
+31
-3
vendor/github.com/blevesearch/bleve/index/scorch/introducer.go
...r/github.com/blevesearch/bleve/index/scorch/introducer.go
+9
-3
vendor/github.com/blevesearch/bleve/index/scorch/merge.go
vendor/github.com/blevesearch/bleve/index/scorch/merge.go
+32
-17
vendor/github.com/blevesearch/bleve/index/scorch/mergeplan/merge_plan.go
...om/blevesearch/bleve/index/scorch/mergeplan/merge_plan.go
+2
-2
vendor/github.com/blevesearch/bleve/index/scorch/optimize.go
vendor/github.com/blevesearch/bleve/index/scorch/optimize.go
+335
-8
vendor/github.com/blevesearch/bleve/index/scorch/persister.go
...or/github.com/blevesearch/bleve/index/scorch/persister.go
+69
-15
vendor/github.com/blevesearch/bleve/index/scorch/scorch.go
vendor/github.com/blevesearch/bleve/index/scorch/scorch.go
+26
-22
vendor/github.com/blevesearch/bleve/index/scorch/segment/empty.go
...ithub.com/blevesearch/bleve/index/scorch/segment/empty.go
+10
-0
vendor/github.com/blevesearch/bleve/index/scorch/segment/int.go
.../github.com/blevesearch/bleve/index/scorch/segment/int.go
+83
-1
vendor/github.com/blevesearch/bleve/index/scorch/segment/regexp.go
...thub.com/blevesearch/bleve/index/scorch/segment/regexp.go
+1
-1
vendor/github.com/blevesearch/bleve/index/scorch/segment/segment.go
...hub.com/blevesearch/bleve/index/scorch/segment/segment.go
+10
-0
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/README.md
....com/blevesearch/bleve/index/scorch/segment/zap/README.md
+2
-11
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/build.go
...b.com/blevesearch/bleve/index/scorch/segment/zap/build.go
+2
-0
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/count.go
...b.com/blevesearch/bleve/index/scorch/segment/zap/count.go
+10
-0
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/dict.go
...ub.com/blevesearch/bleve/index/scorch/segment/zap/dict.go
+17
-10
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/docvalues.go
...m/blevesearch/bleve/index/scorch/segment/zap/docvalues.go
+9
-7
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/merge.go
...b.com/blevesearch/bleve/index/scorch/segment/zap/merge.go
+57
-11
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/new.go
...hub.com/blevesearch/bleve/index/scorch/segment/zap/new.go
+13
-0
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/posting.go
...com/blevesearch/bleve/index/scorch/segment/zap/posting.go
+188
-79
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/segment.go
...com/blevesearch/bleve/index/scorch/segment/zap/segment.go
+40
-12
vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/zap.md
...hub.com/blevesearch/bleve/index/scorch/segment/zap/zap.md
+177
-0
vendor/github.com/blevesearch/bleve/index/scorch/snapshot_index.go
...thub.com/blevesearch/bleve/index/scorch/snapshot_index.go
+64
-21
vendor/github.com/blevesearch/bleve/index/scorch/snapshot_index_dict.go
...com/blevesearch/bleve/index/scorch/snapshot_index_dict.go
+16
-1
vendor/github.com/blevesearch/bleve/index/scorch/snapshot_index_tfr.go
....com/blevesearch/bleve/index/scorch/snapshot_index_tfr.go
+1
-1
vendor/github.com/blevesearch/bleve/index/scorch/snapshot_rollback.go
...b.com/blevesearch/bleve/index/scorch/snapshot_rollback.go
+1
-1
vendor/github.com/blevesearch/bleve/index/scorch/snapshot_segment.go
...ub.com/blevesearch/bleve/index/scorch/snapshot_segment.go
+19
-6
vendor/github.com/blevesearch/bleve/index/scorch/stats.go
vendor/github.com/blevesearch/bleve/index/scorch/stats.go
+3
-2
vendor/github.com/blevesearch/bleve/index/store/boltdb/iterator.go
...thub.com/blevesearch/bleve/index/store/boltdb/iterator.go
+1
-1
vendor/github.com/blevesearch/bleve/index/store/boltdb/reader.go
...github.com/blevesearch/bleve/index/store/boltdb/reader.go
+1
-1
vendor/github.com/blevesearch/bleve/index/store/boltdb/store.go
.../github.com/blevesearch/bleve/index/store/boltdb/store.go
+7
-1
vendor/github.com/blevesearch/bleve/index/upsidedown/row.go
vendor/github.com/blevesearch/bleve/index/upsidedown/row.go
+1
-1
vendor/github.com/blevesearch/bleve/index/upsidedown/upsidedown.go
...thub.com/blevesearch/bleve/index/upsidedown/upsidedown.go
+22
-11
vendor/github.com/blevesearch/bleve/index_alias_impl.go
vendor/github.com/blevesearch/bleve/index_alias_impl.go
+23
-24
vendor/github.com/blevesearch/bleve/index_impl.go
vendor/github.com/blevesearch/bleve/index_impl.go
+130
-70
vendor/github.com/blevesearch/bleve/mapping/document.go
vendor/github.com/blevesearch/bleve/mapping/document.go
+22
-10
vendor/github.com/blevesearch/bleve/mapping/index.go
vendor/github.com/blevesearch/bleve/mapping/index.go
+1
-1
vendor/github.com/blevesearch/bleve/numeric/prefix_coded.go
vendor/github.com/blevesearch/bleve/numeric/prefix_coded.go
+18
-3
vendor/github.com/blevesearch/bleve/search.go
vendor/github.com/blevesearch/bleve/search.go
+45
-0
vendor/github.com/blevesearch/bleve/search/collector.go
vendor/github.com/blevesearch/bleve/search/collector.go
+20
-0
vendor/github.com/blevesearch/bleve/search/collector/heap.go
vendor/github.com/blevesearch/bleve/search/collector/heap.go
+2
-2
vendor/github.com/blevesearch/bleve/search/collector/list.go
vendor/github.com/blevesearch/bleve/search/collector/list.go
+2
-3
vendor/github.com/blevesearch/bleve/search/collector/slice.go
...or/github.com/blevesearch/bleve/search/collector/slice.go
+2
-2
vendor/github.com/blevesearch/bleve/search/collector/topn.go
vendor/github.com/blevesearch/bleve/search/collector/topn.go
+100
-27
vendor/github.com/blevesearch/bleve/search/query/conjunction.go
.../github.com/blevesearch/bleve/search/query/conjunction.go
+2
-0
vendor/github.com/blevesearch/bleve/search/query/date_range.go
...r/github.com/blevesearch/bleve/search/query/date_range.go
+29
-2
vendor/github.com/blevesearch/bleve/search/query/disjunction.go
.../github.com/blevesearch/bleve/search/query/disjunction.go
+4
-1
vendor/github.com/blevesearch/bleve/search/query/query.go
vendor/github.com/blevesearch/bleve/search/query/query.go
+4
-8
vendor/github.com/blevesearch/bleve/search/query/query_string_lex.go
...ub.com/blevesearch/bleve/search/query/query_string_lex.go
+1
-0
vendor/github.com/blevesearch/bleve/search/scorer/scorer_term.go
...github.com/blevesearch/bleve/search/scorer/scorer_term.go
+13
-9
vendor/github.com/blevesearch/bleve/search/search.go
vendor/github.com/blevesearch/bleve/search/search.go
+84
-9
vendor/github.com/blevesearch/bleve/search/searcher/search_boolean.go
...b.com/blevesearch/bleve/search/searcher/search_boolean.go
+40
-23
vendor/github.com/blevesearch/bleve/search/searcher/search_conjunction.go
...m/blevesearch/bleve/search/searcher/search_conjunction.go
+21
-22
vendor/github.com/blevesearch/bleve/search/searcher/search_disjunction.go
...m/blevesearch/bleve/search/searcher/search_disjunction.go
+51
-3
vendor/github.com/blevesearch/bleve/search/searcher/search_disjunction_heap.go
...vesearch/bleve/search/searcher/search_disjunction_heap.go
+1
-1
vendor/github.com/blevesearch/bleve/search/searcher/search_disjunction_slice.go
...esearch/bleve/search/searcher/search_disjunction_slice.go
+1
-1
vendor/github.com/blevesearch/bleve/search/searcher/search_fuzzy.go
...hub.com/blevesearch/bleve/search/searcher/search_fuzzy.go
+6
-2
vendor/github.com/blevesearch/bleve/search/searcher/search_geoboundingbox.go
...levesearch/bleve/search/searcher/search_geoboundingbox.go
+122
-50
vendor/github.com/blevesearch/bleve/search/searcher/search_multi_term.go
...om/blevesearch/bleve/search/searcher/search_multi_term.go
+2
-2
vendor/github.com/blevesearch/bleve/search/searcher/search_numeric_range.go
...blevesearch/bleve/search/searcher/search_numeric_range.go
+45
-10
vendor/github.com/blevesearch/bleve/search/searcher/search_phrase.go
...ub.com/blevesearch/bleve/search/searcher/search_phrase.go
+1
-1
vendor/github.com/blevesearch/bleve/search/searcher/search_regexp.go
...ub.com/blevesearch/bleve/search/searcher/search_regexp.go
+1
-1
vendor/github.com/blevesearch/bleve/search/searcher/search_term.go
...thub.com/blevesearch/bleve/search/searcher/search_term.go
+8
-17
vendor/github.com/blevesearch/bleve/search/searcher/search_term_prefix.go
...m/blevesearch/bleve/search/searcher/search_term_prefix.go
+1
-1
vendor/github.com/blevesearch/bleve/search/sort.go
vendor/github.com/blevesearch/bleve/search/sort.go
+29
-0
vendor/github.com/boltdb/bolt/Makefile
vendor/github.com/boltdb/bolt/Makefile
+0
-18
vendor/github.com/boltdb/bolt/appveyor.yml
vendor/github.com/boltdb/bolt/appveyor.yml
+0
-18
No files found.
vendor/github.com/RoaringBitmap/roaring/LICENSE
View file @
28430343
...
...
@@ -200,3 +200,36 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================================================
Portions of runcontainer.go are from the Go standard library, which is licensed
under:
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
vendor/github.com/RoaringBitmap/roaring/bitmapcontainer.go
View file @
28430343
...
...
@@ -968,7 +968,7 @@ func (bc *bitmapContainer) PrevSetBit(i int) int {
w
=
w
<<
uint
(
63
-
b
)
if
w
!=
0
{
return
b
-
countLeadingZeros
(
w
)
return
i
-
countLeadingZeros
(
w
)
}
x
--
for
;
x
>=
0
;
x
--
{
...
...
vendor/github.com/RoaringBitmap/roaring/go.mod
0 → 100644
View file @
28430343
module github.com/RoaringBitmap/roaring
go 1.12
require (
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2
github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae
github.com/philhofer/fwd v1.0.0 // indirect
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff
github.com/stretchr/testify v1.3.0
github.com/tinylib/msgp v1.1.0
github.com/willf/bitset v1.1.10
)
vendor/github.com/RoaringBitmap/roaring/go.sum
0 → 100644
View file @
28430343
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 h1:Ujru1hufTHVb++eG6OuNDKMxZnGIvF6o/u8q/8h2+I4=
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493 h1:OTanQnFt0bi5iLFSdbEVA/idR6Q2WhCm+deb7ir2CcM=
github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY=
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff h1:86HlEv0yBCry9syNuylzqznKXDK11p6D0DT596yNMys=
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/willf/bitset v1.1.10 h1:NotGKqX0KwQ72NUzqrjZq5ipPNDQex9lo3WpaS8L2sc=
github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
vendor/github.com/RoaringBitmap/roaring/roaring.go
View file @
28430343
...
...
@@ -6,7 +6,6 @@
package
roaring
import
(
"bufio"
"bytes"
"encoding/base64"
"fmt"
...
...
@@ -87,6 +86,12 @@ func (rb *Bitmap) ReadFrom(stream io.Reader) (int64, error) {
// You should *not* change the copy-on-write status of the resulting
// bitmaps (SetCopyOnWrite).
//
// If buf becomes unavailable, then a bitmap created with
// FromBuffer would be effectively broken. Furthermore, any
// bitmap derived from this bitmap (e.g., via Or, And) might
// also be broken. Thus, before making buf unavailable, you should
// call CloneCopyOnWriteContainers on all such bitmaps.
//
func
(
rb
*
Bitmap
)
FromBuffer
(
buf
[]
byte
)
(
int64
,
error
)
{
return
rb
.
highlowcontainer
.
fromBuffer
(
buf
)
}
...
...
@@ -110,29 +115,15 @@ func (rb *Bitmap) ReadFromMsgpack(stream io.Reader) (int64, error) {
}
// MarshalBinary implements the encoding.BinaryMarshaler interface for the bitmap
// (same as ToBytes)
func
(
rb
*
Bitmap
)
MarshalBinary
()
([]
byte
,
error
)
{
var
buf
bytes
.
Buffer
writer
:=
bufio
.
NewWriter
(
&
buf
)
_
,
err
:=
rb
.
WriteTo
(
writer
)
if
err
!=
nil
{
return
nil
,
err
}
err
=
writer
.
Flush
()
if
err
!=
nil
{
return
nil
,
err
}
return
buf
.
Bytes
(),
nil
return
rb
.
ToBytes
()
}
// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for the bitmap
func
(
rb
*
Bitmap
)
UnmarshalBinary
(
data
[]
byte
)
error
{
var
buf
bytes
.
Buffer
_
,
err
:=
buf
.
Write
(
data
)
if
err
!=
nil
{
return
err
}
reader
:=
bufio
.
NewReader
(
&
buf
)
_
,
err
=
rb
.
ReadFrom
(
reader
)
r
:=
bytes
.
NewReader
(
data
)
_
,
err
:=
rb
.
ReadFrom
(
r
)
return
err
}
...
...
@@ -364,17 +355,20 @@ func (rb *Bitmap) String() string {
return
buffer
.
String
()
}
// Iterator creates a new IntIterable to iterate over the integers contained in the bitmap, in sorted order
// Iterator creates a new IntIterable to iterate over the integers contained in the bitmap, in sorted order;
// the iterator becomes invalid if the bitmap is modified (e.g., with Add or Remove).
func
(
rb
*
Bitmap
)
Iterator
()
IntIterable
{
return
newIntIterator
(
rb
)
}
// ReverseIterator creates a new IntIterable to iterate over the integers contained in the bitmap, in sorted order
// ReverseIterator creates a new IntIterable to iterate over the integers contained in the bitmap, in sorted order;
// the iterator becomes invalid if the bitmap is modified (e.g., with Add or Remove).
func
(
rb
*
Bitmap
)
ReverseIterator
()
IntIterable
{
return
newIntReverseIterator
(
rb
)
}
// ManyIterator creates a new ManyIntIterable to iterate over the integers contained in the bitmap, in sorted order
// ManyIterator creates a new ManyIntIterable to iterate over the integers contained in the bitmap, in sorted order;
// the iterator becomes invalid if the bitmap is modified (e.g., with Add or Remove).
func
(
rb
*
Bitmap
)
ManyIterator
()
ManyIntIterable
{
return
newManyIntIterator
(
rb
)
}
...
...
@@ -418,6 +412,7 @@ func (rb *Bitmap) Equals(o interface{}) bool {
return
false
}
// AddOffset adds the value 'offset' to each and every value in a bitmap, generating a new bitmap in the process
func
AddOffset
(
x
*
Bitmap
,
offset
uint32
)
(
answer
*
Bitmap
)
{
containerOffset
:=
highbits
(
offset
)
inOffset
:=
lowbits
(
offset
)
...
...
@@ -1374,6 +1369,21 @@ func (rb *Bitmap) GetCopyOnWrite() (val bool) {
return
rb
.
highlowcontainer
.
copyOnWrite
}
// CloneCopyOnWriteContainers clones all containers which have
// needCopyOnWrite set to true.
// This can be used to make sure it is safe to munmap a []byte
// that the roaring array may still have a reference to, after
// calling FromBuffer.
// More generally this function is useful if you call FromBuffer
// to construct a bitmap with a backing array buf
// and then later discard the buf array. Note that you should call
// CloneCopyOnWriteContainers on all bitmaps that were derived
// from the 'FromBuffer' bitmap since they map have dependencies
// on the buf array as well.
func
(
rb
*
Bitmap
)
CloneCopyOnWriteContainers
()
{
rb
.
highlowcontainer
.
cloneCopyOnWriteContainers
()
}
// FlipInt calls Flip after casting the parameters (convenience method)
func
FlipInt
(
bm
*
Bitmap
,
rangeStart
,
rangeEnd
int
)
*
Bitmap
{
return
Flip
(
bm
,
uint64
(
rangeStart
),
uint64
(
rangeEnd
))
...
...
vendor/github.com/RoaringBitmap/roaring/roaringarray.go
View file @
28430343
...
...
@@ -283,6 +283,18 @@ func (ra *roaringArray) clone() *roaringArray {
return
&
sa
}
// clone all containers which have needCopyOnWrite set to true
// This can be used to make sure it is safe to munmap a []byte
// that the roaring array may still have a reference to.
func
(
ra
*
roaringArray
)
cloneCopyOnWriteContainers
()
{
for
i
,
needCopyOnWrite
:=
range
ra
.
needCopyOnWrite
{
if
needCopyOnWrite
{
ra
.
containers
[
i
]
=
ra
.
containers
[
i
]
.
clone
()
ra
.
needCopyOnWrite
[
i
]
=
false
}
}
}
// unused function:
//func (ra *roaringArray) containsKey(x uint16) bool {
// return (ra.binarySearch(0, int64(len(ra.keys)), x) >= 0)
...
...
@@ -558,12 +570,10 @@ func (ra *roaringArray) fromBuffer(buf []byte) (int64, error) {
cookie
:=
binary
.
LittleEndian
.
Uint32
(
buf
)
pos
+=
4
var
size
uint32
// number of containers
haveRunContainers
:=
false
var
isRunBitmap
[]
byte
// cookie header
if
cookie
&
0x0000FFFF
==
serialCookie
{
haveRunContainers
=
true
size
=
uint32
(
uint16
(
cookie
>>
16
)
+
1
)
// number of containers
// create is-run-container bitmap
...
...
@@ -591,7 +601,7 @@ func (ra *roaringArray) fromBuffer(buf []byte) (int64, error) {
keycard
:=
byteSliceAsUint16Slice
(
buf
[
pos
:
pos
+
2
*
2
*
int
(
size
)])
pos
+=
2
*
2
*
int
(
size
)
if
!
haveRunContainers
||
size
>=
noOffsetThreshold
{
if
isRunBitmap
==
nil
||
size
>=
noOffsetThreshold
{
pos
+=
4
*
int
(
size
)
}
...
...
@@ -618,7 +628,7 @@ func (ra *roaringArray) fromBuffer(buf []byte) (int64, error) {
ra
.
keys
[
i
]
=
key
ra
.
needCopyOnWrite
[
i
]
=
true
if
haveRunContainers
&&
isRunBitmap
[
i
/
8
]
&
(
1
<<
(
i
%
8
))
!=
0
{
if
isRunBitmap
!=
nil
&&
isRunBitmap
[
i
/
8
]
&
(
1
<<
(
i
%
8
))
!=
0
{
// run container
nr
:=
binary
.
LittleEndian
.
Uint16
(
buf
[
pos
:
])
pos
+=
2
...
...
@@ -661,10 +671,8 @@ func (ra *roaringArray) readFrom(stream io.Reader) (int64, error) {
}
pos
+=
4
var
size
uint32
haveRunContainers
:=
false
var
isRun
*
bitmapContainer
if
cookie
&
0x0000FFFF
==
serialCookie
{
haveRunContainers
=
true
size
=
uint32
(
uint16
(
cookie
>>
16
)
+
1
)
bytesToRead
:=
(
int
(
size
)
+
7
)
/
8
numwords
:=
(
bytesToRead
+
7
)
/
8
...
...
@@ -701,14 +709,14 @@ func (ra *roaringArray) readFrom(stream io.Reader) (int64, error) {
}
pos
+=
2
*
2
*
int
(
size
)
// offset header
if
!
haveRunContainers
||
size
>=
noOffsetThreshold
{
if
isRun
==
nil
||
size
>=
noOffsetThreshold
{
io
.
CopyN
(
ioutil
.
Discard
,
stream
,
4
*
int64
(
size
))
// we never skip ahead so this data can be ignored
pos
+=
4
*
int
(
size
)
}
for
i
:=
uint32
(
0
);
i
<
size
;
i
++
{
key
:=
int
(
keycard
[
2
*
i
])
card
:=
int
(
keycard
[
2
*
i
+
1
])
+
1
if
haveRunContainers
&&
isRun
.
contains
(
uint16
(
i
))
{
if
isRun
!=
nil
&&
isRun
.
contains
(
uint16
(
i
))
{
nb
:=
newRunContainer16
()
nr
,
err
:=
nb
.
readFrom
(
stream
)
if
err
!=
nil
{
...
...
vendor/github.com/blevesearch/bleve/geo/geohash.go
0 → 100644
View file @
28430343
// Copyright (c) 2019 Couchbase, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This implementation is inspired from the geohash-js
// ref: https://github.com/davetroy/geohash-js
package
geo
// encoding encapsulates an encoding defined by a given base32 alphabet.
type
encoding
struct
{
enc
string
dec
[
256
]
byte
}
// newEncoding constructs a new encoding defined by the given alphabet,
// which must be a 32-byte string.
func
newEncoding
(
encoder
string
)
*
encoding
{
e
:=
new
(
encoding
)
e
.
enc
=
encoder
for
i
:=
0
;
i
<
len
(
e
.
dec
);
i
++
{
e
.
dec
[
i
]
=
0xff
}
for
i
:=
0
;
i
<
len
(
encoder
);
i
++
{
e
.
dec
[
encoder
[
i
]]
=
byte
(
i
)
}
return
e
}
// base32encoding with the Geohash alphabet.
var
base32encoding
=
newEncoding
(
"0123456789bcdefghjkmnpqrstuvwxyz"
)
var
masks
=
[]
uint64
{
16
,
8
,
4
,
2
,
1
}
// DecodeGeoHash decodes the string geohash faster with
// higher precision. This api is in experimental phase.
func
DecodeGeoHash
(
geoHash
string
)
(
float64
,
float64
)
{
even
:=
true
lat
:=
[]
float64
{
-
90.0
,
90.0
}
lon
:=
[]
float64
{
-
180.0
,
180.0
}
for
i
:=
0
;
i
<
len
(
geoHash
);
i
++
{
cd
:=
uint64
(
base32encoding
.
dec
[
geoHash
[
i
]])
for
j
:=
0
;
j
<
5
;
j
++
{
if
even
{
if
cd
&
masks
[
j
]
>
0
{
lon
[
0
]
=
(
lon
[
0
]
+
lon
[
1
])
/
2
}
else
{
lon
[
1
]
=
(
lon
[
0
]
+
lon
[
1
])
/
2
}
}
else
{
if
cd
&
masks
[
j
]
>
0
{
lat
[
0
]
=
(
lat
[
0
]
+
lat
[
1
])
/
2
}
else
{
lat
[
1
]
=
(
lat
[
0
]
+
lat
[
1
])
/
2
}
}
even
=
!
even
}
}
return
(
lat
[
0
]
+
lat
[
1
])
/
2
,
(
lon
[
0
]
+
lon
[
1
])
/
2
}
func
EncodeGeoHash
(
lat
,
lon
float64
)
string
{
even
:=
true
lats
:=
[]
float64
{
-
90.0
,
90.0
}
lons
:=
[]
float64
{
-
180.0
,
180.0
}
precision
:=
12
var
ch
,
bit
uint64
var
geoHash
string
for
len
(
geoHash
)
<
precision
{
if
even
{
mid
:=
(
lons
[
0
]
+
lons
[
1
])
/
2
if
lon
>
mid
{
ch
|=
masks
[
bit
]
lons
[
0
]
=
mid
}
else
{
lons
[
1
]
=
mid
}
}
else
{
mid
:=
(
lats
[
0
]
+
lats
[
1
])
/
2
if
lat
>
mid
{
ch
|=
masks
[
bit
]
lats
[
0
]
=
mid
}
else
{
lats
[
1
]
=
mid
}
}
even
=
!
even
if
bit
<
4
{
bit
++
}
else
{
geoHash
+=
string
(
base32encoding
.
enc
[
ch
])
ch
=
0
bit
=
0
}
}
return
geoHash
}
vendor/github.com/blevesearch/bleve/geo/parse.go
View file @
28430343
...
...
@@ -16,6 +16,7 @@ package geo
import
(
"reflect"
"strconv"
"strings"
)
...
...
@@ -24,6 +25,8 @@ import (
// Container:
// slice length 2 (GeoJSON)
// first element lon, second element lat
// string (coordinates separated by comma, or a geohash)
// first element lat, second element lon
// map[string]interface{}
// exact keys lat and lon or lng
// struct
...
...
@@ -59,6 +62,35 @@ func ExtractGeoPoint(thing interface{}) (lon, lat float64, success bool) {
}
}
// is it a string
if
thingVal
.
Kind
()
==
reflect
.
String
{
geoStr
:=
thingVal
.
Interface
()
.
(
string
)
if
strings
.
Contains
(
geoStr
,
","
)
{
// geo point with coordinates split by comma
points
:=
strings
.
Split
(
geoStr
,
","
)
for
i
,
point
:=
range
points
{
// trim any leading or trailing white spaces
points
[
i
]
=
strings
.
TrimSpace
(
point
)
}
if
len
(
points
)
==
2
{
var
err
error
lat
,
err
=
strconv
.
ParseFloat
(
points
[
0
],
64
)
if
err
==
nil
{
foundLat
=
true
}
lon
,
err
=
strconv
.
ParseFloat
(
points
[
1
],
64
)
if
err
==
nil
{
foundLon
=
true
}
}
}
else
{
// geohash
lat
,
lon
=
DecodeGeoHash
(
geoStr
)
foundLat
=
true
foundLon
=
true
}
}
// is it a map
if
l
,
ok
:=
thing
.
(
map
[
string
]
interface
{});
ok
{
if
lval
,
ok
:=
l
[
"lon"
];
ok
{
...
...
vendor/github.com/blevesearch/bleve/index.go
View file @
28430343
...
...
@@ -117,6 +117,8 @@ func (b *Batch) String() string {
// be re-used in the future.
func
(
b
*
Batch
)
Reset
()
{
b
.
internal
.
Reset
()
b
.
lastDocSize
=
0
b
.
totalSize
=
0
}
func
(
b
*
Batch
)
Merge
(
o
*
Batch
)
{
...
...
@@ -129,6 +131,14 @@ func (b *Batch) Merge(o *Batch) {
}
}
func
(
b
*
Batch
)
SetPersistedCallback
(
f
index
.
BatchCallback
)
{
b
.
internal
.
SetPersistedCallback
(
f
)
}
func
(
b
*
Batch
)
PersistedCallback
()
index
.
BatchCallback
{
return
b
.
internal
.
PersistedCallback
()
}
// An Index implements all the indexing and searching
// capabilities of bleve. An Index can be created
// using the New() and Open() methods.
...
...
vendor/github.com/blevesearch/bleve/index/index.go
View file @
28430343
...
...
@@ -121,6 +121,10 @@ type IndexReaderOnly interface {
FieldDictOnly
(
field
string
,
onlyTerms
[][]
byte
,
includeCount
bool
)
(
FieldDict
,
error
)
}
type
IndexReaderContains
interface
{
FieldDictContains
(
field
string
)
(
FieldDictContains
,
error
)
}
// FieldTerms contains the terms used by a document, keyed by field
type
FieldTerms
map
[
string
][]
string
...
...
@@ -230,6 +234,10 @@ type FieldDict interface {
Close
()
error
}
type
FieldDictContains
interface
{
Contains
(
key
[]
byte
)
(
bool
,
error
)
}
// DocIDReader is the interface exposing enumeration of documents identifiers.
// Close the reader to release associated resources.
type
DocIDReader
interface
{
...
...
@@ -248,9 +256,12 @@ type DocIDReader interface {
Close
()
error
}
type
BatchCallback
func
(
error
)
type
Batch
struct
{
IndexOps
map
[
string
]
*
document
.
Document
InternalOps
map
[
string
][]
byte
IndexOps
map
[
string
]
*
document
.
Document
InternalOps
map
[
string
][]
byte
persistedCallback
BatchCallback
}
func
NewBatch
()
*
Batch
{
...
...
@@ -276,6 +287,14 @@ func (b *Batch) DeleteInternal(key []byte) {
b
.
InternalOps
[
string
(
key
)]
=
nil
}
func
(
b
*
Batch
)
SetPersistedCallback
(
f
BatchCallback
)
{
b
.
persistedCallback
=
f
}
func
(
b
*
Batch
)
PersistedCallback
()
BatchCallback
{
return
b
.
persistedCallback
}
func
(
b
*
Batch
)
String
()
string
{
rv
:=
fmt
.
Sprintf
(
"Batch (%d ops, %d internal ops)
\n
"
,
len
(
b
.
IndexOps
),
len
(
b
.
InternalOps
))
for
k
,
v
:=
range
b
.
IndexOps
{
...
...
@@ -298,6 +317,7 @@ func (b *Batch) String() string {
func
(
b
*
Batch
)
Reset
()
{
b
.
IndexOps
=
make
(
map
[
string
]
*
document
.
Document
)
b
.
InternalOps
=
make
(
map
[
string
][]
byte
)
b
.
persistedCallback
=
nil
}
func
(
b
*
Batch
)
Merge
(
o
*
Batch
)
{
...
...
@@ -329,11 +349,19 @@ type Optimizable interface {
Optimize
(
kind
string
,
octx
OptimizableContext
)
(
OptimizableContext
,
error
)
}
// Represents a result of optimization -- see the Finish() method.
type
Optimized
interface
{}
type
OptimizableContext
interface
{
// Once all the optimzable resources have been provided the same
// OptimizableContext instance, the optimization preparations are
// finished or completed via the Finish() method.
Finish
()
error
//
// Depending on the optimization being performed, the Finish()
// method might return a non-nil Optimized instance. For example,
// the Optimized instance might represent an optimized
// TermFieldReader instance.
Finish
()
(
Optimized
,
error
)
}
type
DocValueReader
interface
{
...
...
vendor/github.com/blevesearch/bleve/index/scorch/introducer.go
View file @
28430343
...
...
@@ -19,6 +19,7 @@ import (
"sync/atomic"
"github.com/RoaringBitmap/roaring"
"github.com/blevesearch/bleve/index"
"github.com/blevesearch/bleve/index/scorch/segment"
"github.com/blevesearch/bleve/index/scorch/segment/zap"
)
...
...
@@ -30,8 +31,9 @@ type segmentIntroduction struct {
ids
[]
string
internal
map
[
string
][]
byte
applied
chan
error
persisted
chan
error
applied
chan
error
persisted
chan
error
persistedCallback
index
.
BatchCallback
}
type
persistIntroduction
struct
{
...
...
@@ -213,6 +215,9 @@ func (s *Scorch) introduceSegment(next *segmentIntroduction) error {
if
next
.
persisted
!=
nil
{
s
.
rootPersisted
=
append
(
s
.
rootPersisted
,
next
.
persisted
)
}
if
next
.
persistedCallback
!=
nil
{
s
.
persistedCallbacks
=
append
(
s
.
persistedCallbacks
,
next
.
persistedCallback
)
}
// swap in new index snapshot
newSnapshot
.
epoch
=
s
.
nextSnapshotEpoch