commit
fa7e3f811b
6
index.go
6
index.go
@ -71,7 +71,7 @@ func (b *Batch) Size() int {
|
||||
return len(b.internal.IndexOps) + len(b.internal.InternalOps)
|
||||
}
|
||||
|
||||
// String prints a user friendly string represenation of what
|
||||
// String prints a user friendly string representation of what
|
||||
// is inside this batch.
|
||||
func (b *Batch) String() string {
|
||||
return b.internal.String()
|
||||
@ -202,7 +202,7 @@ type Index interface {
|
||||
SetInternal(key, val []byte) error
|
||||
DeleteInternal(key []byte) error
|
||||
|
||||
// Name returns the name of the index (by deault this is the path)
|
||||
// Name returns the name of the index (by default this is the path)
|
||||
Name() string
|
||||
// SetName lets you assign your own logical name to this index
|
||||
SetName(string)
|
||||
@ -230,7 +230,7 @@ func New(path string, mapping *IndexMapping) (Index, error) {
|
||||
// The provided mapping will be used for all
|
||||
// Index/Search operations.
|
||||
// The specified index type will be used
|
||||
// The specified kvstore implemenation will be used
|
||||
// The specified kvstore implementation will be used
|
||||
// and the provided kvconfig will be passed to its
|
||||
// constructor.
|
||||
func NewUsing(path string, mapping *IndexMapping, indexType string, kvstore string, kvconfig map[string]interface{}) (Index, error) {
|
||||
|
@ -45,7 +45,7 @@ func newFirestormTermFieldReader(r *firestormReader, field uint16, term []byte)
|
||||
|
||||
// NOTE: in firestorm the dictionary row is advisory in nature
|
||||
// it *may* tell us the correct out
|
||||
// if this record does not exist, it DOES not mean that there isno
|
||||
// if this record does not exist, it DOES not mean that there is no
|
||||
// usage, we must scan the term frequencies to be sure
|
||||
if dictionaryValue != nil {
|
||||
dictionaryRow, err := NewDictionaryRowKV(dictionaryKey, dictionaryValue)
|
||||
|
@ -88,7 +88,7 @@ type KVIterator interface {
|
||||
// to do this in a way that is safe and makes sense
|
||||
type KVWriter interface {
|
||||
|
||||
// NewBatch returns a KVBatch for performaing batch operations on this kvstore
|
||||
// NewBatch returns a KVBatch for performing batch operations on this kvstore
|
||||
NewBatch() KVBatch
|
||||
|
||||
// ExecuteBatch will execute the KVBatch, the provided KVBatch **MUST** have
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"github.com/blevesearch/bleve/index/store"
|
||||
)
|
||||
|
||||
// tests focused on verfiying that readers are isolated from writers
|
||||
// tests focused on verifying that readers are isolated from writers
|
||||
|
||||
func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
|
||||
// insert a kv pair
|
||||
@ -30,7 +30,7 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
|
||||
// reader is closed.
|
||||
// in general this is not a problem for bleve
|
||||
// (though it may affect performance in some cases)
|
||||
// but it is a problem for this test which attemps
|
||||
// but it is a problem for this test which attempts
|
||||
// to easily verify that readers are isolated
|
||||
// this hack writes enough initial data such that
|
||||
// the subsequent writes do not require additional
|
||||
|
@ -438,7 +438,7 @@ func (i *indexAliasImpl) Swap(in, out []Index) {
|
||||
// createChildSearchRequest creates a separate
|
||||
// request from the original
|
||||
// For now, avoid data race on req structure.
|
||||
// TODO disable highligh/field load on child
|
||||
// TODO disable highlight/field load on child
|
||||
// requests, and add code to do this only on
|
||||
// the actual final results.
|
||||
// Perhaps that part needs to be optional,
|
||||
|
@ -172,7 +172,7 @@ func openIndexUsing(path string, runtimeConfig map[string]interface{}) (rv *inde
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// backwards compatability if index type is missing
|
||||
// backwards compatibility if index type is missing
|
||||
if rv.meta.IndexType == "" {
|
||||
rv.meta.IndexType = upside_down.Name
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ type fuzzyQuery struct {
|
||||
// fuzziness of the specified term.
|
||||
// The default fuzziness is 2.
|
||||
//
|
||||
// The current implementation uses Leveshtein edit
|
||||
// The current implementation uses Levenshtein edit
|
||||
// distance as the fuzziness metric.
|
||||
func NewFuzzyQuery(term string) *fuzzyQuery {
|
||||
return &fuzzyQuery{
|
||||
|
@ -51,7 +51,7 @@ OUTER:
|
||||
}
|
||||
|
||||
// if we still have more characters available to us
|
||||
// push back towards begining
|
||||
// push back towards beginning
|
||||
// without cross maxbegin
|
||||
for start > 0 && used < s.fragmentSize {
|
||||
r, size := utf8.DecodeLastRune(orig[0:start])
|
||||
|
@ -57,7 +57,7 @@ func (t TermLocations) Less(i, j int) bool {
|
||||
}
|
||||
// all the common array positions are the same
|
||||
if len(t[i].ArrayPositions) < len(t[j].ArrayPositions) {
|
||||
return true // j array positions, longer so greather
|
||||
return true // j array positions, longer so greater
|
||||
} else if len(t[i].ArrayPositions) > len(t[j].ArrayPositions) {
|
||||
return false // j array positions, shorter so less
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ func LevenshteinDistanceMax(a, b *string, max int) (int, bool) {
|
||||
|
||||
lastdiag = olddiag
|
||||
}
|
||||
// after each row if rowmin isnt less than max stop
|
||||
// after each row if rowmin isn't less than max stop
|
||||
if rowmin > max {
|
||||
return max, true
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ func incrementBytes(in []byte) []byte {
|
||||
for i := len(rv) - 1; i >= 0; i-- {
|
||||
rv[i] = rv[i] + 1
|
||||
if rv[i] != 0 {
|
||||
// didnt' overflow, so stop
|
||||
// didn't overflow, so stop
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user