You can use query function for creating, updating, searching etc.
The index aliases API allows aliasing an index with a name, with all APIs automatically converting the alias name to the actual index name.
Display the aliases list
.. literalinclude:: aliases.php :language: php :linenos:
Searching with query function:
.. literalinclude:: searching.php :language: php :linenos: