Documentation ¶
Overview ¶
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Copyright (c) 2014 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.
Index ¶
- Constants
- Variables
- func OrderTermLocations(tlm TermLocationMap) termLocations
- type ANSIFragmentFormatter
- type BooleanSearcher
- type Collector
- type ConjunctionQueryScorer
- type ConjunctionSearcher
- func (s *ConjunctionSearcher) Advance(ID string) (*DocumentMatch, error)
- func (s *ConjunctionSearcher) Close()
- func (s *ConjunctionSearcher) Count() uint64
- func (s *ConjunctionSearcher) Next() (*DocumentMatch, error)
- func (s *ConjunctionSearcher) SetQueryNorm(qnorm float64)
- func (s *ConjunctionSearcher) Weight() float64
- type ConstantScorer
- type DateRangeFacet
- type DateTimeFacetBuilder
- type DisjunctionQueryScorer
- type DisjunctionSearcher
- func (s *DisjunctionSearcher) Advance(ID string) (*DocumentMatch, error)
- func (s *DisjunctionSearcher) Close()
- func (s *DisjunctionSearcher) Count() uint64
- func (s *DisjunctionSearcher) Next() (*DocumentMatch, error)
- func (s *DisjunctionSearcher) SetQueryNorm(qnorm float64)
- func (s *DisjunctionSearcher) Weight() float64
- type DocumentMatch
- type DocumentMatchCollection
- type Explanation
- type FacetBuilder
- type FacetResult
- type FacetResults
- type FacetsBuilder
- type FieldFragmentMap
- type FieldTermLocationMap
- type Fragment
- type FragmentFormatter
- type FragmentQueue
- type FragmentScorer
- type Fragmenter
- type HTMLFragmentFormatter
- type Highlighter
- type Location
- type Locations
- type MatchAllSearcher
- func (s *MatchAllSearcher) Advance(ID string) (*DocumentMatch, error)
- func (s *MatchAllSearcher) Close()
- func (s *MatchAllSearcher) Count() uint64
- func (s *MatchAllSearcher) Next() (*DocumentMatch, error)
- func (s *MatchAllSearcher) SetQueryNorm(qnorm float64)
- func (s *MatchAllSearcher) Weight() float64
- type MatchNoneSearcher
- func (s *MatchNoneSearcher) Advance(ID string) (*DocumentMatch, error)
- func (s *MatchNoneSearcher) Close()
- func (s *MatchNoneSearcher) Count() uint64
- func (s *MatchNoneSearcher) Next() (*DocumentMatch, error)
- func (s *MatchNoneSearcher) SetQueryNorm(qnorm float64)
- func (s *MatchNoneSearcher) Weight() float64
- type NumericFacetBuilder
- type NumericRangeFacet
- type NumericRangeSearcher
- func (s *NumericRangeSearcher) Advance(ID string) (*DocumentMatch, error)
- func (s *NumericRangeSearcher) Close()
- func (s *NumericRangeSearcher) Count() uint64
- func (s *NumericRangeSearcher) Next() (*DocumentMatch, error)
- func (s *NumericRangeSearcher) SetQueryNorm(qnorm float64)
- func (s *NumericRangeSearcher) Weight() float64
- type OrderedSearcherList
- type PhraseSearcher
- type Searcher
- type SimpleFragmentScorer
- type SimpleFragmenter
- type SimpleHighlighter
- func (s *SimpleHighlighter) BestFragmentInField(dm *DocumentMatch, doc *document.Document, field string) string
- func (s *SimpleHighlighter) BestFragmentsInField(dm *DocumentMatch, doc *document.Document, field string, num int) []string
- func (s *SimpleHighlighter) FragmentFormatter() FragmentFormatter
- func (s *SimpleHighlighter) Fragmenter() Fragmenter
- func (s *SimpleHighlighter) Separator() string
- func (s *SimpleHighlighter) SetFragmentFormatter(f FragmentFormatter)
- func (s *SimpleHighlighter) SetFragmenter(f Fragmenter)
- func (s *SimpleHighlighter) SetSeparator(sep string)
- type TermFacet
- type TermLocationMap
- type TermPrefixSearcher
- func (s *TermPrefixSearcher) Advance(ID string) (*DocumentMatch, error)
- func (s *TermPrefixSearcher) Close()
- func (s *TermPrefixSearcher) Count() uint64
- func (s *TermPrefixSearcher) Next() (*DocumentMatch, error)
- func (s *TermPrefixSearcher) SetQueryNorm(qnorm float64)
- func (s *TermPrefixSearcher) Weight() float64
- type TermQueryScorer
- type TermSearcher
- type TermsFacetBuilder
- type TopScoreCollector
- func (tksc *TopScoreCollector) Collect(searcher Searcher) error
- func (tksc *TopScoreCollector) FacetResults() FacetResults
- func (tksc *TopScoreCollector) MaxScore() float64
- func (tksc *TopScoreCollector) Results() DocumentMatchCollection
- func (tksc *TopScoreCollector) SetFacetsBuilder(facetsBuilder *FacetsBuilder)
- func (tksc *TopScoreCollector) Took() time.Duration
- func (tksc *TopScoreCollector) Total() uint64
Constants ¶
const DEFAULT_ANSI_HIGHLIGHT = bgYellow
const DEFAULT_FRAGMENT_SIZE = 100
const DEFAULT_HTML_HIGHLIGHT_AFTER = "</b>"
const DEFAULT_HTML_HIGHLIGHT_BEFORE = "<b>"
const DEFAULT_SEPARATOR = "…"
const MAX_SCORE_CACHE = 64
const MAX_SQRT_CACHE = 64
Variables ¶
var SQRT_CACHE map[int]float64
Functions ¶
func OrderTermLocations ¶
func OrderTermLocations(tlm TermLocationMap) termLocations
Types ¶
type ANSIFragmentFormatter ¶
type ANSIFragmentFormatter struct {
// contains filtered or unexported fields
}
func NewANSIFragmentFormatter ¶
func NewANSIFragmentFormatter() *ANSIFragmentFormatter
func (*ANSIFragmentFormatter) Format ¶
func (a *ANSIFragmentFormatter) Format(f *Fragment, tlm TermLocationMap) string
type BooleanSearcher ¶
type BooleanSearcher struct {
// contains filtered or unexported fields
}
func NewBooleanSearcher ¶
func NewBooleanSearcher(index index.Index, mustSearcher *ConjunctionSearcher, shouldSearcher *DisjunctionSearcher, mustNotSearcher *DisjunctionSearcher, explain bool) (*BooleanSearcher, error)
func (*BooleanSearcher) Advance ¶
func (s *BooleanSearcher) Advance(ID string) (*DocumentMatch, error)
func (*BooleanSearcher) Close ¶
func (s *BooleanSearcher) Close()
func (*BooleanSearcher) Count ¶
func (s *BooleanSearcher) Count() uint64
func (*BooleanSearcher) Next ¶
func (s *BooleanSearcher) Next() (*DocumentMatch, error)
func (*BooleanSearcher) SetQueryNorm ¶
func (s *BooleanSearcher) SetQueryNorm(qnorm float64)
func (*BooleanSearcher) Weight ¶
func (s *BooleanSearcher) Weight() float64
type Collector ¶
type Collector interface { Collect(searcher Searcher) error Results() DocumentMatchCollection Total() uint64 MaxScore() float64 Took() time.Duration SetFacetsBuilder(facetsBuilder *FacetsBuilder) FacetResults() FacetResults }
type ConjunctionQueryScorer ¶
type ConjunctionQueryScorer struct {
// contains filtered or unexported fields
}
func NewConjunctionQueryScorer ¶
func NewConjunctionQueryScorer(explain bool) *ConjunctionQueryScorer
func (*ConjunctionQueryScorer) Score ¶
func (s *ConjunctionQueryScorer) Score(constituents []*DocumentMatch) *DocumentMatch
type ConjunctionSearcher ¶
type ConjunctionSearcher struct {
// contains filtered or unexported fields
}
func NewConjunctionSearcher ¶
func (*ConjunctionSearcher) Advance ¶
func (s *ConjunctionSearcher) Advance(ID string) (*DocumentMatch, error)
func (*ConjunctionSearcher) Close ¶
func (s *ConjunctionSearcher) Close()
func (*ConjunctionSearcher) Count ¶
func (s *ConjunctionSearcher) Count() uint64
func (*ConjunctionSearcher) Next ¶
func (s *ConjunctionSearcher) Next() (*DocumentMatch, error)
func (*ConjunctionSearcher) SetQueryNorm ¶
func (s *ConjunctionSearcher) SetQueryNorm(qnorm float64)
func (*ConjunctionSearcher) Weight ¶
func (s *ConjunctionSearcher) Weight() float64
type ConstantScorer ¶
type ConstantScorer struct {
// contains filtered or unexported fields
}
func NewConstantScorer ¶
func NewConstantScorer(constant float64, boost float64, explain bool) *ConstantScorer
func (*ConstantScorer) Score ¶
func (s *ConstantScorer) Score(id string) *DocumentMatch
func (*ConstantScorer) SetQueryNorm ¶
func (s *ConstantScorer) SetQueryNorm(qnorm float64)
func (*ConstantScorer) Weight ¶
func (s *ConstantScorer) Weight() float64
type DateRangeFacet ¶
type DateTimeFacetBuilder ¶
type DateTimeFacetBuilder struct {
// contains filtered or unexported fields
}
func NewDateTimeFacetBuilder ¶
func NewDateTimeFacetBuilder(field string, size int) *DateTimeFacetBuilder
func (*DateTimeFacetBuilder) AddRange ¶
func (fb *DateTimeFacetBuilder) AddRange(name string, start, end time.Time)
func (*DateTimeFacetBuilder) Result ¶
func (fb *DateTimeFacetBuilder) Result() FacetResult
func (*DateTimeFacetBuilder) Update ¶
func (fb *DateTimeFacetBuilder) Update(ft index.FieldTerms)
type DisjunctionQueryScorer ¶
type DisjunctionQueryScorer struct {
// contains filtered or unexported fields
}
func NewDisjunctionQueryScorer ¶
func NewDisjunctionQueryScorer(explain bool) *DisjunctionQueryScorer
func (*DisjunctionQueryScorer) Score ¶
func (s *DisjunctionQueryScorer) Score(constituents []*DocumentMatch, countMatch, countTotal int) *DocumentMatch
type DisjunctionSearcher ¶
type DisjunctionSearcher struct {
// contains filtered or unexported fields
}
func NewDisjunctionSearcher ¶
func (*DisjunctionSearcher) Advance ¶
func (s *DisjunctionSearcher) Advance(ID string) (*DocumentMatch, error)
func (*DisjunctionSearcher) Close ¶
func (s *DisjunctionSearcher) Close()
func (*DisjunctionSearcher) Count ¶
func (s *DisjunctionSearcher) Count() uint64
func (*DisjunctionSearcher) Next ¶
func (s *DisjunctionSearcher) Next() (*DocumentMatch, error)
func (*DisjunctionSearcher) SetQueryNorm ¶
func (s *DisjunctionSearcher) SetQueryNorm(qnorm float64)
func (*DisjunctionSearcher) Weight ¶
func (s *DisjunctionSearcher) Weight() float64
type DocumentMatch ¶
type DocumentMatch struct { ID string `json:"id"` Score float64 `json:"score"` Expl *Explanation `json:"explanation,omitempty"` Locations FieldTermLocationMap `json:"locations,omitempty"` Fragments FieldFragmentMap `json:"fragments,omitempty"` Fields map[string]interface{} `json:"fields,omitempty"` }
func (*DocumentMatch) AddFieldValue ¶
func (dm *DocumentMatch) AddFieldValue(name string, value interface{})
type DocumentMatchCollection ¶
type DocumentMatchCollection []*DocumentMatch
type Explanation ¶
type Explanation struct { Value float64 `json:"value"` Message string `json:"message"` Children []*Explanation `json:"children,omitempty"` }
func (*Explanation) String ¶
func (expl *Explanation) String() string
type FacetBuilder ¶
type FacetBuilder interface { Update(index.FieldTerms) Result() FacetResult }
type FacetResult ¶
type FacetResult struct { Field string `json:"field"` Total int `json:"total"` Missing int `json:"missing"` Other int `json:"other"` Terms []*TermFacet `json:"terms,omitempty"` NumericRanges []*NumericRangeFacet `json:"numeric_ranges,omitempty"` DateRanges []*DateRangeFacet `json:"date_ranges,omitempty"` }
type FacetResults ¶
type FacetResults map[string]FacetResult
type FacetsBuilder ¶
type FacetsBuilder struct {
// contains filtered or unexported fields
}
func NewFacetsBuilder ¶
func NewFacetsBuilder(index index.Index) *FacetsBuilder
func (*FacetsBuilder) Add ¶
func (fb *FacetsBuilder) Add(name string, facetBuilder FacetBuilder)
func (*FacetsBuilder) Results ¶
func (fb *FacetsBuilder) Results() FacetResults
func (*FacetsBuilder) Update ¶
func (fb *FacetsBuilder) Update(docMatch *DocumentMatch) error
type FieldFragmentMap ¶
type FieldTermLocationMap ¶
type FieldTermLocationMap map[string]TermLocationMap
type FragmentFormatter ¶
type FragmentFormatter interface {
Format(f *Fragment, tlm TermLocationMap) string
}
type FragmentQueue ¶
type FragmentQueue []*Fragment
A PriorityQueue implements heap.Interface and holds Items.
func (FragmentQueue) Len ¶
func (fq FragmentQueue) Len() int
func (FragmentQueue) Less ¶
func (fq FragmentQueue) Less(i, j int) bool
func (*FragmentQueue) Pop ¶
func (fq *FragmentQueue) Pop() interface{}
func (*FragmentQueue) Push ¶
func (fq *FragmentQueue) Push(x interface{})
func (FragmentQueue) Swap ¶
func (fq FragmentQueue) Swap(i, j int)
type FragmentScorer ¶
type Fragmenter ¶
type HTMLFragmentFormatter ¶
type HTMLFragmentFormatter struct {
// contains filtered or unexported fields
}
func NewHTMLFragmentFormatter ¶
func NewHTMLFragmentFormatter() *HTMLFragmentFormatter
func NewHTMLFragmentFormatterCustom ¶
func NewHTMLFragmentFormatterCustom(before, after string) *HTMLFragmentFormatter
func (*HTMLFragmentFormatter) Format ¶
func (a *HTMLFragmentFormatter) Format(f *Fragment, tlm TermLocationMap) string
type Highlighter ¶
type Highlighter interface { Fragmenter() Fragmenter SetFragmenter(Fragmenter) FragmentFormatter() FragmentFormatter SetFragmentFormatter(FragmentFormatter) Separator() string SetSeparator(string) BestFragmentInField(*DocumentMatch, *document.Document, string) string BestFragmentsInField(*DocumentMatch, *document.Document, string, int) []string }
type MatchAllSearcher ¶
type MatchAllSearcher struct {
// contains filtered or unexported fields
}
func NewMatchAllSearcher ¶
func (*MatchAllSearcher) Advance ¶
func (s *MatchAllSearcher) Advance(ID string) (*DocumentMatch, error)
func (*MatchAllSearcher) Close ¶
func (s *MatchAllSearcher) Close()
func (*MatchAllSearcher) Count ¶
func (s *MatchAllSearcher) Count() uint64
func (*MatchAllSearcher) Next ¶
func (s *MatchAllSearcher) Next() (*DocumentMatch, error)
func (*MatchAllSearcher) SetQueryNorm ¶
func (s *MatchAllSearcher) SetQueryNorm(qnorm float64)
func (*MatchAllSearcher) Weight ¶
func (s *MatchAllSearcher) Weight() float64
type MatchNoneSearcher ¶
type MatchNoneSearcher struct {
// contains filtered or unexported fields
}
func NewMatchNoneSearcher ¶
func NewMatchNoneSearcher(index index.Index) (*MatchNoneSearcher, error)
func (*MatchNoneSearcher) Advance ¶
func (s *MatchNoneSearcher) Advance(ID string) (*DocumentMatch, error)
func (*MatchNoneSearcher) Close ¶
func (s *MatchNoneSearcher) Close()
func (*MatchNoneSearcher) Count ¶
func (s *MatchNoneSearcher) Count() uint64
func (*MatchNoneSearcher) Next ¶
func (s *MatchNoneSearcher) Next() (*DocumentMatch, error)
func (*MatchNoneSearcher) SetQueryNorm ¶
func (s *MatchNoneSearcher) SetQueryNorm(qnorm float64)
func (*MatchNoneSearcher) Weight ¶
func (s *MatchNoneSearcher) Weight() float64
type NumericFacetBuilder ¶
type NumericFacetBuilder struct {
// contains filtered or unexported fields
}
func NewNumericFacetBuilder ¶
func NewNumericFacetBuilder(field string, size int) *NumericFacetBuilder
func (*NumericFacetBuilder) AddRange ¶
func (fb *NumericFacetBuilder) AddRange(name string, min, max *float64)
func (*NumericFacetBuilder) Result ¶
func (fb *NumericFacetBuilder) Result() FacetResult
func (*NumericFacetBuilder) Update ¶
func (fb *NumericFacetBuilder) Update(ft index.FieldTerms)
type NumericRangeFacet ¶
type NumericRangeSearcher ¶
type NumericRangeSearcher struct {
// contains filtered or unexported fields
}
func NewNumericRangeSearcher ¶
func (*NumericRangeSearcher) Advance ¶
func (s *NumericRangeSearcher) Advance(ID string) (*DocumentMatch, error)
func (*NumericRangeSearcher) Close ¶
func (s *NumericRangeSearcher) Close()
func (*NumericRangeSearcher) Count ¶
func (s *NumericRangeSearcher) Count() uint64
func (*NumericRangeSearcher) Next ¶
func (s *NumericRangeSearcher) Next() (*DocumentMatch, error)
func (*NumericRangeSearcher) SetQueryNorm ¶
func (s *NumericRangeSearcher) SetQueryNorm(qnorm float64)
func (*NumericRangeSearcher) Weight ¶
func (s *NumericRangeSearcher) Weight() float64
type OrderedSearcherList ¶
type OrderedSearcherList []Searcher
func (OrderedSearcherList) Len ¶
func (otrl OrderedSearcherList) Len() int
func (OrderedSearcherList) Less ¶
func (otrl OrderedSearcherList) Less(i, j int) bool
func (OrderedSearcherList) Swap ¶
func (otrl OrderedSearcherList) Swap(i, j int)
type PhraseSearcher ¶
type PhraseSearcher struct {
// contains filtered or unexported fields
}
func NewPhraseSearcher ¶
func NewPhraseSearcher(index index.Index, mustSearcher *ConjunctionSearcher, terms []string) (*PhraseSearcher, error)
func (*PhraseSearcher) Advance ¶
func (s *PhraseSearcher) Advance(ID string) (*DocumentMatch, error)
func (*PhraseSearcher) Close ¶
func (s *PhraseSearcher) Close()
func (*PhraseSearcher) Count ¶
func (s *PhraseSearcher) Count() uint64
func (*PhraseSearcher) Next ¶
func (s *PhraseSearcher) Next() (*DocumentMatch, error)
func (*PhraseSearcher) SetQueryNorm ¶
func (s *PhraseSearcher) SetQueryNorm(qnorm float64)
func (*PhraseSearcher) Weight ¶
func (s *PhraseSearcher) Weight() float64
type Searcher ¶
type Searcher interface { Next() (*DocumentMatch, error) Advance(ID string) (*DocumentMatch, error) Close() Weight() float64 SetQueryNorm(float64) Count() uint64 }
type SimpleFragmentScorer ¶
type SimpleFragmentScorer struct {
// contains filtered or unexported fields
}
SimpleFragmentScorer will score fragments by how many unique terms occur in the fragment with no regard for any boost values used in the original query
func NewSimpleFragmentScorer ¶
func NewSimpleFragmentScorer(tlm TermLocationMap) *SimpleFragmentScorer
func (*SimpleFragmentScorer) Score ¶
func (s *SimpleFragmentScorer) Score(f *Fragment)
type SimpleFragmenter ¶
type SimpleFragmenter struct {
// contains filtered or unexported fields
}
func NewSimpleFragmenter ¶
func NewSimpleFragmenter() *SimpleFragmenter
func NewSimpleFragmenterWithSize ¶
func NewSimpleFragmenterWithSize(fragmentSize int) *SimpleFragmenter
func (*SimpleFragmenter) Fragment ¶
func (s *SimpleFragmenter) Fragment(orig []byte, ot termLocations) []*Fragment
type SimpleHighlighter ¶
type SimpleHighlighter struct {
// contains filtered or unexported fields
}
func NewSimpleHighlighter ¶
func NewSimpleHighlighter() *SimpleHighlighter
func (*SimpleHighlighter) BestFragmentInField ¶
func (s *SimpleHighlighter) BestFragmentInField(dm *DocumentMatch, doc *document.Document, field string) string
func (*SimpleHighlighter) BestFragmentsInField ¶
func (s *SimpleHighlighter) BestFragmentsInField(dm *DocumentMatch, doc *document.Document, field string, num int) []string
func (*SimpleHighlighter) FragmentFormatter ¶
func (s *SimpleHighlighter) FragmentFormatter() FragmentFormatter
func (*SimpleHighlighter) Fragmenter ¶
func (s *SimpleHighlighter) Fragmenter() Fragmenter
func (*SimpleHighlighter) Separator ¶
func (s *SimpleHighlighter) Separator() string
func (*SimpleHighlighter) SetFragmentFormatter ¶
func (s *SimpleHighlighter) SetFragmentFormatter(f FragmentFormatter)
func (*SimpleHighlighter) SetFragmenter ¶
func (s *SimpleHighlighter) SetFragmenter(f Fragmenter)
func (*SimpleHighlighter) SetSeparator ¶
func (s *SimpleHighlighter) SetSeparator(sep string)
type TermLocationMap ¶
func (TermLocationMap) AddLocation ¶
func (t TermLocationMap) AddLocation(term string, location *Location)
type TermPrefixSearcher ¶
type TermPrefixSearcher struct {
// contains filtered or unexported fields
}
func NewTermPrefixSearcher ¶
func (*TermPrefixSearcher) Advance ¶
func (s *TermPrefixSearcher) Advance(ID string) (*DocumentMatch, error)
func (*TermPrefixSearcher) Close ¶
func (s *TermPrefixSearcher) Close()
func (*TermPrefixSearcher) Count ¶
func (s *TermPrefixSearcher) Count() uint64
func (*TermPrefixSearcher) Next ¶
func (s *TermPrefixSearcher) Next() (*DocumentMatch, error)
func (*TermPrefixSearcher) SetQueryNorm ¶
func (s *TermPrefixSearcher) SetQueryNorm(qnorm float64)
func (*TermPrefixSearcher) Weight ¶
func (s *TermPrefixSearcher) Weight() float64
type TermQueryScorer ¶
type TermQueryScorer struct {
// contains filtered or unexported fields
}
func NewTermQueryScorer ¶
func (*TermQueryScorer) Score ¶
func (s *TermQueryScorer) Score(termMatch *index.TermFieldDoc) *DocumentMatch
func (*TermQueryScorer) SetQueryNorm ¶
func (s *TermQueryScorer) SetQueryNorm(qnorm float64)
func (*TermQueryScorer) Weight ¶
func (s *TermQueryScorer) Weight() float64
type TermSearcher ¶
type TermSearcher struct {
// contains filtered or unexported fields
}
func NewTermSearcher ¶
func (*TermSearcher) Advance ¶
func (s *TermSearcher) Advance(ID string) (*DocumentMatch, error)
func (*TermSearcher) Close ¶
func (s *TermSearcher) Close()
func (*TermSearcher) Count ¶
func (s *TermSearcher) Count() uint64
func (*TermSearcher) Next ¶
func (s *TermSearcher) Next() (*DocumentMatch, error)
func (*TermSearcher) SetQueryNorm ¶
func (s *TermSearcher) SetQueryNorm(qnorm float64)
func (*TermSearcher) Weight ¶
func (s *TermSearcher) Weight() float64
type TermsFacetBuilder ¶
type TermsFacetBuilder struct {
// contains filtered or unexported fields
}
func NewTermsFacetBuilder ¶
func NewTermsFacetBuilder(field string, size int) *TermsFacetBuilder
func (*TermsFacetBuilder) Result ¶
func (fb *TermsFacetBuilder) Result() FacetResult
func (*TermsFacetBuilder) Update ¶
func (fb *TermsFacetBuilder) Update(ft index.FieldTerms)
type TopScoreCollector ¶
type TopScoreCollector struct {
// contains filtered or unexported fields
}
func NewTopScorerCollector ¶
func NewTopScorerCollector(k int) *TopScoreCollector
func NewTopScorerSkipCollector ¶
func NewTopScorerSkipCollector(k, skip int) *TopScoreCollector
func (*TopScoreCollector) Collect ¶
func (tksc *TopScoreCollector) Collect(searcher Searcher) error
func (*TopScoreCollector) FacetResults ¶
func (tksc *TopScoreCollector) FacetResults() FacetResults
func (*TopScoreCollector) MaxScore ¶
func (tksc *TopScoreCollector) MaxScore() float64
func (*TopScoreCollector) Results ¶
func (tksc *TopScoreCollector) Results() DocumentMatchCollection
func (*TopScoreCollector) SetFacetsBuilder ¶
func (tksc *TopScoreCollector) SetFacetsBuilder(facetsBuilder *FacetsBuilder)
func (*TopScoreCollector) Took ¶
func (tksc *TopScoreCollector) Took() time.Duration
func (*TopScoreCollector) Total ¶
func (tksc *TopScoreCollector) Total() uint64
Source Files ¶
- collector.go
- collector_top_score.go
- explanation.go
- facet_builder_datetime.go
- facet_builder_numeric.go
- facet_builder_terms.go
- facets_builder.go
- fragment_formatter_ansi.go
- fragment_formatter_html.go
- fragment_scorer_simple.go
- fragmenter_simple.go
- highlighter.go
- highlighter_simple.go
- ordered_searchers_list.go
- scorer_conjunction.go
- scorer_contsant.go
- scorer_disjunction.go
- scorer_term.go
- search.go
- search_boolean.go
- search_conjunction.go
- search_disjunction.go
- search_match_all.go
- search_match_none.go
- search_numeric_range.go
- search_phrase.go
- search_term.go
- search_term_prefix.go
- sqrt_cache.go
- term_locations.go
- util.go