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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:05:43+00:00 2026-06-05T01:05:43+00:00

Sorry, I’m new to ElasticSearch. http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html This document says you can creates a mapping

  • 0

Sorry, I’m new to ElasticSearch.

http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html

This document says you can “creates a mapping called tweet within the twitter index”

$ curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '
{
    "tweet" : {
        "properties" : {
            "message" : {"type" : "string", "store" : "yes"}
        }
    }
}
'

As someone told me on ES IRC channel, /twitter/tweet twitter=index, tweet=type

But what happens if I do the following?

$ curl -XPUT 'http://localhost:9200/twitter/XXX/_mapping' -d '
{
    "YYY" : {
        "properties" : {
            "message" : {"type" : "string", "store" : "yes"}
        }
    }
}
'

If I already provided the type name in the url, why should i still provide a type name in the content?
If I provide the type name in the content, why can’t I just call some url like:

$ curl -XPUT 'http://localhost:9200/twitter/_mapping' -d '

While reading the doc, for me it says “creates a mapping called tweet within the twitter index”, this means XXX is the mapping name and YYY is the type name.

Thus if there is a mapping name, there can normally be many “mappings” for an index

So, in the end, XXX and YYY are/should be the same?


It’s not what i understand from the doc, but what I think is:
– One index can have types
– Types have a mapping
Thus we don’t create a mapping like the documentation says, but we create a type, that has a mapping, or we update the type’s mapping no?

And on an index where I don’t want to use any type (all documents indexed are the same kind of data), but I want to create a mapping for that index, am I supposed to handle that by creating only one type with its mapping, and always use that type (in the CouchDB river for example)?

Thanks

  • 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-05T01:05:45+00:00Added an answer on June 5, 2026 at 1:05 am

    In the current version of elasticsearch search (0.19.4) “YYY” is ignored and mapping is assigned to the “XXX” type.

    Indeed, you can think of creating mappings as creating types. Internally, types are represented in terms of mappings and documentation just reflects this behavior. If all your records have the same type, you should treat the index as an index with only one type. Type is used to “namespace” records of different types and therefore it’s mandatory. An id itself doesn’t uniquely identify a record. To identify a record in elasticsearch, you need to have index, type and id. This is why type is a required paramater for the get operation, for example. For other operations, if type is not specified, elasticsearch assumes that you want to perform the operation with records of all types.

    Note, that types can also be created dynamically at any time by adding a record of a new type. So, an index with only one type is an index that doesn’t have the second type yet.

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

Sidebar

Related Questions

sorry for the lame question but with HTTP handler it is easy to do
sorry, I am pretty new in WPF and I think it's pretty easy, but
Sorry, guys.I am quite new in mysql but I do need help from getting
Sorry for the long question, but there's a Jon Skeet reference, so it may
Sorry for real stupid question. But it does not work either way. <html> <head>
Sorry I'm new here and my code will probably not be properly displayed... how
Sorry if this is stupid question, but I'm new to MATLAB. I have a
Sorry about the non-descriptive title; Had no Idea how to put it. So when
Sorry this is basic, but I'm new to Python and Django. I have a
Sorry, I'm new to SVN and I looked around a little for this. How

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.