Commit 167cb6d4 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Update bleve indexing engine to fix query processing.

parent 012c695a
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -22,14 +22,6 @@
  revision = "07be1464c92d197fc7c4347c2ef10defde490240"
  version = "v0.4.13"

[[projects]]
  branch = "master"
  digest = "1:6ae849fd4cfda8751fa6332e63cbd6685bfa24027de5309d26b2d06c21003138"
  name = "github.com/Smerity/govarint"
  packages = ["."]
  pruneopts = ""
  revision = "7265e41f48f15fd61751e16da866af3c704bb3ab"

[[projects]]
  branch = "master"
  digest = "1:c0bec5f9b98d0bc872ff5e834fac186b807b656683bd29cb82fb207a1513fabb"
@@ -39,7 +31,7 @@
  revision = "3a771d992973f24aa725d07868b467d1ddfceafb"

[[projects]]
  digest = "1:35b1f0fb65dd639625d24ad63d22b8e802c3ab7ab871ba0113d49dadab8a287e"
  digest = "1:109a9e34c738730a57b729573cceffd58d082250337e5d7185c9ff8de3162a85"
  name = "github.com/blevesearch/bleve"
  packages = [
    ".",
@@ -60,7 +52,6 @@
    "index/scorch",
    "index/scorch/mergeplan",
    "index/scorch/segment",
    "index/scorch/segment/mem",
    "index/scorch/segment/zap",
    "index/store",
    "index/store/boltdb",
@@ -80,10 +71,10 @@
    "search/query",
    "search/scorer",
    "search/searcher",
    "size",
  ]
  pruneopts = ""
  revision = "1a319cdf5bf77dc8cee35a6b99f908792c2547ef"
  version = "v0.7.0"
  revision = "89a815df0798b34feb44e4d3ade3c3a9d338aa63"

[[projects]]
  digest = "1:b9a6b4e079fea1e137c0f8caeb65030978a8dee9f37df5a6ffd9fabe98cdd32e"
@@ -118,15 +109,16 @@

[[projects]]
  branch = "master"
  digest = "1:bf1ffbd0316073dc09af00d78f79eac88770e48a3ae1d045efb273dd6c495243"
  digest = "1:21aee7b432ce1298869959e614776826b3a7f7777722589879f027fbee819820"
  name = "github.com/couchbase/vellum"
  packages = [
    ".",
    "levenshtein2",
    "regexp",
    "utf8",
  ]
  pruneopts = ""
  revision = "d4af51308df0a8259faf1c746cb262a799c5df93"
  revision = "dd17fb852690c5b0068b26995fb4e63a2f7cb1c1"

[[projects]]
  digest = "1:56c130d885a4aacae1dd9c7b71cfe39912c7ebc1ff7d2b46083c8812996dc43b"
+1 −1
Original line number Diff line number Diff line
@@ -72,4 +72,4 @@

[[constraint]]
  name = "github.com/blevesearch/bleve"
  version = "~0.7.0"
  revision = "89a815df0798b34feb44e4d3ade3c3a9d338aa63"
+0 −24
Original line number Diff line number Diff line
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof
+0 −22
Original line number Diff line number Diff line
The MIT License (MIT)

Copyright (c) 2015 Stephen Merity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+0 −67
Original line number Diff line number Diff line
# Govarint

This project aims to provide a simple API for the performant encoding and decoding of 32 and 64 bit integers using a variety of algorithms.

[![](http://i.imgur.com/mpgC23U.jpg)](https://www.flickr.com/photos/tsevis/8648521649/)

## Usage

Each integer encoding algorithm conforms to an encoding and decoding interface.
The interfaces also specify the size of the unsigned integer, either 32 or 64 bits, and will be referred to as XX below.
To create an encoder:

    NewU32Base128Encoder(w io.Writer)
    NewU64Base128Encoder(w io.Writer)
    NewU32GroupVarintEncoder(w io.Writer)

For encoders, the only two commands are `PutUXX` and `Close`.
`Close` must be called as some integer encoding algorithms write in multiples.

    var buf bytes.Buffer
    enc := NewU32Base128Encoder(&buf)
    enc.PutU32(117)
    enc.PutU32(343)
    enc.Close()

To create a decoder:

    NewU32Base128Decoder(r io.ByteReader)
    NewU64Base128Decoder(r io.ByteReader)
    NewU32GroupVarintDecoder(r io.ByteReader)

For decoders, the only command is `GetUXX`.
`GetUXX` returns the value and any potential errors.
When reading is complete, `GetUXX` will return an `EOF` (End Of File).

    dec := NewU32Base128Decoder(&buf)
    x, err := dec.GetU32()

## Use Cases

Using fixed width integers, such as uint32 and uint64, usually waste large amounts of space, especially when encoding small values.
Optimally, smaller numbers should take less space to represent.

Using integer encoding algorithms is especially common in specific applications, such as storing edge lists or indexes for search engines.
In these situations, you have a sorted list of numbers that you want to keep as compactly as possible in memory.
Additionally, by storing only the difference between the given number and the previous (delta encoding), the numbers are quite small, and thus compress well.

For an explicit example, the Web Data Commons Hyperlink Graph contains 128 billion edges linking page A to page B, where each page is represented by a 32 bit integer.
By converting all these edges to 64 bit integers (32 | 32), sorting them, and then using delta encoding, memory usage can be reduced from 64 bits per edge down to only 9 bits per edge using the Base128 integer encoding algorithm.
This figure improves even further if compressed using conventional compression algorithms (3 bits per edge).

## Encodings supported

`govarint` supports:

+ Base128 [32, 64] - each byte uses 7 bits for encoding the integer and 1 bit for indicating if the integer requires another byte
+ Group Varint [32] - integers are encoded in blocks of four - one byte encodes the size of the following four integers, then the values of the four integers follows

Group Varint consistently beats Base128 in decompression speed but Base128 may offer improved compression ratios depending on the distribution of the supplied integers.

## Tests

    go test -v -bench=.

## License

MIT License, as per `LICENSE`
Loading