Im new to elastic search.
In my users
type in profiles
index i have fields
properties : {
name : {type : string},
picture : {
url_small : {}
url_big : {}
}
}
In this index picture
is just for storing/getting data and will never be used in doing any query but only will be retrieved with matched hits.
So how to create the mapping of picture
? What type
, analyzer
,fields should i use ?
You are dealing with two things here:
To define how the data will be stored, you use type
.
To define how the data will be indexed (directly, after being analyzed, or, in your case, not indexed), you use index
.
And if you want to define how the data is analyzed for the indexing, you have to use analyzer
.
You want to store string, but not to index them, so you use:
{
type: string,
index: no
}
Which gives you:
properties : {
name : {"type": "string"},
picture : {
url_small : {
"type": "string",
"index": "no"
},
url_big : {
"type": "string",
"index": "no"
}
}
}
https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-index.html
Hope it's clear
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.