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

  • Home
  • SEARCH
  • 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 7639707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:29:18+00:00 2026-05-31T08:29:18+00:00

I have been experimenting with elasticsearch lately with ruby on rails. I am having

  • 0

I have been experimenting with elasticsearch lately with ruby on rails. I am having trouble getting my data indexed so I can search for items with both plural, and non-plural keywords.

Tire will allow me to assign an analyzer per mapping attribute:

mapping do
  indexes title, analyzer: 'snowball'
  indexes body, analyzer: 'snowball'
end

Now, say I have a keyword in the title of ‘tests’

if I do a search with the attribute in the query:
http://localhost:9200/myindex/mymapping/_search?q=title:test
It will work.

However, if I do a general search without specifying the attribute like so:
http://localhost:9200/myindex/mymapping/_search?q=test

It will not find the document.

How do I specify that I want the default analyzer to be ‘snowball’ so I don’t have to specify the attribute I want to search on?

p.s. I am using the Tire Gem. So please answer as best as you can taking that into account.

  • 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-05-31T08:29:20+00:00Added an answer on May 31, 2026 at 8:29 am

    It’s possible to change default analyzer using index settings:

    require 'rubygems'
    require 'tire'
    
    Tire.index 'articles' do
      delete
      create :settings => {
          :index => {
            :analysis => {
              :analyzer => {
                :default => {
                  :type => 'snowball'
                }
              }
            }
          }
        },
        :mappings => {
          :article => {
            :properties => {
              :title    => { :type => 'string', :analyzer => 'snowball'},
              :body     => { :type => 'string', :analyzer => 'snowball'}
            }
          }
        }
    
      store :title => 'Tests', :body => "Plural"
      store :title => 'Test', :body => "Singular"
    
      refresh
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been experimenting with LOAD DATA INFILE and there are a couple things
I have been experimenting with ways to read data from a SQL server as
I have been experimenting with geography datatype lately and just love it. But I
I have been experimenting with Manifests and such in Scala, and I am having
I have been experimenting with RDB design lately, and I was wondering about storing
We have been experimenting with using data visualisation techniques inspired by Edward Tufte to
I have been experimenting with woopra.com A web analytics tool. Which requires a piece
I have been experimenting with WPF and rendering strict XAML markup in a web
I have been experimenting with Lambda expressions in Oxygene. Very simple recursive lambda expression
I have been experimenting with a lot of web development apps like Drupal, Moodle,

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.