Using an Index
Indexes are created implicitly when an upsert operation is performed, so there is no specific endpoint for creating an index. For example, the code snippet below will create the indexfoo
if it does not already exist,
upsert and search the document only on that index.