What is the difference between a field and a property in Elasticsearch?

Note: This is an explanation from my current understanding. It may not be 100% accurate.

A property is what we used to call field in a RDBMS (a standard relationship db like MySQL). It stores properties of an object and provides the high-level structure for an index (which we can compare to a table in a relational DB).

A field, which is linked (or included) into the property concept, is a way to index that property using a specific analyzer.

So lets say you have:

  • One analyzer (A) to uppercase
  • One analyzer (B) to lowercase
  • One analyzer (C) to translate to Spanish (this doesn't even exist, just to give you an idea)

What an analyzer does is transform the input (the text on a property) into a series of tokens that will be indexed. When you do a search the same analyzer is used so the text is transformed into those tokens, it gives each one a score and then those tokens are used to grab documents from the index.

(A) Dog = DOG
(B) Dog = dog
(C) Dog = perro

To search using a specific field configuration you call it using a dot:

  • The text field uses the standard analyzer.
  • The text.english field uses the English analyzer.

So the fields basically allow you to perform searches using different token generation models.


Subfields are indexed from the parent property source. While sub-properties need to have a "real" value in the document's source.

If your source contains a real object, you need to create properties. Each property will correspond to a different value from your source.

If you only want to index the same value but with different analyzers then use subfields.

It is often useful to index the same field in different ways for different purposes. This is the purpose of multi-fields. For instance, a string field could be mapped as a text field for full-text search, and as a keyword field for sorting or aggregations:

(sorry I find its hard to explain =| )