0
0
Fork 0

actually rename packages to singular, not just directory name

This commit is contained in:
Marty Schoch 2016-10-02 10:29:39 -04:00
parent 2332455bd2
commit 3a276153a3
60 changed files with 75 additions and 75 deletions

View File

@ -357,7 +357,7 @@ func (i *indexImpl) SearchInContext(ctx context.Context, req *SearchRequest) (sr
return nil, ErrorIndexClosed
}
collector := collectors.NewTopNCollector(req.Size, req.From, req.Sort)
collector := collector.NewTopNCollector(req.Size, req.From, req.Sort)
// open a reader for this search
indexReader, err := i.i.Reader()
@ -385,14 +385,14 @@ func (i *indexImpl) SearchInContext(ctx context.Context, req *SearchRequest) (sr
for facetName, facetRequest := range req.Facets {
if facetRequest.NumericRanges != nil {
// build numeric range facet
facetBuilder := facets.NewNumericFacetBuilder(facetRequest.Field, facetRequest.Size)
facetBuilder := facet.NewNumericFacetBuilder(facetRequest.Field, facetRequest.Size)
for _, nr := range facetRequest.NumericRanges {
facetBuilder.AddRange(nr.Name, nr.Min, nr.Max)
}
facetsBuilder.Add(facetName, facetBuilder)
} else if facetRequest.DateTimeRanges != nil {
// build date range facet
facetBuilder := facets.NewDateTimeFacetBuilder(facetRequest.Field, facetRequest.Size)
facetBuilder := facet.NewDateTimeFacetBuilder(facetRequest.Field, facetRequest.Size)
dateTimeParser := i.m.DateTimeParserNamed("")
for _, dr := range facetRequest.DateTimeRanges {
dr.ParseDates(dateTimeParser)
@ -401,7 +401,7 @@ func (i *indexImpl) SearchInContext(ctx context.Context, req *SearchRequest) (sr
facetsBuilder.Add(facetName, facetBuilder)
} else {
// build terms facet
facetBuilder := facets.NewTermsFacetBuilder(facetRequest.Field, facetRequest.Size)
facetBuilder := facet.NewTermsFacetBuilder(facetRequest.Field, facetRequest.Size)
facetsBuilder.Add(facetName, facetBuilder)
}
}

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package collectors
package collector
import (
"math/rand"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package collectors
package collector
import (
"container/heap"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package collectors
package collector
import (
"container/list"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package collectors
package collector
import (
"github.com/blevesearch/bleve/document"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package collectors
package collector
import "github.com/blevesearch/bleve/search"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package collectors
package collector
import (
"time"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package collectors
package collector
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package facets
package facet
import (
"sort"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package facets
package facet
import (
"sort"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package facets
package facet
import (
"strconv"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package facets
package facet
import (
"sort"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package facets
package facet
import (
"io/ioutil"

View File

@ -52,5 +52,5 @@ func (q *BoolFieldQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, e
if q.Bool {
term = "T"
}
return searchers.NewTermSearcher(i, term, field, q.Boost.Value(), explain)
return searcher.NewTermSearcher(i, term, field, q.Boost.Value(), explain)
}

View File

@ -126,7 +126,7 @@ func (q *BooleanQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, exp
return shouldSearcher, nil
}
return searchers.NewBooleanSearcher(i, mustSearcher, shouldSearcher, mustNotSearcher, explain)
return searcher.NewBooleanSearcher(i, mustSearcher, shouldSearcher, mustNotSearcher, explain)
}
func (q *BooleanQuery) Validate() error {

View File

@ -61,7 +61,7 @@ func (q *ConjunctionQuery) Searcher(i index.IndexReader, m mapping.IndexMapping,
return nil, err
}
}
return searchers.NewConjunctionSearcher(i, ss, explain)
return searcher.NewConjunctionSearcher(i, ss, explain)
}
func (q *ConjunctionQuery) Validate() error {

View File

@ -128,7 +128,7 @@ func (q *DateRangeQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, e
field = m.DefaultSearchField()
}
return searchers.NewNumericRangeSearcher(i, min, max, q.InclusiveStart, q.InclusiveEnd, field, q.Boost.Value(), explain)
return searcher.NewNumericRangeSearcher(i, min, max, q.InclusiveStart, q.InclusiveEnd, field, q.Boost.Value(), explain)
}
func (q *DateRangeQuery) parseEndpoints() (*float64, *float64, error) {

View File

@ -67,7 +67,7 @@ func (q *DisjunctionQuery) Searcher(i index.IndexReader, m mapping.IndexMapping,
return nil, err
}
}
return searchers.NewDisjunctionSearcher(i, ss, q.Min, explain)
return searcher.NewDisjunctionSearcher(i, ss, q.Min, explain)
}
func (q *DisjunctionQuery) Validate() error {

View File

@ -41,5 +41,5 @@ func (q *DocIDQuery) SetBoost(b float64) {
}
func (q *DocIDQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, explain bool) (search.Searcher, error) {
return searchers.NewDocIDSearcher(i, q.IDs, q.Boost.Value(), explain)
return searcher.NewDocIDSearcher(i, q.IDs, q.Boost.Value(), explain)
}

View File

@ -65,5 +65,5 @@ func (q *FuzzyQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, expla
if q.Field == "" {
field = m.DefaultSearchField()
}
return searchers.NewFuzzySearcher(i, q.Term, q.Prefix, q.Fuzziness, field, q.Boost.Value(), explain)
return searcher.NewFuzzySearcher(i, q.Term, q.Prefix, q.Fuzziness, field, q.Boost.Value(), explain)
}

View File

@ -39,7 +39,7 @@ func (q *MatchAllQuery) SetBoost(b float64) {
}
func (q *MatchAllQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, explain bool) (search.Searcher, error) {
return searchers.NewMatchAllSearcher(i, q.Boost.Value(), explain)
return searcher.NewMatchAllSearcher(i, q.Boost.Value(), explain)
}
func (q *MatchAllQuery) MarshalJSON() ([]byte, error) {

View File

@ -39,7 +39,7 @@ func (q *MatchNoneQuery) SetBoost(b float64) {
}
func (q *MatchNoneQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, explain bool) (search.Searcher, error) {
return searchers.NewMatchNoneSearcher(i)
return searcher.NewMatchNoneSearcher(i)
}
func (q *MatchNoneQuery) MarshalJSON() ([]byte, error) {

View File

@ -68,7 +68,7 @@ func (q *NumericRangeQuery) Searcher(i index.IndexReader, m mapping.IndexMapping
if q.Field == "" {
field = m.DefaultSearchField()
}
return searchers.NewNumericRangeSearcher(i, q.Min, q.Max, q.InclusiveMin, q.InclusiveMax, field, q.Boost.Value(), explain)
return searcher.NewNumericRangeSearcher(i, q.Min, q.Max, q.InclusiveMin, q.InclusiveMax, field, q.Boost.Value(), explain)
}
func (q *NumericRangeQuery) Validate() error {

View File

@ -65,7 +65,7 @@ func (q *PhraseQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, expl
if err != nil {
return nil, err
}
return searchers.NewPhraseSearcher(i, conjunctionSearcher.(*searchers.ConjunctionSearcher), q.Terms)
return searcher.NewPhraseSearcher(i, conjunctionSearcher.(*searcher.ConjunctionSearcher), q.Terms)
}
func (q *PhraseQuery) Validate() error {

View File

@ -50,5 +50,5 @@ func (q *PrefixQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, expl
if q.Field == "" {
field = m.DefaultSearchField()
}
return searchers.NewTermPrefixSearcher(i, q.Prefix, field, q.Boost.Value(), explain)
return searcher.NewTermPrefixSearcher(i, q.Prefix, field, q.Boost.Value(), explain)
}

View File

@ -59,7 +59,7 @@ func (q *RegexpQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, expl
return nil, err
}
return searchers.NewRegexpSearcher(i, q.compiled, field, q.Boost.Value(), explain)
return searcher.NewRegexpSearcher(i, q.compiled, field, q.Boost.Value(), explain)
}
func (q *RegexpQuery) Validate() error {

View File

@ -49,5 +49,5 @@ func (q *TermQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, explai
if q.Field == "" {
field = m.DefaultSearchField()
}
return searchers.NewTermSearcher(i, q.Term, field, q.Boost.Value(), explain)
return searcher.NewTermSearcher(i, q.Term, field, q.Boost.Value(), explain)
}

View File

@ -83,7 +83,7 @@ func (q *WildcardQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, ex
}
}
return searchers.NewRegexpSearcher(i, q.compiled, field, q.Boost.Value(), explain)
return searcher.NewRegexpSearcher(i, q.compiled, field, q.Boost.Value(), explain)
}
func (q *WildcardQuery) Validate() error {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package scorers
package scorer
import (
"github.com/blevesearch/bleve/search"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package scorers
package scorer
import (
"fmt"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package scorers
package scorer
import (
"reflect"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package scorers
package scorer
import (
"fmt"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package scorers
package scorer
import (
"fmt"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package scorers
package scorer
import (
"math"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package scorers
package scorer
import (
"math"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"math"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"github.com/blevesearch/bleve/search"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"math"
@ -33,7 +33,7 @@ type BooleanSearcher struct {
currMustNot *search.DocumentMatch
currentID index.IndexInternalID
min uint64
scorer *scorers.ConjunctionQueryScorer
scorer *scorer.ConjunctionQueryScorer
matches []*search.DocumentMatch
initialized bool
}
@ -45,7 +45,7 @@ func NewBooleanSearcher(indexReader index.IndexReader, mustSearcher search.Searc
mustSearcher: mustSearcher,
shouldSearcher: shouldSearcher,
mustNotSearcher: mustNotSearcher,
scorer: scorers.NewConjunctionQueryScorer(explain),
scorer: scorer.NewConjunctionQueryScorer(explain),
matches: make([]*search.DocumentMatch, 2),
}
rv.computeQueryNorm()

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"math"
@ -29,7 +29,7 @@ type ConjunctionSearcher struct {
queryNorm float64
currs []*search.DocumentMatch
maxIDIdx int
scorer *scorers.ConjunctionQueryScorer
scorer *scorer.ConjunctionQueryScorer
initialized bool
explain bool
}
@ -48,7 +48,7 @@ func NewConjunctionSearcher(indexReader index.IndexReader, qsearchers []search.S
explain: explain,
searchers: searchers,
currs: make([]*search.DocumentMatch, len(searchers)),
scorer: scorers.NewConjunctionQueryScorer(explain),
scorer: scorer.NewConjunctionQueryScorer(explain),
}
rv.computeQueryNorm()
return &rv, nil

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"fmt"
@ -34,7 +34,7 @@ type DisjunctionSearcher struct {
searchers OrderedSearcherList
queryNorm float64
currs []*search.DocumentMatch
scorer *scorers.DisjunctionQueryScorer
scorer *scorer.DisjunctionQueryScorer
min int
matching []*search.DocumentMatch
matchingIdxs []int
@ -68,7 +68,7 @@ func NewDisjunctionSearcher(indexReader index.IndexReader, qsearchers []search.S
indexReader: indexReader,
searchers: searchers,
currs: make([]*search.DocumentMatch, len(searchers)),
scorer: scorers.NewDisjunctionQueryScorer(explain),
scorer: scorer.NewDisjunctionQueryScorer(explain),
min: int(min),
matching: make([]*search.DocumentMatch, len(searchers)),
matchingIdxs: make([]int, len(searchers)),

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"github.com/blevesearch/bleve/index"
@ -23,7 +23,7 @@ import (
// DocIDSearcher returns documents matching a predefined set of identifiers.
type DocIDSearcher struct {
reader index.DocIDReader
scorer *scorers.ConstantScorer
scorer *scorer.ConstantScorer
count int
}
@ -34,7 +34,7 @@ func NewDocIDSearcher(indexReader index.IndexReader, ids []string, boost float64
if err != nil {
return nil, err
}
scorer := scorers.NewConstantScorer(1.0, boost, explain)
scorer := scorer.NewConstantScorer(1.0, boost, explain)
return &DocIDSearcher{
scorer: scorer,
reader: reader,

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"github.com/blevesearch/bleve/index"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"github.com/blevesearch/bleve/index"
@ -23,7 +23,7 @@ import (
type MatchAllSearcher struct {
indexReader index.IndexReader
reader index.DocIDReader
scorer *scorers.ConstantScorer
scorer *scorer.ConstantScorer
count uint64
}
@ -37,7 +37,7 @@ func NewMatchAllSearcher(indexReader index.IndexReader, boost float64, explain b
_ = reader.Close()
return nil, err
}
scorer := scorers.NewConstantScorer(1.0, boost, explain)
scorer := scorer.NewConstantScorer(1.0, boost, explain)
return &MatchAllSearcher{
indexReader: indexReader,
reader: reader,

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"github.com/blevesearch/bleve/index"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"bytes"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"reflect"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"math"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"testing"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"regexp"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"regexp"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"github.com/blevesearch/bleve/index"
@ -25,7 +25,7 @@ type TermSearcher struct {
term string
field string
reader index.TermFieldReader
scorer *scorers.TermQueryScorer
scorer *scorer.TermQueryScorer
tfd index.TermFieldDoc
explain bool
}
@ -40,7 +40,7 @@ func NewTermSearcher(indexReader index.IndexReader, term string, field string, b
_ = reader.Close()
return nil, err
}
scorer := scorers.NewTermQueryScorer(term, field, boost, count, reader.Count(), explain)
scorer := scorer.NewTermQueryScorer(term, field, boost, count, reader.Count(), explain)
return &TermSearcher{
indexReader: indexReader,
term: term,

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"github.com/blevesearch/bleve/index"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package searchers
package searcher
import (
"math"