Indexing and Storing some fields


(ajasuja18) #1

Hey,

I have a json document having 50 properties.
Each property has name-value pair.

Out of 50 Properties, I want to :
1). Index 10 fields i.e. name-values
2) Store 20 fields (including 10 indexed above)
3). Dont want to store and index rest of the fields.

Can someone help me how to define the mapping for this?

Thanks in advance.


(David Pilato) #2

Hi,

Did you look at http://www.elasticsearch.org/guide/reference/mapping/core-types.html ?
It should answer.

{
"tweet" : {
"properties" : {
"message" : {
"type" : "string",
"store" : "yes",
"index" : "analyzed",
"null_value" : "na"
}
}
}
}
You have to play with index and store options.

HTH
David

--

Le 2 août 2012 à 02:38, ajasuja jasuja.ankit@gmail.com a écrit :

Hey,

I have a json document having 50 properties.
Each property has name-value pair.

Out of 50 Properties, I want to :
1). Index 10 fields i.e. name-values
2) Store 20 fields (including 10 indexed above)
3). Dont want to store and index rest of the fields.

Can someone help me how to define the mapping for this?

Thanks in advance.


(system) #3