In Chapter 3, Document APIs, we introduced the Update by Query API for documents and also for static mappings. If static mapping is used, any fields not specified in the mappings will not be indexed and searchable; however, they are stored in _source. If we need to search for a non-mapping field later, we only need to update the static mappings to make the indexed documents take effect of the changes. No document reindexing step is required. Assume that the original mappings for our sample documents do not have the exchange field, that the document has been indexed, and that we now want it to be searchable:
- First, we need to update the mapping, as shown in the following screenshot:
- The next step is to issue an Update by Query request to take the static mapping changes into effect, as shown in the following screenshot:
In the...