bleve: github.com/blevesearch/bleve/search/query Index | Files

package query

import "github.com/blevesearch/bleve/search/query"

Index

Package Files

bool_field.go boolean.go boost.go conjunction.go date_range.go disjunction.go docid.go fuzzy.go geo_boundingbox.go geo_distance.go match.go match_all.go match_none.go match_phrase.go multi_phrase.go numeric_range.go phrase.go prefix.go query.go query_string.go query_string.y.go query_string_lex.go query_string_parser.go regexp.go term.go term_range.go wildcard.go

Constants

const (
    // Document must satisfy AT LEAST ONE of term searches.
    MatchQueryOperatorOr = 0
    // Document must satisfy ALL of term searches.
    MatchQueryOperatorAnd = 1
)

Variables

var QueryDateTimeFormat = time.RFC3339

QueryDateTimeFormat controls the format when Marshaling to JSON

var QueryDateTimeParser = optional.Name

QueryDateTimeParser controls the default query date time parser

func DumpQuery Uses

func DumpQuery(m mapping.IndexMapping, query Query) (string, error)

DumpQuery returns a string representation of the query tree, where query string queries have been expanded into base queries. The output format is meant for debugging purpose and may change in the future.

func SetLog Uses

func SetLog(l *log.Logger)

SetLog sets the logger used for logging by default log messages are sent to ioutil.Discard

type BleveQueryTime Uses

type BleveQueryTime struct {
    time.Time
}

func (*BleveQueryTime) MarshalJSON Uses

func (t *BleveQueryTime) MarshalJSON() ([]byte, error)

func (*BleveQueryTime) UnmarshalJSON Uses

func (t *BleveQueryTime) UnmarshalJSON(data []byte) error

type BoolFieldQuery Uses

type BoolFieldQuery struct {
    Bool     bool   `json:"bool"`
    FieldVal string `json:"field,omitempty"`
    BoostVal *Boost `json:"boost,omitempty"`
}

func NewBoolFieldQuery Uses

func NewBoolFieldQuery(val bool) *BoolFieldQuery

NewBoolFieldQuery creates a new Query for boolean fields

func (*BoolFieldQuery) Boost Uses

func (q *BoolFieldQuery) Boost() float64

func (*BoolFieldQuery) Field Uses

func (q *BoolFieldQuery) Field() string

func (*BoolFieldQuery) Searcher Uses

func (q *BoolFieldQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*BoolFieldQuery) SetBoost Uses

func (q *BoolFieldQuery) SetBoost(b float64)

func (*BoolFieldQuery) SetField Uses

func (q *BoolFieldQuery) SetField(f string)

type BooleanQuery Uses

type BooleanQuery struct {
    Must     Query  `json:"must,omitempty"`
    Should   Query  `json:"should,omitempty"`
    MustNot  Query  `json:"must_not,omitempty"`
    BoostVal *Boost `json:"boost,omitempty"`
    // contains filtered or unexported fields
}

func NewBooleanQuery Uses

func NewBooleanQuery(must []Query, should []Query, mustNot []Query) *BooleanQuery

NewBooleanQuery creates a compound Query composed of several other Query objects. Result documents must satisfy ALL of the must Queries. Result documents must satisfy NONE of the must not Queries. Result documents that ALSO satisfy any of the should Queries will score higher.

func NewBooleanQueryForQueryString Uses

func NewBooleanQueryForQueryString(must []Query, should []Query, mustNot []Query) *BooleanQuery

func (*BooleanQuery) AddMust Uses

func (q *BooleanQuery) AddMust(m ...Query)

func (*BooleanQuery) AddMustNot Uses

func (q *BooleanQuery) AddMustNot(m ...Query)

func (*BooleanQuery) AddShould Uses

func (q *BooleanQuery) AddShould(m ...Query)

func (*BooleanQuery) Boost Uses

func (q *BooleanQuery) Boost() float64

func (*BooleanQuery) Searcher Uses

func (q *BooleanQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*BooleanQuery) SetBoost Uses

func (q *BooleanQuery) SetBoost(b float64)

func (*BooleanQuery) SetMinShould Uses

func (q *BooleanQuery) SetMinShould(minShould float64)

SetMinShould requires that at least minShould of the should Queries must be satisfied.

func (*BooleanQuery) UnmarshalJSON Uses

func (q *BooleanQuery) UnmarshalJSON(data []byte) error

func (*BooleanQuery) Validate Uses

func (q *BooleanQuery) Validate() error

type Boost Uses

type Boost float64

func (*Boost) GoString Uses

func (b *Boost) GoString() string

func (*Boost) Value Uses

func (b *Boost) Value() float64

type BoostableQuery Uses

type BoostableQuery interface {
    Query
    SetBoost(b float64)
    Boost() float64
}

A BoostableQuery represents a Query which can be boosted relative to other queries.

type ConjunctionQuery Uses

type ConjunctionQuery struct {
    Conjuncts []Query `json:"conjuncts"`
    BoostVal  *Boost  `json:"boost,omitempty"`
    // contains filtered or unexported fields
}

func NewConjunctionQuery Uses

func NewConjunctionQuery(conjuncts []Query) *ConjunctionQuery

NewConjunctionQuery creates a new compound Query. Result documents must satisfy all of the queries.

func (*ConjunctionQuery) AddQuery Uses

func (q *ConjunctionQuery) AddQuery(aq ...Query)

func (*ConjunctionQuery) Boost Uses

func (q *ConjunctionQuery) Boost() float64

func (*ConjunctionQuery) Searcher Uses

func (q *ConjunctionQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*ConjunctionQuery) SetBoost Uses

func (q *ConjunctionQuery) SetBoost(b float64)

func (*ConjunctionQuery) UnmarshalJSON Uses

func (q *ConjunctionQuery) UnmarshalJSON(data []byte) error

func (*ConjunctionQuery) Validate Uses

func (q *ConjunctionQuery) Validate() error

type DateRangeQuery Uses

type DateRangeQuery struct {
    Start          BleveQueryTime `json:"start,omitempty"`
    End            BleveQueryTime `json:"end,omitempty"`
    InclusiveStart *bool          `json:"inclusive_start,omitempty"`
    InclusiveEnd   *bool          `json:"inclusive_end,omitempty"`
    FieldVal       string         `json:"field,omitempty"`
    BoostVal       *Boost         `json:"boost,omitempty"`
}

func NewDateRangeInclusiveQuery Uses

func NewDateRangeInclusiveQuery(start, end time.Time, startInclusive, endInclusive *bool) *DateRangeQuery

NewDateRangeInclusiveQuery creates a new Query for ranges of date values. Date strings are parsed using the DateTimeParser configured in the

top-level config.QueryDateTimeParser

Either, but not both endpoints can be nil. startInclusive and endInclusive control inclusion of the endpoints.

func NewDateRangeQuery Uses

func NewDateRangeQuery(start, end time.Time) *DateRangeQuery

NewDateRangeQuery creates a new Query for ranges of date values. Date strings are parsed using the DateTimeParser configured in the

top-level config.QueryDateTimeParser

Either, but not both endpoints can be nil.

func (*DateRangeQuery) Boost Uses

func (q *DateRangeQuery) Boost() float64

func (*DateRangeQuery) Field Uses

func (q *DateRangeQuery) Field() string

func (*DateRangeQuery) Searcher Uses

func (q *DateRangeQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*DateRangeQuery) SetBoost Uses

func (q *DateRangeQuery) SetBoost(b float64)

func (*DateRangeQuery) SetField Uses

func (q *DateRangeQuery) SetField(f string)

func (*DateRangeQuery) Validate Uses

func (q *DateRangeQuery) Validate() error

type DisjunctionQuery Uses

type DisjunctionQuery struct {
    Disjuncts []Query `json:"disjuncts"`
    BoostVal  *Boost  `json:"boost,omitempty"`
    Min       float64 `json:"min"`
    // contains filtered or unexported fields
}

func NewDisjunctionQuery Uses

func NewDisjunctionQuery(disjuncts []Query) *DisjunctionQuery

NewDisjunctionQuery creates a new compound Query. Result documents satisfy at least one Query.

func (*DisjunctionQuery) AddQuery Uses

func (q *DisjunctionQuery) AddQuery(aq ...Query)

func (*DisjunctionQuery) Boost Uses

func (q *DisjunctionQuery) Boost() float64

func (*DisjunctionQuery) Searcher Uses

func (q *DisjunctionQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*DisjunctionQuery) SetBoost Uses

func (q *DisjunctionQuery) SetBoost(b float64)

func (*DisjunctionQuery) SetMin Uses

func (q *DisjunctionQuery) SetMin(m float64)

func (*DisjunctionQuery) UnmarshalJSON Uses

func (q *DisjunctionQuery) UnmarshalJSON(data []byte) error

func (*DisjunctionQuery) Validate Uses

func (q *DisjunctionQuery) Validate() error

type DocIDQuery Uses

type DocIDQuery struct {
    IDs      []string `json:"ids"`
    BoostVal *Boost   `json:"boost,omitempty"`
}

func NewDocIDQuery Uses

func NewDocIDQuery(ids []string) *DocIDQuery

NewDocIDQuery creates a new Query object returning indexed documents among the specified set. Combine it with ConjunctionQuery to restrict the scope of other queries output.

func (*DocIDQuery) Boost Uses

func (q *DocIDQuery) Boost() float64

func (*DocIDQuery) Searcher Uses

func (q *DocIDQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*DocIDQuery) SetBoost Uses

func (q *DocIDQuery) SetBoost(b float64)

type FieldableQuery Uses

type FieldableQuery interface {
    Query
    SetField(f string)
    Field() string
}

A FieldableQuery represents a Query which can be restricted to a single field.

type FuzzyQuery Uses

type FuzzyQuery struct {
    Term      string `json:"term"`
    Prefix    int    `json:"prefix_length"`
    Fuzziness int    `json:"fuzziness"`
    FieldVal  string `json:"field,omitempty"`
    BoostVal  *Boost `json:"boost,omitempty"`
}

func NewFuzzyQuery Uses

func NewFuzzyQuery(term string) *FuzzyQuery

NewFuzzyQuery creates a new Query which finds documents containing terms within a specific fuzziness of the specified term. The default fuzziness is 1.

The current implementation uses Levenshtein edit distance as the fuzziness metric.

func (*FuzzyQuery) Boost Uses

func (q *FuzzyQuery) Boost() float64

func (*FuzzyQuery) Field Uses

func (q *FuzzyQuery) Field() string

func (*FuzzyQuery) Searcher Uses

func (q *FuzzyQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*FuzzyQuery) SetBoost Uses

func (q *FuzzyQuery) SetBoost(b float64)

func (*FuzzyQuery) SetField Uses

func (q *FuzzyQuery) SetField(f string)

func (*FuzzyQuery) SetFuzziness Uses

func (q *FuzzyQuery) SetFuzziness(f int)

func (*FuzzyQuery) SetPrefix Uses

func (q *FuzzyQuery) SetPrefix(p int)

type GeoBoundingBoxQuery Uses

type GeoBoundingBoxQuery struct {
    TopLeft     []float64 `json:"top_left,omitempty"`
    BottomRight []float64 `json:"bottom_right,omitempty"`
    FieldVal    string    `json:"field,omitempty"`
    BoostVal    *Boost    `json:"boost,omitempty"`
}

func NewGeoBoundingBoxQuery Uses

func NewGeoBoundingBoxQuery(topLeftLon, topLeftLat, bottomRightLon, bottomRightLat float64) *GeoBoundingBoxQuery

func (*GeoBoundingBoxQuery) Boost Uses

func (q *GeoBoundingBoxQuery) Boost() float64

func (*GeoBoundingBoxQuery) Field Uses

func (q *GeoBoundingBoxQuery) Field() string

func (*GeoBoundingBoxQuery) Searcher Uses

func (q *GeoBoundingBoxQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*GeoBoundingBoxQuery) SetBoost Uses

func (q *GeoBoundingBoxQuery) SetBoost(b float64)

func (*GeoBoundingBoxQuery) SetField Uses

func (q *GeoBoundingBoxQuery) SetField(f string)

func (*GeoBoundingBoxQuery) UnmarshalJSON Uses

func (q *GeoBoundingBoxQuery) UnmarshalJSON(data []byte) error

func (*GeoBoundingBoxQuery) Validate Uses

func (q *GeoBoundingBoxQuery) Validate() error

type GeoDistanceQuery Uses

type GeoDistanceQuery struct {
    Location []float64 `json:"location,omitempty"`
    Distance string    `json:"distance,omitempty"`
    FieldVal string    `json:"field,omitempty"`
    BoostVal *Boost    `json:"boost,omitempty"`
}

func NewGeoDistanceQuery Uses

func NewGeoDistanceQuery(lon, lat float64, distance string) *GeoDistanceQuery

func (*GeoDistanceQuery) Boost Uses

func (q *GeoDistanceQuery) Boost() float64

func (*GeoDistanceQuery) Field Uses

func (q *GeoDistanceQuery) Field() string

func (*GeoDistanceQuery) Searcher Uses

func (q *GeoDistanceQuery) Searcher(i index.IndexReader, m mapping.IndexMapping,
    options search.SearcherOptions) (search.Searcher, error)

func (*GeoDistanceQuery) SetBoost Uses

func (q *GeoDistanceQuery) SetBoost(b float64)

func (*GeoDistanceQuery) SetField Uses

func (q *GeoDistanceQuery) SetField(f string)

func (*GeoDistanceQuery) UnmarshalJSON Uses

func (q *GeoDistanceQuery) UnmarshalJSON(data []byte) error

func (*GeoDistanceQuery) Validate Uses

func (q *GeoDistanceQuery) Validate() error

type MatchAllQuery Uses

type MatchAllQuery struct {
    BoostVal *Boost `json:"boost,omitempty"`
}

func NewMatchAllQuery Uses

func NewMatchAllQuery() *MatchAllQuery

NewMatchAllQuery creates a Query which will match all documents in the index.

func (*MatchAllQuery) Boost Uses

func (q *MatchAllQuery) Boost() float64

func (*MatchAllQuery) MarshalJSON Uses

func (q *MatchAllQuery) MarshalJSON() ([]byte, error)

func (*MatchAllQuery) Searcher Uses

func (q *MatchAllQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*MatchAllQuery) SetBoost Uses

func (q *MatchAllQuery) SetBoost(b float64)

type MatchNoneQuery Uses

type MatchNoneQuery struct {
    BoostVal *Boost `json:"boost,omitempty"`
}

func NewMatchNoneQuery Uses

func NewMatchNoneQuery() *MatchNoneQuery

NewMatchNoneQuery creates a Query which will not match any documents in the index.

func (*MatchNoneQuery) Boost Uses

func (q *MatchNoneQuery) Boost() float64

func (*MatchNoneQuery) MarshalJSON Uses

func (q *MatchNoneQuery) MarshalJSON() ([]byte, error)

func (*MatchNoneQuery) Searcher Uses

func (q *MatchNoneQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*MatchNoneQuery) SetBoost Uses

func (q *MatchNoneQuery) SetBoost(b float64)

type MatchPhraseQuery Uses

type MatchPhraseQuery struct {
    MatchPhrase string `json:"match_phrase"`
    FieldVal    string `json:"field,omitempty"`
    Analyzer    string `json:"analyzer,omitempty"`
    BoostVal    *Boost `json:"boost,omitempty"`
}

func NewMatchPhraseQuery Uses

func NewMatchPhraseQuery(matchPhrase string) *MatchPhraseQuery

NewMatchPhraseQuery creates a new Query object for matching phrases in the index. An Analyzer is chosen based on the field. Input text is analyzed using this analyzer. Token terms resulting from this analysis are used to build a search phrase. Result documents must match this phrase. Queried field must have been indexed with IncludeTermVectors set to true.

func (*MatchPhraseQuery) Boost Uses

func (q *MatchPhraseQuery) Boost() float64

func (*MatchPhraseQuery) Field Uses

func (q *MatchPhraseQuery) Field() string

func (*MatchPhraseQuery) Searcher Uses

func (q *MatchPhraseQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*MatchPhraseQuery) SetBoost Uses

func (q *MatchPhraseQuery) SetBoost(b float64)

func (*MatchPhraseQuery) SetField Uses

func (q *MatchPhraseQuery) SetField(f string)

type MatchQuery Uses

type MatchQuery struct {
    Match     string             `json:"match"`
    FieldVal  string             `json:"field,omitempty"`
    Analyzer  string             `json:"analyzer,omitempty"`
    BoostVal  *Boost             `json:"boost,omitempty"`
    Prefix    int                `json:"prefix_length"`
    Fuzziness int                `json:"fuzziness"`
    Operator  MatchQueryOperator `json:"operator,omitempty"`
}

func NewMatchQuery Uses

func NewMatchQuery(match string) *MatchQuery

NewMatchQuery creates a Query for matching text. An Analyzer is chosen based on the field. Input text is analyzed using this analyzer. Token terms resulting from this analysis are used to perform term searches. Result documents must satisfy at least one of these term searches.

func (*MatchQuery) Boost Uses

func (q *MatchQuery) Boost() float64

func (*MatchQuery) Field Uses

func (q *MatchQuery) Field() string

func (*MatchQuery) Searcher Uses

func (q *MatchQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*MatchQuery) SetBoost Uses

func (q *MatchQuery) SetBoost(b float64)

func (*MatchQuery) SetField Uses

func (q *MatchQuery) SetField(f string)

func (*MatchQuery) SetFuzziness Uses

func (q *MatchQuery) SetFuzziness(f int)

func (*MatchQuery) SetOperator Uses

func (q *MatchQuery) SetOperator(operator MatchQueryOperator)

func (*MatchQuery) SetPrefix Uses

func (q *MatchQuery) SetPrefix(p int)

type MatchQueryOperator Uses

type MatchQueryOperator int

func (MatchQueryOperator) MarshalJSON Uses

func (o MatchQueryOperator) MarshalJSON() ([]byte, error)

func (*MatchQueryOperator) UnmarshalJSON Uses

func (o *MatchQueryOperator) UnmarshalJSON(data []byte) error

type MultiPhraseQuery Uses

type MultiPhraseQuery struct {
    Terms    [][]string `json:"terms"`
    Field    string     `json:"field,omitempty"`
    BoostVal *Boost     `json:"boost,omitempty"`
}

func NewMultiPhraseQuery Uses

func NewMultiPhraseQuery(terms [][]string, field string) *MultiPhraseQuery

NewMultiPhraseQuery creates a new Query for finding term phrases in the index. It is like PhraseQuery, but each position in the phrase may be satisfied by a list of terms as opposed to just one. At least one of the terms must exist in the correct order, at the correct index offsets, in the specified field. Queried field must have been indexed with IncludeTermVectors set to true.

func (*MultiPhraseQuery) Boost Uses

func (q *MultiPhraseQuery) Boost() float64

func (*MultiPhraseQuery) Searcher Uses

func (q *MultiPhraseQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*MultiPhraseQuery) SetBoost Uses

func (q *MultiPhraseQuery) SetBoost(b float64)

func (*MultiPhraseQuery) UnmarshalJSON Uses

func (q *MultiPhraseQuery) UnmarshalJSON(data []byte) error

func (*MultiPhraseQuery) Validate Uses

func (q *MultiPhraseQuery) Validate() error

type NumericRangeQuery Uses

type NumericRangeQuery struct {
    Min          *float64 `json:"min,omitempty"`
    Max          *float64 `json:"max,omitempty"`
    InclusiveMin *bool    `json:"inclusive_min,omitempty"`
    InclusiveMax *bool    `json:"inclusive_max,omitempty"`
    FieldVal     string   `json:"field,omitempty"`
    BoostVal     *Boost   `json:"boost,omitempty"`
}

func NewNumericRangeInclusiveQuery Uses

func NewNumericRangeInclusiveQuery(min, max *float64, minInclusive, maxInclusive *bool) *NumericRangeQuery

NewNumericRangeInclusiveQuery creates a new Query for ranges of numeric values. Either, but not both endpoints can be nil. Control endpoint inclusion with inclusiveMin, inclusiveMax.

func NewNumericRangeQuery Uses

func NewNumericRangeQuery(min, max *float64) *NumericRangeQuery

NewNumericRangeQuery creates a new Query for ranges of numeric values. Either, but not both endpoints can be nil. The minimum value is inclusive. The maximum value is exclusive.

func (*NumericRangeQuery) Boost Uses

func (q *NumericRangeQuery) Boost() float64

func (*NumericRangeQuery) Field Uses

func (q *NumericRangeQuery) Field() string

func (*NumericRangeQuery) Searcher Uses

func (q *NumericRangeQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*NumericRangeQuery) SetBoost Uses

func (q *NumericRangeQuery) SetBoost(b float64)

func (*NumericRangeQuery) SetField Uses

func (q *NumericRangeQuery) SetField(f string)

func (*NumericRangeQuery) Validate Uses

func (q *NumericRangeQuery) Validate() error

type PhraseQuery Uses

type PhraseQuery struct {
    Terms    []string `json:"terms"`
    Field    string   `json:"field,omitempty"`
    BoostVal *Boost   `json:"boost,omitempty"`
}

func NewPhraseQuery Uses

func NewPhraseQuery(terms []string, field string) *PhraseQuery

NewPhraseQuery creates a new Query for finding exact term phrases in the index. The provided terms must exist in the correct order, at the correct index offsets, in the specified field. Queried field must have been indexed with IncludeTermVectors set to true.

func (*PhraseQuery) Boost Uses

func (q *PhraseQuery) Boost() float64

func (*PhraseQuery) Searcher Uses

func (q *PhraseQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*PhraseQuery) SetBoost Uses

func (q *PhraseQuery) SetBoost(b float64)

func (*PhraseQuery) UnmarshalJSON Uses

func (q *PhraseQuery) UnmarshalJSON(data []byte) error

func (*PhraseQuery) Validate Uses

func (q *PhraseQuery) Validate() error

type PrefixQuery Uses

type PrefixQuery struct {
    Prefix   string `json:"prefix"`
    FieldVal string `json:"field,omitempty"`
    BoostVal *Boost `json:"boost,omitempty"`
}

func NewPrefixQuery Uses

func NewPrefixQuery(prefix string) *PrefixQuery

NewPrefixQuery creates a new Query which finds documents containing terms that start with the specified prefix.

func (*PrefixQuery) Boost Uses

func (q *PrefixQuery) Boost() float64

func (*PrefixQuery) Field Uses

func (q *PrefixQuery) Field() string

func (*PrefixQuery) Searcher Uses

func (q *PrefixQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*PrefixQuery) SetBoost Uses

func (q *PrefixQuery) SetBoost(b float64)

func (*PrefixQuery) SetField Uses

func (q *PrefixQuery) SetField(f string)

type Query Uses

type Query interface {
    Searcher(i index.IndexReader, m mapping.IndexMapping,
        options search.SearcherOptions) (search.Searcher, error)
}

A Query represents a description of the type and parameters for a query into the index.

func ParseQuery Uses

func ParseQuery(input []byte) (Query, error)

ParseQuery deserializes a JSON representation of a Query object.

type QueryStringQuery Uses

type QueryStringQuery struct {
    Query    string `json:"query"`
    BoostVal *Boost `json:"boost,omitempty"`
}

func NewQueryStringQuery Uses

func NewQueryStringQuery(query string) *QueryStringQuery

NewQueryStringQuery creates a new Query used for finding documents that satisfy a query string. The query string is a small query language for humans.

func (*QueryStringQuery) Boost Uses

func (q *QueryStringQuery) Boost() float64

func (*QueryStringQuery) Parse Uses

func (q *QueryStringQuery) Parse() (Query, error)

func (*QueryStringQuery) Searcher Uses

func (q *QueryStringQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*QueryStringQuery) SetBoost Uses

func (q *QueryStringQuery) SetBoost(b float64)

func (*QueryStringQuery) Validate Uses

func (q *QueryStringQuery) Validate() error

type RegexpQuery Uses

type RegexpQuery struct {
    Regexp   string `json:"regexp"`
    FieldVal string `json:"field,omitempty"`
    BoostVal *Boost `json:"boost,omitempty"`
    // contains filtered or unexported fields
}

func NewRegexpQuery Uses

func NewRegexpQuery(regexp string) *RegexpQuery

NewRegexpQuery creates a new Query which finds documents containing terms that match the specified regular expression. The regexp pattern SHOULD NOT include ^ or $ modifiers, the search will only match entire terms even without them.

func (*RegexpQuery) Boost Uses

func (q *RegexpQuery) Boost() float64

func (*RegexpQuery) Field Uses

func (q *RegexpQuery) Field() string

func (*RegexpQuery) Searcher Uses

func (q *RegexpQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*RegexpQuery) SetBoost Uses

func (q *RegexpQuery) SetBoost(b float64)

func (*RegexpQuery) SetField Uses

func (q *RegexpQuery) SetField(f string)

func (*RegexpQuery) Validate Uses

func (q *RegexpQuery) Validate() error

type TermQuery Uses

type TermQuery struct {
    Term     string `json:"term"`
    FieldVal string `json:"field,omitempty"`
    BoostVal *Boost `json:"boost,omitempty"`
}

func NewTermQuery Uses

func NewTermQuery(term string) *TermQuery

NewTermQuery creates a new Query for finding an exact term match in the index.

func (*TermQuery) Boost Uses

func (q *TermQuery) Boost() float64

func (*TermQuery) Field Uses

func (q *TermQuery) Field() string

func (*TermQuery) Searcher Uses

func (q *TermQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*TermQuery) SetBoost Uses

func (q *TermQuery) SetBoost(b float64)

func (*TermQuery) SetField Uses

func (q *TermQuery) SetField(f string)

type TermRangeQuery Uses

type TermRangeQuery struct {
    Min          string `json:"min,omitempty"`
    Max          string `json:"max,omitempty"`
    InclusiveMin *bool  `json:"inclusive_min,omitempty"`
    InclusiveMax *bool  `json:"inclusive_max,omitempty"`
    FieldVal     string `json:"field,omitempty"`
    BoostVal     *Boost `json:"boost,omitempty"`
}

func NewTermRangeInclusiveQuery Uses

func NewTermRangeInclusiveQuery(min, max string, minInclusive, maxInclusive *bool) *TermRangeQuery

NewTermRangeInclusiveQuery creates a new Query for ranges of numeric values. Either, but not both endpoints can be nil. Control endpoint inclusion with inclusiveMin, inclusiveMax.

func NewTermRangeQuery Uses

func NewTermRangeQuery(min, max string) *TermRangeQuery

NewTermRangeQuery creates a new Query for ranges of text term values. Either, but not both endpoints can be nil. The minimum value is inclusive. The maximum value is exclusive.

func (*TermRangeQuery) Boost Uses

func (q *TermRangeQuery) Boost() float64

func (*TermRangeQuery) Field Uses

func (q *TermRangeQuery) Field() string

func (*TermRangeQuery) Searcher Uses

func (q *TermRangeQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*TermRangeQuery) SetBoost Uses

func (q *TermRangeQuery) SetBoost(b float64)

func (*TermRangeQuery) SetField Uses

func (q *TermRangeQuery) SetField(f string)

func (*TermRangeQuery) Validate Uses

func (q *TermRangeQuery) Validate() error

type ValidatableQuery Uses

type ValidatableQuery interface {
    Query
    Validate() error
}

A ValidatableQuery represents a Query which can be validated prior to execution.

type WildcardQuery Uses

type WildcardQuery struct {
    Wildcard string `json:"wildcard"`
    FieldVal string `json:"field,omitempty"`
    BoostVal *Boost `json:"boost,omitempty"`
    // contains filtered or unexported fields
}

func NewWildcardQuery Uses

func NewWildcardQuery(wildcard string) *WildcardQuery

NewWildcardQuery creates a new Query which finds documents containing terms that match the specified wildcard. In the wildcard pattern '*' will match any sequence of 0 or more characters, and '?' will match any single character.

func (*WildcardQuery) Boost Uses

func (q *WildcardQuery) Boost() float64

func (*WildcardQuery) Field Uses

func (q *WildcardQuery) Field() string

func (*WildcardQuery) Searcher Uses

func (q *WildcardQuery) Searcher(i index.IndexReader, m mapping.IndexMapping, options search.SearcherOptions) (search.Searcher, error)

func (*WildcardQuery) SetBoost Uses

func (q *WildcardQuery) SetBoost(b float64)

func (*WildcardQuery) SetField Uses

func (q *WildcardQuery) SetField(f string)

func (*WildcardQuery) Validate Uses

func (q *WildcardQuery) Validate() error

Package query imports 21 packages (graph) and is imported by 21 packages. Updated 2017-05-26. Refresh now. Tools for package owners.