Big mapping example?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Big mapping example?

Tarjei Huse
Hi, is there a lagre(ish) example of an indexmapping somewhere in the ES docs? I'm just starting to dip my toes into ES now.

I'm asking because it would be great to have a document like that to begin using ES - just like Solr has a large commented solrconfig.xml and schema.xml file that may be used as a startingpoint for setting it up.

Regards,
Tarjei


Reply | Threaded
Open this post in threaded view
|

Re: Big mapping example?

Vladimir Shkurin
Reply | Threaded
Open this post in threaded view
|

Svar: Re: Big mapping example?

Tarjei Huse
Great!

Thanks.

As I understand it, when you index a document in ES you can either define a fields properties (in the mapping) when creating the index, but also when you index the document, am I correct?

What happens if the two field definitions conflict?

Regards,
Tarjei
Reply | Threaded
Open this post in threaded view
|

Re: Svar: Re: Big mapping example?

Vladimir Shkurin
On the first your question.

1. You define the settings of the index (analyzers, filters,
tokenizers)
2. You define the mappings. Here you can specify many options, field
name, field type, use an index or not, what fields to use your
analyzers (index_analyzer, search_analyzer), see the documentation
"Mapping -> Types -> core".
3. Put your data, example:

{
    "tweet" {
        "user" : "kimchy"
        "message" : "This is a tweet!",
        "postDate" : "2009-11-15T14:12:12",
        "retweets" : 4,
    }
}

The search should work :)

On the second your question I don't know, I use ElasticSearch only the
third day :)
Reply | Threaded
Open this post in threaded view
|

Re: Svar: Re: Big mapping example?

Michael-7
I am  somehow I am getting these emails accidentally. Please delete me from this conversation. Thanks
Sent via BlackBerry by AT&T

-----Original Message-----
From: Vladimir Shkurin <[hidden email]>
Sender: [hidden email]
Date: Wed, 27 Jul 2011 07:03:22
To: elasticsearch<[hidden email]>
Reply-To: [hidden email]
Subject: Re: Svar: Re: Big mapping example?

On the first your question.

1. You define the settings of the index (analyzers, filters,
tokenizers)
2. You define the mappings. Here you can specify many options, field
name, field type, use an index or not, what fields to use your
analyzers (index_analyzer, search_analyzer), see the documentation
"Mapping -> Types -> core".
3. Put your data, example:

{
    "tweet" {
        "user" : "kimchy"
        "message" : "This is a tweet!",
        "postDate" : "2009-11-15T14:12:12",
        "retweets" : 4,
    }
}

The search should work :)

On the second your question I don't know, I use ElasticSearch only the
third day :)
Reply | Threaded
Open this post in threaded view
|

Re: Svar: Re: Big mapping example?

kimchy
Administrator
In reply to this post by Tarjei Huse
Mappings can be explicitly defined when you create an index, or use the put mapping API. If you don't specify it, then automatic mappings will be created based on the field indexed (for example, if its a number, then it will be indexed as one).

On Wed, Jul 27, 2011 at 4:01 PM, Tarjei Huse <[hidden email]> wrote:
Great!

Thanks.

As I understand it, when you index a document in ES you can either define a fields properties (in the mapping) when creating the index, but also when you index the document, am I correct?

What happens if the two field definitions conflict?

Regards,
Tarjei