Module: Sphinx::Constants

Included in:
Sphinx, Client
Defined in:
lib/sphinx/constants.rb

Overview

Contains all constants need by Sphinx API.

Constant Summary

SPH_MATCH_ALL =

match all query words

0
SPH_MATCH_ANY =

match any query word

1
SPH_MATCH_PHRASE =

match this exact phrase

2
SPH_MATCH_BOOLEAN =

match this boolean query

3
SPH_MATCH_EXTENDED =

match this extended query

4
SPH_MATCH_FULLSCAN =

match all document IDs w/o fulltext query, apply filters

5
SPH_MATCH_EXTENDED2 =

extended engine V2 (TEMPORARY, WILL BE REMOVED IN 0.9.8-RELEASE)

6
SPH_RANK_PROXIMITY_BM25 =

default mode, phrase proximity major factor and BM25 minor one

0
SPH_RANK_BM25 =

statistical mode, BM25 ranking only (faster but worse quality)

1
SPH_RANK_NONE =

no ranking, all matches get a weight of 1

2
SPH_RANK_WORDCOUNT =

simple word-count weighting, rank is a weighted sum of per-field keyword occurence counts

3
SPH_RANK_PROXIMITY =

phrase proximity

4
SPH_RANK_MATCHANY =

emulate old match-any weighting

5
SPH_RANK_FIELDMASK =

sets bits where there were matches

6
SPH_RANK_SPH04 =

codename SPH04, phrase proximity + bm25 + head/exact boost

7
SPH_RANK_EXPR =

lets you specify the ranking formula in run time

8
SPH_SORT_RELEVANCE =

sort by document relevance desc, then by date

0
SPH_SORT_ATTR_DESC =

sort by document date desc, then by relevance desc

1
SPH_SORT_ATTR_ASC =

sort by document date asc, then by relevance desc

2
SPH_SORT_TIME_SEGMENTS =

sort by time segments (hour/day/week/etc) desc, then by relevance desc

3
SPH_SORT_EXTENDED =

sort by SQL-like expression (eg. "@relevance DESC, price ASC, @id DESC")

4
SPH_SORT_EXPR =

sort by arithmetic expression in descending order (eg. "@id + max(@weight,1000)*boost + log(price)")

5
SPH_FILTER_VALUES =

filter by integer values set

0
SPH_FILTER_RANGE =

filter by integer range

1
SPH_FILTER_FLOATRANGE =

filter by float range

2
SPH_ATTR_INTEGER =

this attr is just an integer

1
SPH_ATTR_TIMESTAMP =

this attr is a timestamp

2
SPH_ATTR_ORDINAL =

this attr is an ordinal string number (integer at search time, specially handled at indexing time)

3
SPH_ATTR_BOOL =

this attr is a boolean bit field

4
SPH_ATTR_FLOAT =

this attr is a float

5
SPH_ATTR_BIGINT =

signed 64-bit integer

6
SPH_ATTR_STRING =

string (binary; in-memory)

7
SPH_ATTR_FACTORS =

???

1001
SPH_ATTR_MULTI =

this attr has multiple values (0 or more)

0x40000001
SPH_ATTR_MULTI64 =

this attr has multiple 64-bit values (0 or more)

0x40000002
SPH_GROUPBY_DAY =

group by day

0
SPH_GROUPBY_WEEK =

group by week

1
SPH_GROUPBY_MONTH =

group by month

2
SPH_GROUPBY_YEAR =

group by year

3
SPH_GROUPBY_ATTR =

group by attribute value

4
SPH_GROUPBY_ATTRPAIR =

group by sequential attrs pair

5
QUERY_FLAGS =

Known query flags

HashWithIndifferentAccess.new(
  :reverse_scan       => { :values => [ 0, 1 ],                  :index => 0 },
  :sort_method        => { :values => ['pq', 'kbuffer' ],        :index => 1 },
  :max_predicted_time => { :values => lambda { |x| x > 0 },      :index => 2 },
  :boolean_simplify   => { :values => [ false, true ],           :index => 3 },
  :idf                => { :values => [ 'normalized', 'plain' ], :index => 4 }
)