Can we index only few fields in an OpenSearch document?

0

We have around 200 fields in an OpenSearch index but we run queries only on few columns, can we remove the unnecessary columns from indexing and keep only the necessary ones?

Sarath
asked a year ago283 views
1 Answer
0

Yes, you can use the "index" option controls to decide if fields are indexed. It accepts true or false with defaults being "true". Fields that are not indexed are typically not queryable. e.g:

PUT /<index-name>
{
  "mappings": {
    "properties": {
      "field1": {
        "type": "text",
        "index": false
      }
    }
  }
}
AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions