Skip to content

Commit

Permalink
make ResultItem#[] call 'to_sym' on supplied key to better support mu…
Browse files Browse the repository at this point in the history
…lti_value fields.


Given a multi_field ``name`` with sub field ``ngrams`` and a query which highlights ``name.ngrams``, if we try to use the highlight with ``result.highlight['name.ngrams']`` we'll get nil even though inspect shows <Item name.ngrams: [".."]>. Doing ``result.highlight['name.ngrams'.to_sym] works as expected, but tire should do this for us.
  • Loading branch information
thedeeno committed Mar 18, 2012
1 parent aa19638 commit 0bd1a67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tire/results/item.rb
Expand Up @@ -28,7 +28,7 @@ def method_missing(method_name, *arguments)
end

def [](key)
@attributes[key]
@attributes[key.to_sym]
end

def id
Expand Down

0 comments on commit 0bd1a67

Please sign in to comment.