Added support for partial_fields #434

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@simonjsmithuk

I added a simple method to support partial_fields. partial_fields allow the returning of a subset of the record in elastic search. For example if your structured data looks like this:

:data => {
   :name => {
      :first => "James",
      :last => "Bond"
   }
} 

This could be queried to get the partial records as such:

s = Tire.search('articles') do
  query do
      string "James"
  end
  partial_fields "header", ['data.name.last.*']
end

The record returned will contain a field called 'header' with the hash

:data => {
   :name => {
      :last => "Bond"
   }
} 

The function also supports exclude, but this seem to have no effect on the returned data. It is passed in the query as documented in the elastic search documentation.There may be multiple fields in each the include list and exclude list.

http://www.elasticsearch.org/guide/reference/api/search/fields.html

@travisbot

This comment has been minimized.

Show comment Hide comment
@travisbot

travisbot Aug 17, 2012

This pull request passes (merged 583201a into 5129f8a).

This pull request passes (merged 583201a into 5129f8a).

@karmi

This comment has been minimized.

Show comment Hide comment
@karmi

karmi Oct 23, 2012

Owner

Err, sorry for the delay, closed in 1c16b68... I think the proper semantics is to pass exclude and include as options...

Owner

karmi commented Oct 23, 2012

Err, sorry for the delay, closed in 1c16b68... I think the proper semantics is to pass exclude and include as options...

@karmi karmi closed this Oct 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment