new to Elasticsearch. I see by default, ES creates indexes for every word in every field. But in my use-case, I will be searching only two fields, so am thinking to tell ES somehow that dont create index for everything in the document, but create indexes only the fields I specify in the mapping.
SO here is my mapping
PUT /benefits
{
"mappings": {
"benefit": {
"_all": {"enabled": false},
"properties": {
"subCategory": {"type": "text"},
"description": {"type": "text"}
}
}
}
}
and my document looks like this
{
"bpi" : "123456",
"category" : "CAT1",
"subCategory" : "Primary Care Physician Copay",
"planName" : "MyPlan HMO Individual",
"description" : "0 per office visit for Convenient Care & Minute Clinics Complete ABC Document",
"categoryId" : 200.0,
"desktop360Id" : 1001.0,
"createTimeStamp" : "2017-02-21T22:00:12.000Z"
}
So I will be searching only on "subCategory"
and "description"
(not on "planName"
or any other fields text) and created the index/mapping as shown in mapping above, but I am still able to search text on other fields as well. for example if I search "MyPlan" from "planName"
field, the search works and brings up this document. Does it mean it created index for all the words (except those 'a', 'of' types) on all the fields? I ask this question because, I don't want to spend the memory on the indexes that I don't need.
Any suggestions?