Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8703063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:47:42+00:00 2026-06-13T02:47:42+00:00

I want to add settings and mappings of a particular model from another module.

  • 0

I want to add settings and mappings of a particular model from another module. Is that possible? If yes please help me how this can be done. I tried this:

Article Model:

class Article < ActiveRecord::Base
  include SearchArticle
end

New module:

module SearchArticle

  include Tire::Model::Search
  settings :analyzer => {
            :custom_analyzer => {
              'tokenizer' => 'uax_url_email'
            }
    } do
    mapping do
      indexes :name, :boost => 10
      indexes :email, :analyzer => 'custom_analyzer', :boost => 10
    end
  end

end

But the index is not getting created. I’m getting the following error.

[2012-10-16 11:42:38,023][WARN ][cluster.metadata         ] [Inza] [search_article] failed to create
org.elasticsearch.index.mapper.MapperParsingException: mapping [search_article]
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:262)
at org.elasticsearch.cluster.service.InternalClusterService$2.run(InternalClusterService.java:208)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

Caused by: org.elasticsearch.index.mapper.MapperParsingException: Analyzer [custom_analyzer] not found for field [email]
at org.elasticsearch.index.mapper.core.TypeParsers.parseField(TypeParsers.java:76)
at org.elasticsearch.index.mapper.core.StringFieldMapper$TypeParser.parse(StringFieldMapper.java:124)
at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:261)
at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parse(ObjectMapper.java:217)
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:161)
at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:364)
at org.elasticsearch.index.mapper.MapperService.add(MapperService.java:186)
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:259)
... 4 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:47:43+00:00Added an answer on June 13, 2026 at 2:47 am

    Yes, that’s possible — but not the way I did in the question. Here goes the answer suggested by the Tire gem owner Karmi

    For complete answer please refer this

    module Searchable
    
      def self.included(base)
    
        p "Included in #{base}"
    
        base.class_eval do
          include Tire::Model::Search
    
          tire do
            mapping do
              indexes :title,   type: 'string', analyzer: 'snowball'
            end
          end
        end
      end
    end
    
    class Article < ActiveRecord::Base
      include Searchable
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want add my custom sidebar next right column all page. Please check this
I want to add a layout model to my website (a general settings file),
I want to add some settings to the Django admin interface. In particular I
I want to add a Settings Bundle to my application. This settings bundle should
I want to add custom attribute settings to a generated anchor link of Wordpress.
I want add new Feed item on entity persist and update. I write this
I have a list of string values that I want add to a hashtable
I have problem, when I want add Node to my GUI from other Thread.
I have numbers in javascript from 01(int) to 09(int) and I want add 1(int)
I want to ask for help. I need to write code that remotely connect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.