Skip to content

Doubt: Where to set the analyzer? #25

@mrcasals

Description

@mrcasals

Hi,

I'm moving from Tire to Elastictastic to work with an elasticsearch database and I'm having problems setting the analyzer I want to use. With Tire, I had to use the following:

@index.create :settings => {
  :index => {
    :analysis => {
      :analyzer => {
        :default => {
          type: "snowball",
          :language => 'Catalan'
        }
      }
    }
  }
}

I've tried to set it on the mapping, but it doesn't work:

class Product
  include Elastictastic::Document

  field :name, analyzer: {type: "snowball", language: "Catalan"}
  field :description, analyzer: {type: "snowball", language: "Catalan"}

end

I tried to set a default analyzer, but I could not find any reference to this on the README nor the code docs. I really need to set this analyzer, any idea on how to achive that?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions