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
gefragt vor einem Jahr292 Aufrufe
1 Antwort
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
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen