Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update does not work for custom properties. #178

Closed
Labels
@dwkoogt

Description

Hi.

I have models that have custom index properties defined in the mapping. The values for these properties are computed when as_indexed_json is called. However, update_index call in Elasticsearch::Model::Indexing checks for changed attributes and only selects those values from as_indexed_json missing all the custom index properties.

see the :custom_prop in below class.

class M
field :id
field :name, type: String

mappings do
indexes :id, index: :not_analyzed
indexes :name, analyzer: 'standard'
indexes :custom_prop
end

def as_indexed_json(options={})
_hash = as_json(only: [name])
_hash['custom_prop'] = "some computed value"
end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /