Module: SimpleSolrClient::Schema::Analysis

Included in:
FieldType
Defined in:
lib/simple_solr/schema/analysis.rb

Instance Method Summary collapse

Instance Method Details

#index_tokens(val) ⇒ Array

Get an array of tokens as analyzed/transformed at index time Note that you may have multiple values at each token position if you use a synonym filter or a stemmer

Examples:

Results when there’s a stemmer

c.fieldtype_index_tokens 'text', "That's Life"
  => [["that's", "that"], "life"]

Parameters:

  • ft (String)

    the name of the fieldType (not the field)

  • val (String)

    the search string to parse

Returns:

  • (Array)

    An array of tokens as produced by that index analysis chain



46
47
48
# File 'lib/simple_solr/schema/analysis.rb', line 46

def index_tokens(val)
  fieldtype_tokens(val, 'index')
end

#query_tokens(val) ⇒ Object

Get an array of tokens as analyzed/transformed at query time See #fieldtype_index_tokens



52
53
54
# File 'lib/simple_solr/schema/analysis.rb', line 52

def query_tokens(val)
  fieldtype_tokens(val, 'query')
end