ElasticSearch Connector
Documentation
Version: 3
Documentation

ElasticSearch Connector - Source Code


<ApiConfig Name="ElasticSearch"
           Slug="elasticsearch-connector"
           Id="1e2e2142-9282-45d2-ac10-e0d5b61d1caa"
           Version="3"
           EngineVersion="14"
           Desc="Read / write ElasticSearch data inside your app; perform many ElasticSearch operations without coding, just use easy to use high performance API Connector for ElasticSearch"
           Logo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABjCAYAAABt56XsAAAJk2lDQ1BERUxMIFVQMzIxNlEgQ29sb3IgUHJvZmlsZSwgRDY1MDAAAHicnZZ3UFTJFof73js5AMMMQ4YhDTnDMIDkOATJUVRwyJkhipgQcQUURUQElAURCQom4ioioBhYFBRQMQyyCCjr4iqigvJgfVXuq31Vr+r9qrrPV6dP1znd/UcfAAiWVrbWdrAQAHHxKTxPB2uGf0AgA/sCoAEdCAAmoIRwkxNdvey9waps7VxcwD/0cRRAa/aB5to6Cd+rNMdIeQdw+2xuhVUe+Gf8f4gQGpbMXbXLqyOHm8hLAQDatcrs9JTENW5fZRpvtahVHljjiO/MX+Mt3/nDXzHenjYAwDgAcKSIv/GWvzE3MiR0NSVtNV7j33nXpLZWN8PHXV9Pl+XBsEmITeAx3HkJ4VGxYRoMW5ahjs7/OMT/q5SwjJQ1a5OQuJUXFRGZwlDhqjL0dHQNGbZhsbEMTjxX67/tW3uj7/Tj7n/4TrMA8FktGdv1w6cVAEDFZQAodT98CvYACEgB0NHPTeWlffeh1iY0IABBQAPiQAYoABWgCfSAETAFlsAOOAE34A0CwCbABZEgDvBAOsgCu0EuyAeHwFFQBipBDagHTeAiaANXwHVwE9wF98EIGAd8MAXegHnwESxBEISFyBAVEodkISVIHdKD2JA5ZAe5QJ5QABQMRUDxUCqUBe2B8qEiqAyqguqhC1AHdB26DQ1Bj6EJaBb6E/oCIzAJpsHSMBPWhtmwFewMe8Mb4Qg4Cc6Ec+CDcClcDZ+FW+Hr8F14BObDb+AFBCBEhI7IIZoIG7FB3JBA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dDL2tizdms6OsMQAyLvAkdzBXJeuZkTxu6X5hrpf40vIMR1RfnLsD1m9fizcY6NT9kOBxHn8h+Vkj9eGIFbppySHSZEj+FQ/HSE9pm4/K76PwM91eE+ZXIedBzPnS9ObyZmOPHfRnp/gC6IbM12c89FPO4OOmHXTGyliBXXXhi9nz8cXelmp7ASpWhqoqnFcWypKniZ9xSMRNnFI6LPmWt8DfRf9KIyYx3Qkyis0LNTTQJCGuq4vYt4qGhAISS4ifQs4rMJ6t2Z9zoqklTsbigGPfu3II3ZLTQ6qFuSUZNFzOWvQJEgcOB740rww9lZBizgSFiz+Y3fGOqABHqCvGw0VDOdPwl9MpuirFIpSNzEI+Isv+0tRmP1VThX831aOrt1QuZLXqNbCzwhH0K1oTx/AmpaWq2Led8lKf1u6jxo9A7Slz5ieGmoZ56ylpgLu7Iz12YPKj5OXmKd/d0459NdXi3qR4bxG9pFHDY0xVZzI4zg4IEgtNRWNRdIiDMFcPhVBl1x+cWItfRby6cleVctPiRIXi/pNNwzAVmEJKTfrhoMJW9yZAvS0vHkgmTFTf2erCjuwvbujtR7e5RSzT1iJXEVUudFquKQRU7XZgkv6lIz5SRkL7/Imd9RFSfF+YafZVD+H5JpeGanE2FSPPwRehfXuB3SfKjTypwpCrebyGZ+IhJDU6f4Eqf//qSc0ccDffaq/zkHnModMjOg/49Kya5kuE1UlEzafa48MdJuN5BoYO1bDS/PMMFhOlEclVtrjt/HPT1H7k4LsvRB/IiKYroHdOK2wU9ZMGRQBCah/Khh4MO9jretOlXhpjEqB8/DX4sdKD4ZWoCRHDoAxBIRlM/hQ4A9VNcKdKRTv8HxmS8fy7cs9AAAAAASUVORK5CYII="
           >

  <VersionHistory>
	<Change Date="2023-11-01" Type="New">Added support for password-less windows authentication (Use only if server supports it)</Change>	
	<Change Date="2023-09-10" Type="New">Added support for Alias (List/Read/Write)</Change>	
	<Change Date="2023-08-10" Type="New">Added IgnoreSSLCertificateErrors Property to support self-signed certificates (Ignore not trusted error)</Change>	
	<Change Date="2023-08-10" Type="New">Added two new endpoints (create_index, delete_index)</Change>
	<Change Date="2023-08-10" Type="Fix">Fixed pagination issue</Change>
    <Change Date="2021-12-08">Initial version</Change>
  </VersionHistory>
 <ServiceUrls>
    <ServiceUrl Name="Default" Url="http://localhost:9200" />
  </ServiceUrls>
  <Auths>
    <Auth Name="HTTP" Type="HTTP" Label="Basic Authentication (UserId/Password)" ConnStr="UserName=[$UserName$];Password=[$Password$]" TestEndPoint="list_indexes">
      <Notes>
        <![CDATA[]]>
      </Notes>
      <Params>    
        <Param Name="UserName" />    
        <Param Name="Password" Secret="true" />   
		<Param Name="IgnoreSSLCertificateErrors" Options=";True;False" />  				 	
      </Params>
    </Auth>
	<Auth Name="WinAuth" Type="HTTP" Label="Windows Authentication (No Password)" ConnStr="CredentialType=Windows;" TestEndPoint="list_indexes" >
      <Params>    
		<Param Name="IgnoreSSLCertificateErrors" Options=";True;False" />  				 	
      </Params>	
    </Auth>
  </Auths>


  <Template>
	<EndPoint>
		<Params>
			<Param Name="IgnoreSSLCertificateErrors" Type="Property" Options=";True;False" Desc="Set this option to True if you are getting Certificate Not Trusted error and you like to continue regardless (Only do it if you trust the remote server). This usually happens when Self-Signed certificate is used on ElasticSearch Instance and you did not trust that certificate on this machine" /> 
		</Params>
	</EndPoint> 
    <EndPoint Name="SearchWithPagination"
	            Url="/[$Index$]/_search" Method="POST" ContentType="application/json" Filter="$.hits.hits[*]"
              Body="{ &quot;from&quot;: {$$page_num$$}, &quot;size&quot;: [$PagingIncrementBy$], &quot;query&quot;: [$Query$] }"
              IncludeParentColumns="True"
              >
      <Params>
        <Param Name="Index" Type="Placeholder" Required="True" OptionsEndPoint="list_indexes" OptionsEndPointValueColumn="Name" />
        <Param Name="Query" Label="Enter Query (JSON Format)"
               Value="{&quot;match_all&quot;: { }  }"
               HelpLink="https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html"
               Options="All Records={&quot;match_all&quot;: { }  };Record where comment or name contains TV word={&quot;query_string&quot;: {&quot;query&quot;: &quot;comment:TV OR name:TV&quot;}  };Record with comment field (attribute exists)={&quot;query_string&quot;: {&quot;query&quot;: &quot;_exists_:comment&quot;}  }"
        />

        <Param Name="PagingMode" Value="ByPostData" Type="Property" />
        <Param Name="PagingByUrlAttributeName" Value="{$$page_num$$}" Type="Property" />
        <Param Name="PagingIncrementBy" Type="Property" Label="Records per page" Value="1000"/>
      </Params>
      <OutputColumns>
        <Column Name="_id" Label="_id" DataType="DT_WSTR" />
        <Column Name="_score" Label="_score"  DataType="DT_R8"/>
        <Column Name="_source.[$parent.Pivot_Path$]"
                Label="[$parent.Pivot_Path$]"
                Expand="True"
                DataEndPoint="get_index_metadata"
                DataEndPointParameters="Index=[$Index$]"
                ColumnInfoMap="Name=Pivot_Path;"
                DataTypeMap="DT_WSTR=text;DT_I8=long"
                />
      </OutputColumns>
    </EndPoint>
    
    <EndPoint Name="ScrollWithPagination"
	            Url="/[$tag$]" Method="POST" ContentType="application/json" Filter="$.hits.hits[*]"
              Body="[$tag$]"
              Body1="{ &quot;from&quot;: {$$page_num$$}, &quot;size&quot;: [$PagingIncrementBy$], &quot;query&quot;: {  &quot;query_string&quot;: {&quot;query&quot;: &quot;[$Query$]&quot;}  } }"
              IncludeParentColumns="True"
              >
      <Params>
        
        <Param Name="Index" Label="Index" Type="Placeholder" Required="True" OptionsEndPoint="list_indexes" OptionsEndPointValueColumn="Name" />
		<Param Name="Alias" Label="Alias" Type="Placeholder" OptionsEndPoint="list_aliases" OptionsEndPointValueColumn="Name" />
        <Param Name="Query" Label="Enter Query (JSON Format)"
               Value="{&quot;match_all&quot;: { }  }"
               HelpLink="https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html"
               Options="All Records={&quot;match_all&quot;: { }  };Record where comment or name contains TV word={&quot;query_string&quot;: {&quot;query&quot;: &quot;comment:TV OR name:TV&quot;}  };Record with comment field (attribute exists)={&quot;query_string&quot;: {&quot;query&quot;: &quot;_exists_:comment&quot;}  }"
        />
        
        <Param Name="CursorTimeout" Value="10" Options="1;2;5;10;60;180;" Hidden="True" Label="CursorTimeout (Minutes)" Desc="Enter this value carefully. Do not enter very long timeout else it will hold cursor longer on server memory space"  />
        <Param Name="PageSize" Value="1000" Hidden="True" Label="How many Record to fetch per request" Desc="Do not enter very large number or too small number to avoid performance issues." />

        <Param Name="NextUrlAttributeOrExpr" Type="Property" Value="$._scroll_id" />
        <Param Name="StopIndicatorAttributeOrExpr" Type="Property" Value="$.hits.hits[0]._id" />
        <Param Name="NextUrlEndIndicator" Type="Property" Value="regex=^$" Desc="Stop pagination when blank value detected for _id."/>
        <Param Name="EnablePageTokenForBody" Type="Property" Value="True" />
        <Param Name="HasDifferentNextPageInfo" Type="Property" Value="True" />
        <Param Name="PagePlaceholders" Type="Property" Value="{}" ValueTemplate="url=&lt;&lt;[$Alias$]|~|[$Index$]|~|$1,FUN_IF_NULL_OR_EMPTY&gt;&gt;/_search?scroll=[$CursorTimeout$]m|_search/scroll" />
        <Param Name="FirstPageBodyPart" Type="Property" Value="{}" ValueTemplate="{ &quot;size&quot;: [$PageSize$],  &quot;query&quot;: [$Query$] }" />
        <Param Name="NextPageBodyPart" Type="Property" Value="{}" ValueTemplate="{  &quot;scroll&quot; : &quot;[$CursorTimeout$]m&quot;, &quot;scroll_id&quot;: &quot;[$pagetoken$]&quot; }" />
        
        
      </Params>
      <OutputColumns>
        <Column Name="_id" Label="_id" DataType="DT_WSTR" />
        <Column Name="_score" Label="_score"  DataType="DT_R8"/>
        <Column Name="_source.[$parent.Pivot_Path$]"
                Label="[$parent.Pivot_Path$]"
                Expand="True"
                DataEndPoint="get_index_metadata"
                DataEndPointParameters="Index=[$Index$];Alias=[$Alias$]"
                ColumnInfoMap="Name=Pivot_Path;"
                DataTypeMap="DT_WSTR=text;DT_I8=long"
                />
      </OutputColumns>
    </EndPoint>    
  </Template>

  <EndPoints>
    <!--=====================================
        =========== CREATE INDEX ============
        =====================================-->  
    <EndPoint Name="create_index" Label="Create Index" Desc="Create a new index"
	            Url="/[$Name$]" Method="PUT" ContentType="application/json" 
              >
	  <Params>
		<Param Name="Name" Label="New Index Name" Required="True"/>
		<Param Name="ContineOnErrorForStatusCode" Type="Property" Value="True" />
		<Param Name="ErrorStatusCodeToMatchRegex" Type="Property" Value="400" />
		<Param Name="ConsumeResponseOnError" Type="Property" Value="True" />
	  </Params>
      <OutputColumns>
        <Column Name="acknowledged" Label="Acknowledged" DataType="DT_BOOL" />    
        <Column Name="acknowledged" Label="Name" DataType="DT_WSTR" Length="255" ValueTemplate="[$Name$]"/> 		
        <Column Name="shards_acknowledged" Label="ShardsAcknowledged" DataType="DT_BOOL" />      
        <Column Name="index" Label="Index" DataType="DT_WSTR" Length="150"/>      
      </OutputColumns>
    </EndPoint>    
    <!--=====================================
        =========== DELETE INDEX ============
        =====================================-->  
    <EndPoint Name="delete_index" Label="Delete Index" Desc="Delete an exising index"
	            Url="/[$Name$]" Method="DELETE" ContentType="application/json" 
              >
	  <Params>
		<Param Name="Name" Label="Index to delete" Required="True" OptionsEndPoint="list_indexes" OptionsEndPointValueColumn="Name" />
		<Param Name="ContineOn404Error" Type="Property" Value="True" />
		<Param Name="ConsumeResponseOnError" Type="Property" Value="True" />
	  </Params>			  
      <OutputColumns>
        <Column Name="acknowledged" Label="Acknowledged" DataType="DT_BOOL" />      
		<Column Name="acknowledged" Label="Name" DataType="DT_WSTR" Length="255" ValueTemplate="[$Name$]"/>  
        <Column Name="status" Label="ErrorStatus" DataType="DT_I4" />      
        <Column Name="error.reason" Label="ErrorReason" DataType="DT_WSTR" Length="1000"/>      
		<Column Name="error.type" Label="ErrorType" DataType="DT_WSTR" Length="255"/>      
		<Column Name="error.resource.id" Label="ErrorId" DataType="DT_WSTR" Length="255"/>  
		<Column Name="error.index" Label="ErrorIndex" DataType="DT_WSTR" Length="255"/>  
      </OutputColumns>
    </EndPoint>    	
	
    <!--=====================================
        =========== LIST INDEXES ============
        =====================================-->  
    <EndPoint Name="list_indexes" Label="List indexes" Desc="Lists indexes"
	            Url="/_cat/indices?format=json&amp;pretty" Method="GET" ContentType="application/json" Filter="$"
              >
      <OutputColumns>
        <Column Name="index" Label="Name" DataType="DT_WSTR" Length="4000"/>      
        <Column Name="uuid" Label="Uuid" DataType="DT_WSTR" Length="50"/>      
        <Column Name="status" Label="Status" DataType="DT_WSTR" Length="50"/>      
        <Column Name="health" Label="Health" DataType="DT_WSTR" Length="50"/>      
        <Column Name="pri" Label="Pri" DataType="DT_I4"/>      
        <Column Name="pri" Label="Rep" DataType="DT_I4"/>      
        <Column Name="docs.count" Label="DocsCount" DataType="DT_I4"/>      
        <Column Name="docs.deleted" Label="DocsDeleted" DataType="DT_I4"/>      
        <Column Name="store.size" Label="StoreSize" DataType="DT_WSTR" Length="50"/>      
        <Column Name="pri.store.size" Label="PriStoreSize" DataType="DT_WSTR" Length="50"/>      
      </OutputColumns>
    </EndPoint>

    <!--=====================================
        =========== LIST ALIASES ============
        =====================================-->  
    <EndPoint Name="list_aliases" Label="List aliases" Desc="Lists aliases"
	            IncludeParentColumns="True" Url="/_aliases?format=json&amp;pretty" Method="GET" Filter="$..aliases"
              >
      <Params>
        <Param Name="EnableCustomReplace" Type="Property" Value="True" />
        <Param Name="SearchFor" Type="Property" Value="&quot;(\w+(?&lt;!aliases))&quot;\s*:\s*\{\s*\}--regex" />
        <Param Name="ReplaceWith" Type="Property" Value="&quot;$1&quot;: {fake:1}" />
        <Param Name="EnablePivot" Type="Property" Value="True" />
		<Param Name="IncludePivotPath" Type="Property" Value="True" />
		<Param Name="EnablePivotPathSearchReplace" Type="Property" Value="True" />
		<Param Name="PivotPathSearchFor" Type="Property" Value="(.*?).aliases.(.*)--regex" />
		<Param Name="PivotPathReplaceWith" Type="Property" Value="$1" />
		
      </Params>	  			
      <OutputColumns>
        <Column Name="Pivot_Name" Label="Name" DataType="DT_WSTR" Length="500"/>     
		<Column Name="Pivot_Path" Label="Index" DataType="DT_WSTR" Length="500"/>     
      </OutputColumns>
    </EndPoint>    

   
    <!--=====================================
        ======== GET INDEX METADATA =========
        =====================================-->  
    <EndPoint Name="get_index_metadata" Label="Get index metadata" Desc="Gets index metadata"
	            Url="/&lt;&lt;[$Alias$]|~|[$Index$]|~|$1,FUN_IF_NULL_OR_EMPTY&gt;&gt;/_mappings" Method="GET" ContentType="application/json" IncludeParentColumns="True"
              Filter="$..properties" >
      <Params>
        <Param Name="Index" Type="Placeholder" Required="True" OptionsEndPoint="list_indexes" OptionsEndPointValueColumn="Name" Desc="Enter index name. If you set alias then select underlying alias Index here."  />
        <Param Name="Alias" Type="Placeholder" OptionsEndPoint="list_aliases" OptionsEndPointValueColumn="Name" />		
        <Param Name="EnablePivot" Type="Property" Value="True" />
        <Param Name="IncludePivotPath" Type="Property" Value="True" />
        <Param Name="EnablePivotPathSearchReplace" Type="Property" Value="True" />
        <Param Name="PivotPathSearchFor" Type="Property" Value="-" ValueTemplate="^[$Alias$].mappings.|^[$Index$].mappings.|properties.--regex" />
        <Param Name="PivotPathReplaceWith" Type="Property" Value="" />
      </Params>
      <OutputColumns>
        <Column Name="Pivot_Path" Label="Path" DataType="DT_WSTR" Length="4000"/>
        <Column Name="Pivot_Name" Label="Name" DataType="DT_WSTR" Length="4000"/>
        <Column Name="Pivot_Value.type" Label="Type" DataType="DT_WSTR" Length="4000"/>      
        <Column Name="Pivot_Value.fields.keyword.ignore_above" Label="Length" DataType="DT_I4" />      
      </OutputColumns>
    </EndPoint>    

    <!--=====================================
        ========== GET DOCUMENTS ============
        =====================================-->  
    <EndPoint Name="get_documents" Label="Get documents from Index or Alias" Desc="Gets documents from Index or Alias"
	            Template="ScrollWithPagination" HelpLink="https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html"
              >
    </EndPoint>
    <!--=====================================
        ========== GET DOCUMENT BY ID ============
        =====================================-->  

    <EndPoint Name="get_document" Label="Get document by ID from Index or Alias"
                  Url="/&lt;&lt;[$Alias$]|~|[$Index$]|~|$1,FUN_IF_NULL_OR_EMPTY&gt;&gt;/_doc/[$Id$]" Method="GET" ContentType="application/json" Filter=""
                  Body="{ &quot;query&quot;: [$Query$] }"
                  IncludeParentColumns="True"
              >
      <Params>
        <Param Name="Index" Type="Placeholder" Desc="Enter index name. If you set alias then select underlying alias Index here." Required="True" OptionsEndPoint="list_indexes" OptionsEndPointValueColumn="Name" />
		<Param Name="Alias" Type="Placeholder" OptionsEndPoint="list_aliases" OptionsEndPointValueColumn="Name" />
        <Param Name="Id" Label="Enter Document ID"
                       Value="" Required="True" IsKey="True" ReadAs="_id"
               />
      </Params>
      <OutputColumns>
        <Column Name="_id" Label="_id" DataType="DT_WSTR" />
        <Column Name="_score" Label="_score"  DataType="DT_R8"/>
        <Column Name="_source.[$parent.Pivot_Path$]"
                Label="[$parent.Pivot_Path$]"
                Expand="True"
                DataEndPoint="get_index_metadata"
                DataEndPointParameters="Index=[$Index$]"
                ColumnInfoMap="Name=Pivot_Path;"
                DataTypeMap="DT_WSTR=text;DT_I8=long"
                />
      </OutputColumns>
    </EndPoint>    
    
    <!--=====================================
        ============== SEARCH ===============
        =====================================-->  
    <EndPoint Name="search" Label="Search / Query documents" Desc="Gets documents (Using JSON Query Language)"
                 Template="ScrollWithPagination" HelpLink="https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html"
              >
    </EndPoint>

    <!--=====================================
        ========== COUNT DOCUMENTS ============
        =====================================-->

    <EndPoint Name="count" Label="Count documents"
                  Url="/[$Index$]/_count" Method="POST" ContentType="application/json"
                  Body="{ &quot;query&quot;: [$Query$] }"
                  IncludeParentColumns="True"
              >
      <Params>
        <Param Name="Index" MultiSelect="True" MultiSelectSeparator="," Label="Index or Alias Name (choose one --OR-- enter * --OR-- comma seperated names)" 
			Desc="You can enter index name(s) for which you like to perform document count. Enter * (asterisk) to perform search across all indices or comma seperate list (i.e. myidx1,myidx2) or select one from the populated list." 
			Type="Placeholder" Required="True"  OptionsEndPoint="list_indexes" OptionsEndPointValueColumn="Name" />
		
		<Param Name="Query" Label="Enter Query (JSON Format)" Required="True"
               Value="{&quot;match_all&quot;: { }  }"
               HelpLink="https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html"
               
               Options="All Records={&quot;match_all&quot;: { }  };Record where comment or name contains TV word={&quot;query_string&quot;: {&quot;query&quot;: &quot;comment:TV OR name:TV&quot;}  };Record with comment field (attribute exists)={&quot;query_string&quot;: {&quot;query&quot;: &quot;_exists_:comment&quot;}  }"
        />
      </Params>
      <OutputColumns>
        <Column Name="count" DataType="DT_I8" />
      </OutputColumns>
    </EndPoint>
    
    <!--=====================================
        ========= INSERT DOCUMENTS ==========
        =====================================-->  
    <EndPoint Name="insert_documents" Label="Insert documents" Desc="Insert documents"
	            Url="/_bulk" Method="POST" ContentType="application/json" Filter="items[*]"
              DotAsPath="True" JsonRowFormat="Multicontent"
              UseRowLevelHeaderFooter="True"          
              RowFooter="\n"
              BatchSize="2000"
              IncludeParentColumns="True"
              >
      <Params>
		<Param Name="Index"  />
		<Param Name="Alias" Hidden="True" />
        <Param Name="DoNotAddMultiContentSeparator" Type="Property" Value="True" />
        <Param Name="RowHeaderFooterContinueOnError" Type="Property" Value="True" />
        <Param Name="RowHeader" NoPlaceholder="True" Value="" ValueTemplate="{ &quot;create&quot; : { &quot;_index&quot;: &quot;[$Index$]&quot; &lt;&lt;&lt;%_id%&gt;|~| |~|, &quot;_id&quot;:&quot;$1&quot;,FUN_IF_NULL_OR_EMPTY&gt;&gt; } }\n" Type="Property"/>
      </Params>
      <Body>{$rows$}</Body>
      <InputColumns>
          <Column Name="_id" Key="True" ExcludeFromRowMap="True" DataType="DT_WSTR" Length="150" />
          <Column Name="[$parent.Pivot_Path$]"
                  Expand="True" 
                  DataEndPoint="get_index_metadata"
                  DataEndPointParameters="Index=[$Index$];Alias=[$Alias$]"
                  ColumnInfoMap="Name=Pivot_Name"
                  DataTypeMap="DT_WSTR=text;DT_I8=long"
                  />                
      </InputColumns>
      <OutputColumns>
          <Column Name="P_errors" Label="ErrorFound" DataType="DT_BOOL" />
          <Column Name="create._id" Label="Id" DataType="DT_WSTR" Length="50"/>
          <Column Name="create._index" Label="Index" DataType="DT_WSTR" Length="150"/>
          <Column Name="create._type" Label="Type" DataType="DT_WSTR" Length="50"/>
          <Column Name="create.error.index_uuid" Label="IndexUuid" DataType="DT_WSTR" Length="50"/>
          <Column Name="create.error.reason" Label="Reason" DataType="DT_WSTR" Length="4000"/>
          <Column Name="create.error.type" Label="ErrorType" DataType="DT_WSTR" Length="250"/>
          <Column Name="create.status" Label="HttpStatus" DataType="DT_I4"/>
      </OutputColumns>
    </EndPoint>

    <!--=====================================
        ========= UPDATE DOCUMENTS ==========
        =====================================-->  
    <EndPoint Name="update_documents" Label="Update documents" Desc="Update documents"
	            Url="/_bulk" Method="POST" ContentType="application/json" Filter="items[*]"
              DotAsPath="True" JsonRowFormat="Multicontent"
              RowFooter="} \n"
              BatchSize="2000"
              IncludeParentColumns="True"
              >
      <Params>      
          <Param Name="Index"/>
          <Param Name="Alias" Hidden="True" />  
          <Param Name="DoNotAddMultiContentSeparator" Type="Property" Value="True" />
          <Param Name="RowHeaderFooterContinueOnError" Type="Property" Value="True" />
          <Param Name="RowHeader" NoPlaceholder="True" Value="" ValueTemplate="{ &quot;update&quot; : { &quot;_index&quot;: &quot;[$Index$]&quot; &lt;&lt;&lt;%_id%&gt;|~| |~|, &quot;_id&quot;: &quot;$1&quot;,FUN_IF_NULL_OR_EMPTY&gt;&gt; } }\n{ &quot;doc&quot;: " Type="Property"/>          
      </Params>
      <Body>{$rows$}</Body>    
      <InputColumns>
          <Column Name="_id" Key="True" ExcludeFromRowMap="True" DataType="DT_WSTR" Length="150" />
          <Column Name="[$parent.Pivot_Name$]"
                  Expand="True" 
                  DataEndPoint="get_index_metadata"
                  DataEndPointParameters="Index=[$Index$]"
                  ColumnInfoMap="Name=Pivot_Path"                  
                  DataTypeMap="DT_WSTR=text;DT_I8=long"
                  />                
      </InputColumns>
      <OutputColumns>
          <Column Name="P_errors" Label="ErrorFound" DataType="DT_BOOL" />
          <Column Name="update._id" Label="Id" DataType="DT_WSTR" Length="50"/>
          <Column Name="update._index" Label="Index" DataType="DT_WSTR" Length="150"/>
          <Column Name="update._type" Label="Type" DataType="DT_WSTR" Length="50"/>
          <Column Name="update.error.index_uuid" Label="IndexUuid" DataType="DT_WSTR" Length="50"/>
          <Column Name="update.error.reason" Label="Reason" DataType="DT_WSTR" Length="4000"/>
          <Column Name="update.error.type" Label="ErrorType" DataType="DT_WSTR" Length="250"/>
          <Column Name="update.status" Label="HttpStatus" DataType="DT_I4"/>
      </OutputColumns>
    </EndPoint>

    <!--=====================================
        ========= UPSERT DOCUMENTS ==========
        =====================================-->  
    <EndPoint Name="upsert_documents" Label="Upsert documents" Desc="Upserts documents"
	            Url="/_bulk" Method="POST" ContentType="application/json" Filter="items[*]"
              DotAsPath="True" JsonRowFormat="Multicontent"
              RowFooter="\n"
              BatchSize="2000"
              IncludeParentColumns="True"
              >
      <Params>
        <Param Name="Index"/>
		<Param Name="Alias" Hidden="True" />
        <Param Name="RowHeaderFooterContinueOnError" Type="Property" Value="True" />
        <Param Name="RowHeader" NoPlaceholder="True" Value="" ValueTemplate="{ &quot;index&quot; : { &quot;_index&quot;: &quot;[$Index$]&quot; &lt;&lt;&lt;%_id%&gt;|~| |~|, &quot;_id&quot;:&quot;$1&quot;,FUN_IF_NULL_OR_EMPTY&gt;&gt; } }\n" Type="Property"/>
      </Params>
      <Body>{$rows$}</Body>     
      <InputColumns>
          <Column Name="_id" Key="True" ExcludeFromRowMap="True" DataType="DT_WSTR" Length="150" />
          <Column Name="[$parent.Pivot_Name$]"
                  Expand="True" 
                  DataEndPoint="get_index_metadata"
                  DataEndPointParameters="Index=[$Index$];Alias=[$Alias$]"
                  ColumnInfoMap="Name=Pivot_Name"
                  DataTypeMap="DT_WSTR=text;DT_I8=long"
                  />                
      </InputColumns>
      <OutputColumns>
          <Column Name="P_errors" Label="ErrorFound" DataType="DT_BOOL" />
          <Column Name="index._id" Label="Id" DataType="DT_WSTR" Length="50"/>
          <Column Name="index._index" Label="Index" DataType="DT_WSTR" Length="150"/>
          <Column Name="index._type" Label="Type" DataType="DT_WSTR" Length="50"/>
          <Column Name="index.error.index_uuid" Label="IndexUuid" DataType="DT_WSTR" Length="50"/>
          <Column Name="index.error.reason" Label="Reason" DataType="DT_WSTR" Length="4000"/>
          <Column Name="index.error.type" Label="ErrorType" DataType="DT_WSTR" Length="250"/>
          <Column Name="index.status" Label="HttpStatus" DataType="DT_I4"/>
      </OutputColumns>
    </EndPoint>   

    <!--=====================================
        ======== DELETE DOCUMENTS ===========
        =====================================-->  
    <EndPoint Name="delete_documents" Label="Delete documents" Desc="Deletes documents"
	            Url="/_bulk" Method="POST" ContentType="application/json"
              DotAsPath="True" JsonRowFormat="Multicontent"
              Body="{$rows$}"
              UseRowLevelHeaderFooter="True"          
              RowFooter="\n"
              BatchSize="2000"
              Filter="$.items[*]"
              IncludeParentColumns="True"
              >
      <Params>
        <Param Name="DoNotAddMultiContentSeparator" Type="Property" Value="True" />
        <Param Name="Index" Type="Placeholder"/>   
      </Params>
      <LayoutMap>
        <![CDATA[<?xml version="1.0" encoding="utf-8"?>
<settings>
  <dataset id="root" readfrominput="True" />
  <map name="delete">
      <map name="_id" src="_id"  />
      <map name="_index" value="[$Index,FUN_XMLENC$]"  />
  </map>  
</settings>]]>
      </LayoutMap>
      <InputColumns>
          <Column Name="_id" Key="True" ExcludeFromRowMap="True" DataType="DT_WSTR" Length="150" />        
      </InputColumns>

      <OutputColumns>
          <Column Name="P_errors" Label="ErrorFound" DataType="DT_BOOL" />
          <Column Name="delete._id" Label="Id" DataType="DT_WSTR" Length="50"/>
          <Column Name="delete._index" Label="Index" DataType="DT_WSTR" Length="150"/>
          <Column Name="delete._type" Label="Type" DataType="DT_WSTR" Length="50"/>
          <Column Name="delete._version" Label="Version" DataType="DT_I4"/>
          <Column Name="delete.result" Label="Result" DataType="DT_WSTR" Length="4000"/>
          <Column Name="delete._seq_no" Label="SequenceNo" DataType="DT_I4"/>
          <Column Name="delete._primary_term" Label="PrimaryTerm" DataType="DT_I4"/>
          <Column Name="delete.status" Label="HttpStatus" DataType="DT_I4"/>
      </OutputColumns>
    </EndPoint>   

  </EndPoints>

  <Tables>
    <Table Name="Indexes" SelectEndPoint="list_indexes" />
    <Table Name="Metadata" SelectEndPoint="get_index_metadata" />
    <Table Name="[$parent.index$]" 
           Expand="True"
           Group="Index"
		   SelectEndPoint="get_documents"
           LookupEndPoint="get_document"
           UpdateEndPoint="update_documents"
           UpsertEndPoint="upsert_documents"
           DeleteEndPoint="delete_documents"
           InsertEndPoint="insert_documents"
           DataEndPoint="list_indexes">
      <Params>
        <Param Name="Index" Value="[$parent.index$]" Hidden="True"/>
      </Params>
    </Table>
	
	<Table Name="[$parent.Pivot_Name$]" 
		   Group="Alias"	
           Expand="True"
           SelectEndPoint="get_documents"
           LookupEndPoint="get_document"
           UpdateEndPoint="update_documents"
           UpsertEndPoint="upsert_documents"
           DeleteEndPoint="delete_documents"
           InsertEndPoint="insert_documents"
           DataEndPoint="list_aliases">
      <Params>
		<Param Name="Index" Value="[$parent.Pivot_Path$]" Hidden="True"/>
        <Param Name="Alias" Value="[$parent.Pivot_Name$]" Hidden="True"/>
      </Params>	  
    </Table>          
  </Tables>


  <!--=====================================
      ============ EXAMPLES ===============
      =====================================--> 

  <!-- LIST INDEXES -->
  <Examples>
    <Example Group="ODBC" Label="Create a new index (i.e. Table)" Desc="Create a new index (i.e. Create a new table). To trow error if table exists you can set ContineOnErrorForStatusCode=0">
       <Code>
          <![CDATA[SELECT * FROM create_index WITH(Name='my_new_index_name', ContineOnErrorForStatusCode=1)]]>
       </Code>
    </Example>
    <Example Group="ODBC" Label="Delete an exising index (i.e. Table)" Desc="Delete an exising index. It it exists it will show status code 400">
       <Code>
          <![CDATA[SELECT * FROM delete_index WITH(Name='my_index_name', ContineOn404Error=1 )]]>
       </Code>
    </Example>
    <Example Group="ODBC" Label="Generic API Call for ElasticSearch" Desc="When EndPoint not defined and you like to call some API use this way. Below example shows how to call CREATE INDEX API generic way. See other generic API call examples.">
       <Code>
          <![CDATA[SELECT * FROM generic_request 
WITH(Url='/my_index_name'
	, RequestMethod='PUT'
--	, Body='{}'
--	, Headers='X-Hdr1:aaa || x-HDR2: bbb'
	, Meta='acknowledged:bool'
	)]]>
       </Code>
    </Example>
	
    <Example Group="ODBC" Label="List indexes" Desc="Lists indexes" Default="True">
       <Code>
          <![CDATA[SELECT * FROM Indexes]]>
       </Code>
    </Example>

    <!-- GET INDEX METADATA -->
    <Example Group="ODBC" Label="Get index metadata" Desc="Gets index metadata">
       <Code>
          <![CDATA[SELECT * FROM get_index_metadata WITH (Index='my_index_name')]]>
       </Code>
    </Example>
	
    <!-- GET DOCUMENTS FROM INDEX -->
    <Example Group="ODBC" Label="Read ElasticSearch documents from Index (all or with filter)" Desc="Gets documents by index name (i.e. Table name) or alias name (i.e. View name). Using WHERE clause invokes client side engine so try to avoid WHERE clause and use WITH clause QUERY attribute. Use search endpoint instead to invoke query.">
       <Code>
          <![CDATA[SELECT * FROM MyIndexOrAliasName --WITH(Query='{"match": { "PartNumber" : "P50" } }')]]>
       </Code>
    </Example>
    <!-- GET DOCUMENTS FROM INDEX -->
    <Example Group="ODBC" Label="Read ElasticSearch documents from Alias (all or with filter)" Desc="Gets documents by index name (i.e. Table name) or alias name (i.e. View name). Using WHERE clause invokes client side engine so try to avoid WHERE clause and use WITH clause QUERY attribute. Use search endpoint instead to invoke query.">
       <Code>
          <![CDATA[SELECT * FROM MyIndexOrAliasName --WITH(Query='{"match": { "PartNumber" : "P50" } }')]]>
       </Code>
    </Example>	
    
    <!-- Search DOCUMENTS from Index-->
    <Example Group="ODBC" Label="Search documents from Index using ElasticSearch Query language" Desc="Below example shows how to search on a comment field for TV word anywhere in the text for Index named MyIndexOrAliasName (it can be index name or alias name). For more information on ElasticSearch Query expression check this link https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html">
      <Code>
        <![CDATA[
		SELECT * FROM MyIndexOrAliasName WITH(Query='{"match": { "comment" : "TV" } }')
		
		--or use below - slight faster (avoids table / alias list validation)
		--SELECT * FROM search WITH(Index='MyIndexName', Query='{"match": { "comment" : "TV" } }')
		--SELECT * FROM search WITH(Index='MyIndexName', Alias='MyAliasName', Query='{"match": { "comment" : "TV" } }')
		]]>
      </Code>
    </Example>
	
    <!-- Search DOCUMENTS from Alias-->
    <Example Group="ODBC" Label="Search documents from Alias using ElasticSearch Query language" Desc="Below example shows how to search on Alias rather than Index name. Alias is build on index (consider like a view in RDBMS). This example filtes data from Alias with some condition in the Query Text. For more information on ElasticSearch Query expression check this link https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html">
      <Code>
        <![CDATA[
		
		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" } }')
		
		]]>
      </Code>
    </Example>

    <Example Group="ODBC" Label="Count ElasticSearch index documents using ElasticSearch Query language" Desc="Below example shows how to get just count of documents from Index (single, multiple or all index). Optionally you can supply expression to filter. For more information on ElasticSearch Query expression check this link https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html">
      <Code>
        <![CDATA[
SELECT * FROM count WITH(Index='MyIndexOrAliasName') --//get count of documents in index / alias named MyIndexOrAliasName
SELECT * FROM count WITH(Index='*') --//get count of documents in all indices (total distinct _id found across all indices + alias) 
SELECT * FROM count WITH(Index='MyIndex1,MyIndex2,MyAlias1,MyAlias2')--//get count of documents in indices named MyIndex1, MyIndex2 and Alias named MyAlias1,MyAlias2
SELECT * FROM count WITH(Index='MyIndexOrAliasName', Query='{"match": { "comment" : "TV" } }') --//get count of documents in MyIndex where comment field contains word "TV"
]]>
      </Code>
    </Example>
	
    <Example Group="ODBC" Label="Count ElasticSearch alias documents using ElasticSearch Query language" Desc="Below example shows how to get just count of documents from Alias (single, multiple or all alias). Optionally you can supply expression to filter. For more information on ElasticSearch Query expression check this link https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-match-query.html">
      <Code>
        <![CDATA[
SELECT * FROM count WITH(Index='MyIndexOrAliasName') --//get count of documents in index / alias named MyIndexOrAliasName
SELECT * FROM count WITH(Index='*') --//get count of documents in all indices (total distinct _id found across all indices + alias)
SELECT * FROM count WITH(Index='MyIndexOrAlias1,MyIndexOrAlias2') --//get count of documents in MyIndex1 and MyIndex2
SELECT * FROM count WITH(Index='MyIndex', Query='{"match": { "comment" : "TV" } }') --//get count of documents in Index named MyIndex where comment field contains word "TV"
SELECT * FROM count WITH(Index='MyAlias', Query='{"match": { "comment" : "TV" } }') --//get count of documents in Alias named MyAlias where comment field contains word "TV"
]]>
      </Code>
    </Example>	
    
    <!-- Search DOCUMENTS-->
    <Example Group="ODBC" Label="Using JSON Array / Value functions" Desc="Below example shows how to select specific elements from value array or use JSON PATH expression to extract from document array">
      <Code>
        <![CDATA[SELECT _id
        , JSON_ARRAY_FIRST(colors) as first_color
        , JSON_ARRAY_LAST(colors) as last_color
        , JSON_ARRAY_NTH(colors,3) as third_color
        , JSON_VALUE(locationList,'$.locationList[0].country') as first_preferred_country
        , JSON_VALUE(locationList,'$.locationList[?(@country=='India')].capital as capital_of_india
FROM shop WHERE _Id='1']]>
      </Code>
    </Example>
    

    <!-- INSERT DOCUMENTS INTO INDEX -->
    <Example Group="ODBC" Label="Insert documents into index with _id autogenerated" Desc="When you dont supply _id column value, ElasticSearch will generate it automatically for you.">
       <Code>
          <![CDATA[INSERT INTO MyIndex([MyCol1], [MyCol2] ) VALUES (100, 'A1')]]>
       </Code>
    </Example>
    
    <!-- INSERT DOCUMENTS INTO INDEX with _id-->
    <Example Group="ODBC" Label="Insert documents into index with your own _id" Desc="Inserts documents into index with _id column. _id is string datatype so can be ">
      <Code>
        <![CDATA[INSERT INTO MyIndex(_id, [MyCol1], [MyCol2] ) VALUES ('A1234', 100, 'A1')]]>
      </Code>
    </Example>

    <!-- INSERT DOCUMENTS INTO INDEX with _id-->
    <Example Group="ODBC" Label="Insert documents using nested attribute and raw fragments (JSON sub-documents, arrays)" 
             Desc="This example produces JSON document like this {&quot;_id&quot;: &quot;some_auto_generated_id&quot; , &quot;Location&quot;: { &quot;City&quot; : &quot;Atlanta&quot; , &quot;ZipCode&quot; : &quot;30060&quot; },&quot;ColorsArray &quot;: [&quot;Red&quot;, &quot;Blue&quot;, &quot;Green&quot;],&quot;SomeNestedDoc&quot;: { &quot;Col1&quot; : &quot;aaa&quot; , &quot;Col2&quot; : &quot;bbb&quot; , &quot;Col2&quot; : &quot;ccc&quot; }} . Notice that how Column name with Dot translated into nested Columns (i.e. City, ZipCode) and Prefix raw:: allowed to treat value as array or sub document.">
      <Code>
        <![CDATA[INSERT INTO MyIndexName ([Location.City], [Location.ZipCode], [raw::ColorsArray], [raw::SomeNestedDoc] )
VALUES ('A1234', 'Atlanta', '30060', '["red","green","blue"]', '{"Col1":"aaa","Col2":"bbb","Col3":"ccc"}' )]]>
      </Code>
    </Example>

    <!-- INSERT RAW DOCUMENT-->
    <Example Group="ODBC" Label="Insert raw document (_rawdoc_ usage)" Desc="This example shows how to insert document(s) in a raw format. When you use column name _rawdoc_ then its treated as RAW body. Notice that we use @ before string literal in value. This allow to use escape sequence (in this case \n for new line)." >
      <Code>
        <![CDATA[INSERT INTO shop(_RAWDOC_) 
VALUES(@'{"create":{"_index":"shop","_id":"1"}}\n{"name":"record-1","colors":["yellow","orange"]}\n{"create":{"_index":"shop","_id":"2"}}\n{"name":"record-2","colors":["red","blue"]}\n')]]>
      </Code>
    </Example>

    
    <!-- UPDATE DOCUMENTS IN INDEX -->
    <Example Group="ODBC" Label="Update documents in index" Desc="Updates documents in index">
       <Code>
          <![CDATA[UPDATE MyIndex
  SET Col1 = 'NewValue-1', Col2 = 'NewValue-2'
  WHERE _Id = 'A1234' ]]>
       </Code>
    </Example>
    
    <Example Group="ODBC" Label="Update raw document (_rawdoc_ usage)" Desc="This example shows how to update document(s) in a raw format. When you use column name _rawdoc_ then its treated as RAW body. Notice that we use @ before string literal in value. This allow to use escape sequence (in this case \n for new line)." >
      <Code>
        <![CDATA[UPDATE shop SET _rawdoc_ = @'{"update": {"_index": "shop", "_id": "1"}}\n{ "doc": {"colors":["yellow","orange"] } }\n{"update": {"_index": "shop", "_id": "2"}}\n{ "doc": {"colors":["yellow","blue"] } }\n']]>
      </Code>
    </Example>
    
    <!-- UPDATE DOCUMENTS IN INDEX -->
    <Example Group="ODBC" Label="Update array or sub document" Desc="This example shows how to update Array / nested Sub-document by adding raw:: prefix infront of column name to treat column as json fragment">
      <Code>
        <![CDATA[UPDATE MyIndex
  SET name = 'abcd', [raw::colors]='["yellow","red"]', [raw::location]='{x:10, y:20}' 
  WHERE _id='1' ]]>
      </Code>
    </Example>

    <!-- DELETE DOCUMENTS FROM INDEX -->
    <Example Group="ODBC" Label="Delete documents from index" Desc="Deletes documents from index">
       <Code>
          <![CDATA[DELETE MyIndex WHERE _id = 'A1234']]>
       </Code>
    </Example>
  </Examples>
</ApiConfig>