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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:36:13+00:00 2026-06-17T04:36:13+00:00

This might be something really peculiar I’m trying to do. I’m running a river

  • 0

This might be something really peculiar I’m trying to do. I’m running a “river” to dynamically index all data in my couchdb.
As multiple users enter data into the system, sometimes there is a conflict in mapping (MapperParser Error). For example:

  • userA adds the following data – {"tweet" : {"fooval" : "1"}}
    — elasticSearch creates a Mapping for this tweet.fooval variable as Number (as it interprets it as a number)
  • userB adds the following data – {"tweet" : {"fooval" : "false"}}
    — elasticSearch tries to create a Mapping for this tweet.fooval variable as Boolean (as it interprets it as a Boolean) and hence a MapperParser Error.

I guess you see the problem. Also I only want to do it at the level of scalar types, as I don’t want Arrays/Objects to be treated as strings. I want all scalar types to be treated as Strings while the mapping is being created.

I couldn’t find anything on the doc page, or on the forum, so thought will ask here for directions/pointers.

  • 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-17T04:36:15+00:00Added an answer on June 17, 2026 at 4:36 am

    First of all, by default, elasticsearch is not parsing strings. So, if you will pass to elasticsearch the following JSON: {"tweet": {"fooval": "1"}} it will treat tweet.fooval as a string. If elaticsearch is parsing strings, make sure that numeric_detection and date_detection are set to false in the mapping.

    On the other side, if elasticsearch receives a value as a JSON number like this: {"tweet": {"fooval": 1}}, elasticsearch will indeed map such field as long or double. You can override this behavior by using dynamic_templates. Here is an example:

    curl -XPUT localhost:9200/test-idx -d '{
        "settings": {
            "index.number_of_replicas": 0,
            "index.number_of_shards": 1
        },
        "mappings": {
            "doc": {
                "dynamic_templates" : [
                    {
                        "template_obj" : {
                            "match" : "*",
                            "match_mapping_type" : "object",
                            "mapping" : {
                                "type" : "object"
                            }
                        }
                    },
                    {
                        "template_str" : {
                            "match" : "*",
                            "mapping" : {
                                "type" : "string"
                            }
                        }
                    }            
                ]
            }
        }
    }'
    curl -XPUT localhost:9200/test-idx/doc/1 -d '{
        "count": 123,
        "sold": false,
        "date": "2009-11-15T14:12:12",
        "price": 12.3,
        "description": {
            "weight":  42.3,
            "size": {
                "lenght": 30,
                "width": 20,
                "hight": 10
            }
        }
    }'
    echo
    curl "localhost:9200/test-idx/doc/_mapping?pretty=true"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be something very straight forward and I really think it should work
This might sound like a stupid question but just trying to learn something here.
hey guys, this might be really stupid, but hopefully someone can help. I'm trying
This might be something silly really, but I can't get it to work at
I'm not a web guy, so this might be something really simple I'm missing,
I am just learning jquery, so this might be something easy. I am trying
I know this might sound as really dummy question, but I'm trying to ensure
EDIT 1 I do not exclude at all this might be caused by something
I might be missing something really obvious. I'm trying to write a custom Panel
I may be missing something here because I thought this might be really easy

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.