module Elasticsearch::API::Response::Helpers::StringHelper
Constants
- QUOTE_TOKENIZER
- WITH_BRACKET
- WITH_QUOTE
- WORD
Public Instance Methods
tokenize_contents(string)
click to toggle source
@return [Hash] field name as a key and values as a value
# File lib/elasticsearch/api/response/helpers/string_helper.rb, line 12 def tokenize_contents(string) string .scan(QUOTE_TOKENIZER) .each_with_object(Hash.new{|h,k| h[k] = []}) { |(field, value), memo| memo[field] << value } end