ODBC guide

Search documents from alias


Runs a search on an alias (like a view over one or more indexes). Use the alias name in the FROM clause and pass the query in the WITH clause. For query syntax see the Elasticsearch query DSL documentation.

SELECT * FROM MyAliasName WITH(Query='{"match": { "comment" : "TV" } }')
		
		--or use search endpoint then you must supply both Index name and Alias name 
		--calling /search endpoint in FROM clause is slight faster (avoids table / alias list validation)
		--SELECT * FROM search WITH(Index='MyIndexName',Index='MyAliasName', Query='{"match": { "comment" : "TV" } }')