I understand from the documentation that for every document created in elasticsearch (ES), ES creates an index using TF-IDF or BM25 algorithm.
Will inverted index will be created only for the text data type field or all data type. If inverted text created only for text data type how other fields are stored internally in ES?
so, the algorithms you mentioned are used for scoring, meaning the decision how relevant a document is compared to a query.
Apache Lucene (the underlying full text search library) has a couple of different data structures, that it uses internally to store different datatypes. Text is stored in an inverted index, range datatypes, number or geoshapes are stored in a block KD tree for example. By configuring the mapping of an Elasticsearch index, Elasticsearch internally decides what data structure to use for which field.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.