Skip to content

Why I always have to force create_index! ? #88

@tenaz3

Description

@tenaz3

searchable.rb

FORMAT = "...."
settings :analysis => {
        :analyzer => {
            :city_name => {
                'tokenizer' => 'standard',
                'filter' => ['lowercase', 'asciifolding'],
                'type' => 'custom'}
        }
    } do
      mapping dynamic: 'false' do
        indexes :id, type: 'long', index: :not_analyzed
        indexes :name, type: 'string', boost: 1, analyzer: 'snowball'
        indexes :city, type: 'string', boost: 10, analyzer: 'city_name'      
      end
    end

When I run in console

Model.import

In my meta data at http://localhost:9200/_plugin/head always map all fields and does not follow the rules as eg. city_name for field city. So when i run the code below, it works..Why?

Model.__elasticsearch__.create_index! force: true
Model.import
Model.__elasticsearch__.refresh_index!

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