We replace the "flush" and "delete" by "delete" and "deletedocuments"
logic. This makes it more obvious what will happen, without reading the
docs.
Also we kept the logic to always provide the index name, as
we will need them in the future. Due to elasticsearch v6 changes no
types are allowed in the same index in the future. Therefore we need to
make it possible to use different indexes in the future, leading to the
need to provide the document type all the time.
With V6 of elasticsearch the meaning / handling of index and type has
changed, and it will change further in the future.
We therefore move code to own classes and adjust / refactor calling
code.
As some search services, like elasticsearch, allow generation of a
string that should be displayed in frontend, we provide a new getter for
that.
The old existing name can be a fallback in custom implementations.
As TypoScript does not provide a way to configure key less options, we
use a comma separated list and explode them to stay compatible with
elasticsearch.