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 8704951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:14:12+00:00 2026-06-13T03:14:12+00:00

I am still doing something wrong. Could somebody pls help me? I want to

  • 0

I am still doing something wrong.
Could somebody pls help me?
I want to create a custom analyzer with ascii filter in Rails + Mongoid.
I have a simple model product which has field name.

class Product
  include Mongoid::Document

  field :name

  settings analysis: {
      analyser: {
        ascii: {
          type: 'custom',
          tokenizer: 'whitespace',
          filter: ['lowercase','asciifolding']
        }
      }
   }

   mapping do
     indexes :name, analyzer: 'ascii'
   end

end

Product.create(name:"svíčka")
Product.search(q:"svíčka").count #1
Product.search(q:"svicka").count #0 can't find - expected 1

Product.create(name:"svicka")
Product.search(q:"svíčka").count #0 can't find - expected 1
Product.search(q:"svicka").count #1

And when I check the indexes with elasticsearch-head I expected that the index is stored without accents like this “svicka”, but the index looks like this “Svíčka”.

What am I doing wrong?

When I check it with API it looks OK:

curl -XGET 'localhost:9200/_analyze?tokenizer=whitespace&filters=asciifolding' -d 'svíčka'

{"tokens":[{"token":"svicka","start_offset":0,"end_offset":6,"type":"word","position":1}]}

http://localhost:9200/development_imango_products/_mapping
{"development_imango_products":{"product":{"properties":{"name":{"type":"string","analyzer":"ascii"}}}}}

curl -XGET 'localhost:9200/development_imango_products/_analyze?field=name' -d 'svíčka'
{"tokens":[{"token":"svicka","start_offset":0,"end_offset":6,"type":"word","position":1}]}
  • 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-13T03:14:13+00:00Added an answer on June 13, 2026 at 3:14 am

    You can check how you are actually indexing your document using the analyze api.

    You need also to take into account that there’s a difference between what you index and what you store. What you store is returned when you query, and it is exactly what you send to elasticsearch, while what you index determines what documents you get back while querying.

    Using the asciifolding is a good choice for you usecase, it should return results either query ing for svíčka or svicka. I guess there’s just a typo in your settings: analyser should be analyzer. Probably that analyzer is not being used as you’d expect.

    UPDATE
    Given your comment you didn’t solve the problem yet. Can you check what your mapping looks like (localhost:9200/index_name/_mapping)? The way you’re using the analyze api is not that useful since you’re manually providing the text analysis chain, but that doesn’t mean that chain is applied as you’d expect to your field. Better if you provide the name of the field like this:

    curl -XGET ‘localhost:9200/index_name/_analyze?field=field_name’ -d ‘svíčka’

    That way the analyze api will rely on the actual mapping for that field.

    UPDATE 2
    After you made sure that the mapping is correctly submitted and everything looks fine, I noticed you’re not specifying the field that you want to to query. If you don’t specify it you’re querying the _all special field, which contains by default all the field that you’re indexing, and uses by default the StandardAnalyzer. You should use the following query: name:svíčka.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm probably doing something wrong, being a newbie. Could you please help me out?
I'm sure that I'm doing something wrong, I have a Go program that parses
I try to understand the behavior of associations, but I am doing something wrong.
I'm still uncertain about how best to use Mocks when doing development from the
I' still newby to this so I'll try to explain what I'm doing. Basically
well I'm doing this homework but I'm still not viewing the fault... When I
Doing some homework here (second assignment, still extremely green...). The object is to read
Still learning JSP Web Applications here. I have been doing this for a while
Okay I've been doing JS merges for some time now and still can't figure
I've read several docs and I don't get it: I know I'm doing something

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.