/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.serverlessSearch_bundle_jsonpfunction=window.serverlessSearch_bundle_jsonpfunction||[]).push([[0],Array(24).concat([function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return j})),t.d(n,"d",(function(){return m})),t.d(n,"f",(function(){return b})),t.d(n,"g",(function(){return y})),t.d(n,"c",(function(){return v})),t.d(n,"e",(function(){return O})),t.d(n,"j",(function(){return C})),t.d(n,"i",(function(){return E})),t.d(n,"h",(function(){return S}));var a=t(1),s=t.n(a),i=t(3),r=t(2),o=t(0),l=t(18),c=t(34);const u=({request:e,application:n,sharePlugin:t})=>{var a,s,r;const{url:u}=t;if(null==n||null===(a=n.capabilities)||void 0===a||null===(s=a.dev_tools)||void 0===s||!s.show||!u)return null;const d=Object(c.compressToEncodedURIComponent)(e),p=null===(r=u.locators.get("CONSOLE_APP_LOCATOR"))||void 0===r?void 0:r.useUrl({loadFrom:`data:text/plain,${d}`},void 0,[e]);return p?Object(o.jsx)(i.EuiButtonEmpty,{href:p,iconType:"popout",target:"_blank"},Object(o.jsx)(l.FormattedMessage,{id:"searchApiPanels.welcomeBanner.tryInConsoleButton",defaultMessage:"Try in console"})):null};t(35);const d=({application:e,codeSnippet:n,languageType:t,languages:s,assetBasePath:l,selectedLanguage:c,setSelectedLanguage:d,sharePlugin:p,consoleRequest:h})=>{const[g,x]=Object(a.useState)(!1),b=s.map((e=>Object(o.jsx)(i.EuiContextMenuItem,{key:e.id,icon:`${l}/${e.iconType}`,onClick:()=>{d(e),x(!1)}},e.name))),f=Object(o.jsx)(i.EuiThemeProvider,{colorMode:"dark"},Object(o.jsx)(i.EuiButtonEmpty,{"aria-label":r.i18n.translate("searchApiPanels.welcomeBanner.codeBox.selectAriaLabel",{defaultMessage:"Select a programming language"}),color:"text",iconType:"arrowDown",iconSide:"left",onClick:()=>x(!g)},c.name));return Object(o.jsx)(i.EuiThemeProvider,{colorMode:"dark"},Object(o.jsx)(i.EuiPanel,{paddingSize:"xs",className:"serverlessSearchCodeBlockControlsPanel"},Object(o.jsx)(i.EuiFlexGroup,{alignItems:"center"},Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiThemeProvider,{colorMode:"light"},Object(o.jsx)(i.EuiPopover,{button:f,isOpen:g,closePopover:()=>x(!1),panelPaddingSize:"none",anchorPosition:"downLeft"},Object(o.jsx)(i.EuiContextMenuPanel,{items:b,size:"s"})))),Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiCopy,{textToCopy:n},(e=>Object(o.jsx)(i.EuiButtonEmpty,{color:"text",iconType:"copy",size:"s",onClick:e},r.i18n.translate("searchApiPanels.welcomeBanner.codeBox.copyButtonLabel",{defaultMessage:"Copy"}))))),void 0!==h&&Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(u,{request:h,application:e,sharePlugin:p}))),Object(o.jsx)(i.EuiHorizontalRule,{margin:"none"}),Object(o.jsx)(i.EuiCodeBlock,{transparentBackground:!0,fontSize:"m",language:t||c.languageStyling||c.id},n)))},p=({assetBasePath:e,label:n,href:t})=>Object(o.jsx)(i.EuiFlexGroup,{alignItems:"center",gutterSize:"xs",justifyContent:"flexEnd"},Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiIcon,{size:"s",type:`${e}github.svg`})),Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiText,{size:"s"},Object(o.jsx)(i.EuiLink,{target:"_blank",href:t},n))));var h=t(6),g=t.n(h);const x=r.i18n.translate("searchApiPanels.welcomeBanner.panels.learnMore",{defaultMessage:"Learn more"}),b=({children:e,description:n,leftPanelContent:t,links:a,rightPanelContent:r,title:l,overviewPanelProps:c})=>Object(o.jsx)(s.a.Fragment,null,Object(o.jsx)(i.EuiSpacer,{size:"xxl"}),Object(o.jsx)(i.EuiFlexGroup,{alignItems:"center"},t&&Object(o.jsx)(i.EuiFlexItem,{grow:6},t),Object(o.jsx)(i.EuiFlexItem,{grow:4},Object(o.jsx)(i.EuiPanel,g()({color:"subdued"},c),Object(o.jsx)(i.EuiTitle,null,Object(o.jsx)("h2",null,l)),Object(o.jsx)(i.EuiSpacer,null),n&&Object(o.jsx)(i.EuiText,null,n),e,a&&a.length>0?Object(o.jsx)(s.a.Fragment,null,Object(o.jsx)(i.EuiSpacer,null),Object(o.jsx)(i.EuiTitle,{size:"xxs"},Object(o.jsx)("h3",null,x)),Object(o.jsx)(i.EuiSpacer,{size:"s"}),a.map((({label:e,href:n},t)=>Object(o.jsx)(i.EuiText,{size:"s",key:`overviewPanel.link.${t}`},Object(o.jsx)(i.EuiLink,{key:t,href:n,target:"_blank"},e))))):null)),r&&Object(o.jsx)(i.EuiFlexItem,{grow:6}," ",r)),Object(o.jsx)(i.EuiSpacer,{size:"xxl"})),f=({docLinks:e,assetBasePath:n})=>Object(o.jsx)(i.EuiThemeProvider,{colorMode:"dark"},Object(o.jsx)(i.EuiPanel,{paddingSize:"xl"},Object(o.jsx)(i.EuiFlexGroup,{alignItems:"center",justifyContent:"flexStart"},Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiIcon,{type:"logoLogstash",size:"xxl"})),Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiTitle,{size:"l"},Object(o.jsx)("h3",null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.logstashTitle",{defaultMessage:"Logstash"}))),Object(o.jsx)(i.EuiSpacer,{size:"xs"}),Object(o.jsx)(i.EuiText,{size:"s"},Object(o.jsx)("p",null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.logstashDescription",{defaultMessage:"Add data to your data stream or index to make it searchable. Choose an ingestion method that fits your application and workflow."}))),Object(o.jsx)(i.EuiSpacer,{size:"s"}),Object(o.jsx)(i.EuiFlexGroup,{justifyContent:"flexStart"},Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiText,{size:"s"},Object(o.jsx)(i.EuiLink,{href:e.logstash,target:"_blank"},x))),Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(p,{href:"https://github.com/elastic/logstash",label:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.logstashLink",{defaultMessage:"Logstash"}),assetBasePath:n}))))),Object(o.jsx)(i.EuiSpacer,{size:"xl"}),Object(o.jsx)(i.EuiFlexGroup,{alignItems:"center",justifyContent:"flexStart"},Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiIcon,{type:"logoBeats",size:"xxl"})),Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiTitle,{size:"l"},Object(o.jsx)("h3",null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.beatsTitle",{defaultMessage:"Beats"}))),Object(o.jsx)(i.EuiSpacer,{size:"xs"}),Object(o.jsx)(i.EuiText,{size:"s"},r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.beatsDescription",{defaultMessage:"Lightweight, single-purpose data shippers for Elasticsearch. Use Beats to send operational data from your servers."})),Object(o.jsx)(i.EuiSpacer,{size:"s"}),Object(o.jsx)(i.EuiFlexGroup,{justifyContent:"flexStart"},Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiText,{size:"s"},Object(o.jsx)(i.EuiLink,{href:e.beats,target:"_blank"},x))),Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(p,{href:"https://github.com/elastic/beats",label:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.beatsLink",{defaultMessage:"beats"}),assetBasePath:n}))))),Object(o.jsx)(i.EuiSpacer,{size:"l"}),Object(o.jsx)(i.EuiFlexGroup,{alignItems:"center",justifyContent:"flexStart"},Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiIcon,{type:"logoEnterpriseSearch",size:"xxl"})),Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiTitle,{size:"l"},Object(o.jsx)("h3",null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.connectorsTitle",{defaultMessage:"Connector Client"}))),Object(o.jsx)(i.EuiSpacer,{size:"xs"}),Object(o.jsx)(i.EuiText,{size:"s"},r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.connectorsDescription",{defaultMessage:"Specialized integrations for syncing data from third-party sources to Elasticsearch. Use Elastic Connectors to sync content from a range of databases and object stores."})),Object(o.jsx)(i.EuiSpacer,{size:"s"}),Object(o.jsx)(i.EuiFlexGroup,{justifyContent:"flexStart"},Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiText,{size:"s"},Object(o.jsx)(i.EuiLink,{href:e.connectors,target:"_blank"},x))),Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(p,{href:"https://github.com/elastic/connectors-python",label:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.connectorsPythonLink",{defaultMessage:"connectors-python"}),assetBasePath:n}))))))),j=({codeSnippet:e,selectedLanguage:n,setSelectedLanguage:t,docLinks:s,assetBasePath:l,application:c,sharePlugin:u,languages:p,consoleRequest:h})=>{const[g,x]=Object(a.useState)("ingestViaApi");return Object(o.jsx)(b,{description:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.description",{defaultMessage:"Add data to your data stream or index to make it searchable. Choose an ingestion method that fits your application and workflow."}),leftPanelContent:"ingestViaApi"===g?Object(o.jsx)(d,{consoleRequest:h,codeSnippet:e,languages:p,selectedLanguage:n,setSelectedLanguage:t,assetBasePath:l,application:c,sharePlugin:u}):Object(o.jsx)(f,{docLinks:s,assetBasePath:l}),links:[...n.apiReference?[{href:n.apiReference,label:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.clientDocLink",{defaultMessage:"{languageName} API reference",values:{languageName:n.name}})}]:[],{href:s.integrations,label:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.integrationsLink",{defaultMessage:"About Integrations"})}],title:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.title",{defaultMessage:"Ingest data"})},Object(o.jsx)(i.EuiFormFieldset,{legend:{children:r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.ingestLegendLabel",{defaultMessage:"Select an ingestion method"}),display:"hidden"}},Object(o.jsx)(i.EuiCheckableCard,{hasShadow:!0,id:"ingestViaApi",label:Object(o.jsx)(i.EuiTitle,{size:"xs"},Object(o.jsx)("h3",null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.ingestApiLabel",{defaultMessage:"Ingest via API"}))),value:"ingestViaApi",checked:"ingestViaApi"===g,onChange:()=>x("ingestViaApi")},Object(o.jsx)(i.EuiText,null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.ingestApiDescription",{defaultMessage:"The most flexible way to index data, enabling full control over your customization and optimization options."}))),Object(o.jsx)(i.EuiSpacer,null),Object(o.jsx)(i.EuiCheckableCard,{hasShadow:!0,id:"ingestViaIntegration",label:Object(o.jsx)(i.EuiTitle,{size:"xs"},Object(o.jsx)("h3",null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.ingestIntegrationLabel",{defaultMessage:"Ingest via integration"}))),value:"ingestViaIntegration",checked:"ingestViaIntegration"===g,onChange:()=>x("ingestViaIntegration")},Object(o.jsx)(i.EuiText,null,r.i18n.translate("searchApiPanels.welcomeBanner.ingestData.ingestIntegrationDescription",{defaultMessage:"Specialized ingestion tools optimized for transforming data and shipping it to Elasticsearch."})))))};t(31);const m=({language:e,setSelectedLanguage:n,isSelectedLanguage:t,assetBasePath:a,src:s})=>{const{euiTheme:r}=Object(i.useEuiTheme)();return Object(o.jsx)(i.EuiFlexGroup,{gutterSize:"xs",direction:"row"},Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiPanel,{hasBorder:!0,borderRadius:"m",className:t?"serverlessSearchSelectClientPanelSelectedBorder":"serverlessSearchSelectClientPanelBorder",onClick:()=>n(e),color:t?"primary":"plain"},Object(o.jsx)(i.EuiFlexGroup,{direction:"column",justifyContent:"center"},Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiImage,{alt:"",src:s||`${a}${e.iconType}`,height:r.size.xl,width:r.size.xl}),Object(o.jsx)(i.EuiSpacer,{size:"s"}),Object(o.jsx)(i.EuiText,{textAlign:"center",color:t?"default":"subdued"},Object(o.jsx)("h5",null,e.name)))))))},y=({docLinks:e,children:n,http:t,isPanelLeft:a=!0,overviewPanelProps:c})=>{const u=Object(o.jsx)(s.a.Fragment,null,Object(o.jsx)(i.EuiFlexGroup,{direction:"column"},Object(o.jsx)(i.EuiFlexItem,null,Object(o.jsx)(i.EuiText,{size:"s"},Object(o.jsx)("strong",null,r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.heading",{defaultMessage:"Choose one"}))))),Object(o.jsx)(i.EuiSpacer,{size:"s"}),Object(o.jsx)(i.EuiFlexGroup,{gutterSize:"xs",direction:"row"},n),Object(o.jsx)(i.EuiSpacer,{size:"l"}),Object(o.jsx)(i.EuiCallOut,{title:r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.callout.title",{defaultMessage:"Try it now in Console"}),size:"m",iconType:"iInCircle"},Object(o.jsx)("p",null,r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.callout.description",{defaultMessage:"With Console, you can get started right away with our REST API’s. No installation required. "}),Object(o.jsx)("span",null,Object(o.jsx)(i.EuiLink,{target:"_blank",href:t.basePath.prepend("/app/dev_tools#/console")},r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.callout.link",{defaultMessage:"Try Console now"}))))));return Object(o.jsx)(b,{description:Object(o.jsx)(l.FormattedMessage,{id:"searchApiPanels.welcomeBanner.selectClient.description",defaultMessage:"Elastic builds and maintains clients in several popular languages and our community has contributed many more. Select your favorite language client or dive into the {console} to get started.",values:{console:Object(o.jsx)(i.EuiLink,{href:t.basePath.prepend("/app/dev_tools#/console")},r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.description.console.link",{defaultMessage:"Console"}))}}),leftPanelContent:a?u:void 0,rightPanelContent:a?void 0:u,links:[{href:e.elasticsearchClients,label:r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.elasticsearchClientDocLink",{defaultMessage:"Elasticsearch clients "})},{href:e.kibanaRunApiInConsole,label:r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.apiRequestConsoleDocLink",{defaultMessage:"Run API requests in Console "})}],title:r.i18n.translate("searchApiPanels.welcomeBanner.selectClient.title",{defaultMessage:"Select your client"}),overviewPanelProps:c})},_=({language:e,assetBasePath:n})=>e.github?Object(o.jsx)(p,{href:e.github.link,label:e.github.label,assetBasePath:n}):null,v=({codeSnippet:e,consoleRequest:n,language:t,languages:a,setSelectedLanguage:l,assetBasePath:c,application:u,sharePlugin:p,isPanelLeft:h=!0,overviewPanelProps:g})=>{const x=Object(o.jsx)(s.a.Fragment,null,Object(o.jsx)(d,{consoleRequest:n,codeSnippet:e,languageType:"shell",languages:a,selectedLanguage:t,setSelectedLanguage:l,assetBasePath:c,application:u,sharePlugin:p}),Object(o.jsx)(i.EuiSpacer,null),Object(o.jsx)(_,{language:t,assetBasePath:c}),Object(o.jsx)(i.EuiSpacer,null),Object(o.jsx)(i.EuiCallOut,{iconType:"iInCircle",title:r.i18n.translate("searchApiPanels.welcomeBanner.apiCallOut.title",{defaultMessage:"Call the API with Console"}),color:"primary"},Object(o.jsx)(i.EuiText,{size:"s"},r.i18n.translate("searchApiPanels.welcomeBanner.apiCallout.content",{defaultMessage:"Console enables you to call Elasticsearch and Kibana REST APIs directly, without needing to install a language client."}))));return Object(o.jsx)(b,{description:r.i18n.translate("searchApiPanels.welcomeBanner.installClient.description",{defaultMessage:"Elastic builds and maintains clients in several popular languages and our community has contributed many more. Install your favorite language client to get started."}),links:[{href:t.docLink,label:r.i18n.translate("searchApiPanels.welcomeBanner.installClient.clientDocLink",{defaultMessage:"{languageName} client documentation",values:{languageName:t.name}})}],title:r.i18n.translate("searchApiPanels.welcomeBanner.installClient.title",{defaultMessage:"Install a client"}),leftPanelContent:h?x:void 0,rightPanelContent:h?void 0:x,overviewPanelProps:g})};let O;!function(e){e.JAVA="java",e.JAVASCRIPT="javascript",e.RUBY="ruby",e.GO="go",e.DOTNET="dotnet",e.PHP="php",e.PERL="perl",e.PYTHON="python",e.RUST="rust",e.CURL="curl"}(O||(O={}));const w={buildSearchQuery:'POST /books/_search?pretty\n{\n "query": {\n "query_string": {\n "query": "snow"\n }\n }\n}',ingestData:'POST _bulk?pretty\n{ "index" : { "_index" : "books" } }\n{"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470}\n{ "index" : { "_index" : "books" } }\n{"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}\n{ "index" : { "_index" : "books" } }\n{"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}\n{ "index" : { "_index" : "books" } }\n{"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}\n{ "index" : { "_index" : "books" } }\n{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}\n{ "index" : { "_index" : "books" } }\n{"name": "The Handmaid\'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}'},C=(e,n,t)=>{const a=e[n];if(void 0===a)return"";switch(typeof a){case"string":return a;case"function":return a(t);default:return""}},E=e=>e in w&&"string"==typeof w[e]?w[e]:void 0,S=({userProfile:e,assetBasePath:n,image:t,showDescription:a=!0})=>{var s,l;return Object(o.jsx)(i.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiFlexGroup,{justifyContent:"flexStart",direction:"columnReverse",gutterSize:"s"},Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiTitle,{className:"serverlessSearchHeaderTitle",size:"s"},Object(o.jsx)("h1",null,r.i18n.translate("searchApiPanels.welcomeBanner.header.title",{defaultMessage:"Get started with Elasticsearch"})))),Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiTitle,{size:"xxxs"},Object(o.jsx)("h2",null,r.i18n.translate("searchApiPanels.welcomeBanner.header.greeting.title",{defaultMessage:"Hi {name}!",values:{name:(null==e||null===(s=e.user)||void 0===s?void 0:s.full_name)||(null==e||null===(l=e.user)||void 0===l?void 0:l.username)}}))))),Object(o.jsx)(i.EuiSpacer,null),a&&Object(o.jsx)(i.EuiText,null,r.i18n.translate("searchApiPanels.welcomeBanner.header.description",{defaultMessage:"Set up your programming language client, ingest some data, and you'll be ready to start searching within minutes."})),Object(o.jsx)(i.EuiSpacer,{size:"xxl"})),Object(o.jsx)(i.EuiFlexItem,{grow:!1},Object(o.jsx)(i.EuiImage,{alt:"",src:t||`${n}serverless_header.png`,size:"554px"})))}},function(e,n,t){"use strict";var a,s=function(){var e={};return function(n){if(void 0===e[n]){var t=document.querySelector(n);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[n]=t}return e[n]}}(),i=[];function r(e){for(var n=-1,t=0;tObject(a.useKibana)().services},function(e,n,t){"use strict";t.d(n,"a",(function(){return r}));var a=t(24),s=t(2),i=t(8);const r={apiReference:i.a.jsApiReference,basicConfig:i.a.jsBasicConfig,buildSearchQuery:"// Let's search!\nconst searchResult = await client.search({\n index: 'my-index-name',\n q: '9HY9SWR'\n});\n\nconsole.log(searchResult.hits.hits)\n",configureClient:({url:e,apiKey:n})=>`const { Client } = require('@elastic/elasticsearch');\nconst client = new Client({\nnode: '${e}',\nauth: {\n apiKey: '${n}'\n}\n});`,docLink:i.a.jsClient,github:{link:"https://github.com/elastic/elasticsearch-serverless-js",label:s.i18n.translate("xpack.serverlessSearch.languages.javascript.githubLabel",{defaultMessage:"elasticsearch-serverless"})},iconType:"javascript.svg",id:a.e.JAVASCRIPT,ingestData:"// Sample flight data\nconst dataset = [\n{'flight': '9HY9SWR', 'price': 841.2656419677076, 'delayed': false},\n{'flight': 'X98CCZO', 'price': 882.9826615595518, 'delayed': false},\n{'flight': 'UFK2WIZ', 'price': 190.6369038508356, 'delayed': true},\n];\n\n// Index with the bulk helper\nconst result = await client.helpers.bulk({\ndatasource: dataset,\nonDocument (doc) {\n return { index: { _index: 'my-index-name' }};\n}\n});\n\nconsole.log(result);\n/**\n{\ntotal: 3,\nfailed: 0,\nretry: 0,\nsuccessful: 3,\nnoop: 0,\ntime: 421,\nbytes: 293,\naborted: false\n}\n*/",ingestDataIndex:({apiKey:e,url:n,indexName:t})=>`const { Client } = require('@elastic/elasticsearch');\nconst client = new Client({\n node: '${n}',\n auth: {\n apiKey: '${e}'\n }\n});\nconst dataset = [\n {'name': 'foo', 'title': 'bar'},\n];\n\n// Index with the bulk helper\nconst result = await client.helpers.bulk({\n datasource: dataset,\n onDocument (doc) {\n return { index: { _index: '${null!=t?t:"index_name"}' }};\n }\n});\nconsole.log(result);\n`,installClient:"npm install @elastic/elasticsearch@8",name:s.i18n.translate("xpack.serverlessSearch.languages.javascript",{defaultMessage:"JavaScript"}),testConnection:"const resp = await client.info();\n\nconsole.log(resp);\n/**\n{\nname: 'instance-0000000000',\ncluster_name: 'd9dcd35d12fe46dfaa28ec813f65d57b',\ncluster_uuid: 'iln8jaivThSezhTkzp0Knw',\nversion: {\n build_flavor: 'default',\n build_type: 'docker',\n build_hash: 'c94b4700cda13820dad5aa74fae6db185ca5c304',\n build_date: '2022-10-24T16:54:16.433628434Z',\n build_snapshot: false,\n lucene_version: '9.4.1',\n minimum_wire_compatibility_version: '7.17.0',\n minimum_index_compatibility_version: '7.0.0'\n},\ntagline: 'You Know, for Search'\n}\n*/"}},function(e,n,t){"use strict";t.d(n,"c",(function(){return a})),t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return i}));const a="/app/management/security/api_keys",s="/internal/security/api_key",i="/internal/serverless_search/indices"},function(e,n,t){switch(window.__kbnThemeTag__){case"v8dark":return t(40);case"v8light":return t(42)}},function(e,n,t){"use strict";t.d(n,"a",(function(){return a}));const a="serverlessSearch"},function(e,n,t){"use strict";t.d(n,"a",(function(){return g}));var a=t(24),s=t(2),i=t(8);const r={buildSearchQuery:'curl -X POST "${ES_URL}/books/_search?pretty" \\\n -H "Authorization: ApiKey "${API_KEY}"" \\\n -H "Content-Type: application/json" \\\n -d\'\n{\n "query": {\n "query_string": {\n "query": "snow"\n }\n }\n}\'',configureClient:({apiKey:e,url:n})=>`export ES_URL="${n}"\nexport API_KEY="${e}"`,docLink:i.a.apiIntro,github:{link:"https://github.com/curl/curl",label:s.i18n.translate("xpack.serverlessSearch.languages.cURL.githubLabel",{defaultMessage:"curl"})},iconType:"curl.svg",id:a.e.CURL,ingestData:'curl -X POST "${ES_URL}/_bulk?pretty" \\\n -H "Authorization: ApiKey "${API_KEY}"" \\\n -H "Content-Type: application/json" \\\n -d\'\n{ "index" : { "_index" : "books" } }\n{"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470}\n{ "index" : { "_index" : "books" } }\n{"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}\n{ "index" : { "_index" : "books" } }\n{"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}\n{ "index" : { "_index" : "books" } }\n{"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}\n{ "index" : { "_index" : "books" } }\n{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}\n{ "index" : { "_index" : "books" } }\n{"name": "The Handmaid\'"\'"\'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}\n\'',ingestDataIndex:({apiKey:e,url:n,indexName:t})=>`curl -X POST ${n}/_bulk?pretty \\\n -H "Authorization: ApiKey ${e}" \\\n -H "Content-Type: application/json" \\\n -d'\n{ "index" : { "_index" : "${null!=t?t:"index_name"}" } }\n{"name": "foo", "title": "bar" }\n`,installClient:"# if cURL is not already installed on your system\n# then install it with the package manager of your choice\n\n# example\nbrew install curl",name:s.i18n.translate("xpack.serverlessSearch.languages.cURL",{defaultMessage:"cURL"}),languageStyling:"shell",testConnection:'curl "${ES_URL}" \\\n -H "Authorization: ApiKey "${API_KEY}"" \\\n -H "Content-Type: application/json"'},o={apiReference:i.a.goApiReference,basicConfig:i.a.goBasicConfig,buildSearchQuery:'searchResp, err := es.Search().\n Index("books").\n Q("snow").\n Do(context.Background())\n\nfmt.Println(searchResp, err)',configureClient:({url:e,apiKey:n})=>`import (\n "context"\n "fmt"\n "log"\n "strings"\n​\n "github.com/elastic/elasticsearch-serverless-go"\n)\n\nfunc main() {\n cfg := elasticsearch.Config{\n Address: "${e}",\n APIKey: "${n}",\n }\n es, err := elasticsearch.NewClient(cfg)\n if err != nil {\n log.Fatalf("Error creating the client: %s", err)\n }\n}`,docLink:i.a.goClient,github:{link:"https://github.com/elastic/elasticsearch-serverless-go",label:s.i18n.translate("xpack.serverlessSearch.languages.go.githubLabel",{defaultMessage:"elasticsearch-serverless-go"})},iconType:"go.svg",id:a.e.GO,ingestData:'ingestResult, err := es.Bulk().\n Index("books").\n Raw(strings.NewReader(`\n{"index":{"_id":"9780553351927"}}\n{"name":"Snow Crash","author":"Neal Stephenson","release_date":"1992-06-01","page_count": 470}\n{ "index": { "_id": "9780441017225"}}\n{"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}\n{ "index": { "_id": "9780451524935"}}\n{"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}\n{ "index": { "_id": "9781451673319"}}\n{"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}\n{ "index": { "_id": "9780060850524"}}\n{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}\n{ "index": { "_id": "9780385490818"}}\n{"name": "The Handmaid\'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}\n`)).\n Do(context.Background())\n\nfmt.Println(ingestResult, err)',ingestDataIndex:({apiKey:e,url:n,indexName:t})=>`import (\n "context"\n "fmt"\n "log"\n "strings"\n​\n "github.com/elastic/elasticsearch-serverless-go"\n)\n​\nfunc main() {\n cfg := elasticsearch.Config{\n Address: "${n}",\n APIKey: "${e}",\n }\n es, err := elasticsearch.NewClient(cfg)\n if err != nil {\n log.Fatalf("Error creating the client: %s", err)\n }\n res, err := es.Bulk().\n Index("${t}").\n Raw(strings.NewReader(\`\n{ "index": { "_id": "1"}}\n{"name": "foo", "title": "bar"}\n\`)).\n Do(context.Background())\n ​\n fmt.Println(res, err)\n}`,installClient:"go get -u github.com/elastic/elasticsearch-serverless-go@latest",name:s.i18n.translate("xpack.serverlessSearch.languages.go",{defaultMessage:"Go"}),testConnection:'infores, err := es.Info().Do(context.Background())\nif err != nil {\n log.Fatalf("Error getting response: %s", err)\n}\n\nfmt.Println(infores)'};var l=t(29),c=t(27);const u={apiReference:i.a.phpApiReference,basicConfig:i.a.phpBasicConfig,buildSearchQuery:"$params = [\n 'index' => 'books',\n 'body' => [\n 'q' => 'snow'\n ]\n];\n\n$response = $client->search($params);\nprint_r($response->asArray());",configureClient:({url:e,apiKey:n})=>`$client = ClientBuilder::create()\n ->setHosts(['${e}'])\n ->setApiKey('${n}')\n ->build();`,docLink:i.a.phpClient,github:{link:"https://github.com/elastic/elasticsearch-serverless-php",label:s.i18n.translate("xpack.serverlessSearch.languages.php.githubLink",{defaultMessage:"elasticsearch-serverless-php"})},iconType:"php.svg",id:a.e.PHP,ingestData:"$params = [\n'body' => [\n[\n'index' => [\n'_index' => 'books',\n'_id' => '9780553351927',\n],\n],\n[\n'name' => 'Snow Crash',\n'author' => 'Neal Stephenson',\n'release_date' => '1992-06-01',\n'page_count' => 470,\n],\n[\n'index' => [\n'_index' => 'books',\n'_id' => '9780441017225',\n],\n],\n[\n'name' => 'Revelation Space',\n'author' => 'Alastair Reynolds',\n'release_date' => '2000-03-15',\n'page_count' => 585,\n],\n[\n'index' => [\n'_index' => 'books',\n'_id' => '9780451524935',\n],\n],\n[\n'name' => '1984',\n'author' => 'George Orwell',\n'release_date' => '1985-06-01',\n'page_count' => 328,\n],\n[\n'index' => [\n'_index' => 'books',\n'_id' => '9781451673319',\n],\n],\n[\n'name' => 'Fahrenheit 451',\n'author' => 'Ray Bradbury',\n'release_date' => '1953-10-15',\n'page_count' => 227,\n],\n[\n'index' => [\n'_index' => 'books',\n'_id' => '9780060850524',\n],\n],\n[\n'name' => 'Brave New World',\n'author' => 'Aldous Huxley',\n'release_date' => '1932-06-01',\n'page_count' => 268,\n],\n[\n'index' => [\n'_index' => 'books',\n'_id' => '9780385490818',\n],\n],\n[\n'name' => 'The Handmaid's Tale',\n'author' => 'Margaret Atwood',\n'release_date' => '1985-06-01',\n'page_count' => 311,\n],\n],\n];\n\n$response = $client->bulk($params);\necho $response->getStatusCode();\necho (string) $response->getBody();",ingestDataIndex:({apiKey:e,url:n,indexName:t})=>`$client = ClientBuilder::create()\n ->setHosts(['${n}'])\n ->setApiKey('${e}')\n ->build();\n\n$params = [\n'body' => [\n[\n'index' => [\n'_index' => '${null!=t?t:c.c}',\n'_id' => '1',\n],\n],\n[\n'name' => 'foo',\n'title' => 'bar',\n],\n],\n];\n\n$response = $client->bulk($params);\necho $response->getStatusCode();\necho (string) $response->getBody();\n`,installClient:"composer require elasticsearch/elasticsearch",name:s.i18n.translate("xpack.serverlessSearch.languages.php",{defaultMessage:"PHP"}),testConnection:"$response = $client->info();\necho $response->getStatusCode();\necho (string) $response->getBody();"},d={apiReference:i.a.pythonApiReference,basicConfig:i.a.pythonBasicConfig,buildSearchQuery:'client.search(index="books", q="snow")',configureClient:({url:e,apiKey:n})=>`from elasticsearch import Elasticsearch\n\nclient = Elasticsearch(\n "${e}",\n api_key="${n}"\n)`,docLink:i.a.pythonClient,github:{link:"https://github.com/elastic/elasticsearch-serverless-python",label:s.i18n.translate("xpack.serverlessSearch.languages.python.githubLabel",{defaultMessage:"elasticsearch-serverless-python"})},iconType:"python.svg",id:a.e.PYTHON,ingestData:'documents = [\n { "index": { "_index": "books", "_id": "9780553351927"}},\n {"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470},\n { "index": { "_index": "books", "_id": "9780441017225"}},\n {"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585},\n { "index": { "_index": "books", "_id": "9780451524935"}},\n {"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328},\n { "index": { "_index": "books", "_id": "9781451673319"}},\n {"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227},\n { "index": { "_index": "books", "_id": "9780060850524"}},\n {"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268},\n { "index": { "_index": "books", "_id": "9780385490818"}},\n {"name": "The Handmaid\'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311},\n]\n\nclient.bulk(operations=documents)',ingestDataIndex:({apiKey:e,url:n,indexName:t})=>`from elasticsearch import Elasticsearch\n\nclient = Elasticsearch(\n "${n}",\n api_key="${e}"\n)\n\ndocuments = [\n {"index": {"_index": "${null!=t?t:c.c}"}},\n {"name": "foo", "title": "bar"},\n]\n\nclient.bulk(operations=documents)\n`,installClient:"python -m pip install elasticsearch\n\n# If your application uses async/await in Python you can install with the async extra\n# python -m pip install elasticsearch[async]\n ",name:s.i18n.translate("xpack.serverlessSearch.languages.python",{defaultMessage:"Python"}),testConnection:"client.info()"},p={apiReference:i.a.rubyExamples,buildSearchQuery:"client.search(index: 'books', q: 'snow')",configureClient:({url:e,apiKey:n})=>`client = ElasticsearchServerless::Client.new(\n api_key: '${n}',\n url: '${e}'\n)\n`,basicConfig:i.a.rubyBasicConfig,docLink:i.a.rubyClient,github:{link:"https://github.com/elastic/elasticsearch-serverless-ruby",label:s.i18n.translate("xpack.serverlessSearch.languages.ruby.githubLabel",{defaultMessage:"elasticsearch-serverless-ruby"})},iconType:"ruby.svg",id:a.e.RUBY,ingestData:'documents = [\n { index: { _index: \'books\', data: {name: "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470} } },\n { index: { _index: \'books\', data: {name: "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585} } },\n { index: { _index: \'books\', data: {name: "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328} } },\n { index: { _index: \'books\', data: {name: "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227} } },\n { index: { _index: \'books\', data: {name: "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268} } },\n { index: { _index: \'books\', data: {name: "The Handmaid\'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311} } }\n]\nclient.bulk(body: documents)',ingestDataIndex:({apiKey:e,url:n,indexName:t})=>`client = ElasticsearchServerless::Client.new(\n api_key: '${e}',\n url: '${n}'\n)\n\ndocuments = [\n { index: { _index: '${null!=t?t:c.c}', data: {name: "foo", "title": "bar"} } },\n]\nclient.bulk(body: documents)\n`,installClient:"# Requires Ruby version 3.0 or higher\n\n# From the project's root directory:$ gem build elasticsearch-serverless.gemspec\n$ gem install elasticsearch-serverless-x.x.x.gem",name:s.i18n.translate("xpack.serverlessSearch.languages.ruby",{defaultMessage:"Ruby"}),testConnection:"client.info"},h={[a.e.CURL]:r,[a.e.PYTHON]:d,[a.e.JAVASCRIPT]:l.a,[a.e.PHP]:u,[a.e.GO]:o,[a.e.RUBY]:p},g=Object.values(h)},function(e,n,t){var a,s=function(){var e=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",a={};function s(e,n){if(!a[e]){a[e]={};for(var t=0;t>>8,t[2*a+1]=r%256}return t},decompressFromUint8Array:function(n){if(null==n)return i.decompress(n);for(var t=new Array(n.length/2),a=0,s=t.length;a>=1}else{for(s=1,a=0;a>=1}0==--d&&(d=Math.pow(2,h),h++),delete o[u]}else for(s=r[u],a=0;a>=1;0==--d&&(d=Math.pow(2,h),h++),r[c]=p++,u=String(l)}if(""!==u){if(Object.prototype.hasOwnProperty.call(o,u)){if(u.charCodeAt(0)<256){for(a=0;a>=1}else{for(s=1,a=0;a>=1}0==--d&&(d=Math.pow(2,h),h++),delete o[u]}else for(s=r[u],a=0;a>=1;0==--d&&(d=Math.pow(2,h),h++)}for(s=2,a=0;a>=1;for(;;){if(x<<=1,b==n-1){g.push(t(x));break}b++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:i._decompress(e.length,32768,(function(n){return e.charCodeAt(n)}))},_decompress:function(n,t,a){var s,i,r,o,l,c,u,d=[],p=4,h=4,g=3,x="",b=[],f={val:a(0),position:t,index:1};for(s=0;s<3;s+=1)d[s]=s;for(r=0,l=Math.pow(2,2),c=1;c!=l;)o=f.val&f.position,f.position>>=1,0==f.position&&(f.position=t,f.val=a(f.index++)),r|=(o>0?1:0)*c,c<<=1;switch(r){case 0:for(r=0,l=Math.pow(2,8),c=1;c!=l;)o=f.val&f.position,f.position>>=1,0==f.position&&(f.position=t,f.val=a(f.index++)),r|=(o>0?1:0)*c,c<<=1;u=e(r);break;case 1:for(r=0,l=Math.pow(2,16),c=1;c!=l;)o=f.val&f.position,f.position>>=1,0==f.position&&(f.position=t,f.val=a(f.index++)),r|=(o>0?1:0)*c,c<<=1;u=e(r);break;case 2:return""}for(d[3]=u,i=u,b.push(u);;){if(f.index>n)return"";for(r=0,l=Math.pow(2,g),c=1;c!=l;)o=f.val&f.position,f.position>>=1,0==f.position&&(f.position=t,f.val=a(f.index++)),r|=(o>0?1:0)*c,c<<=1;switch(u=r){case 0:for(r=0,l=Math.pow(2,8),c=1;c!=l;)o=f.val&f.position,f.position>>=1,0==f.position&&(f.position=t,f.val=a(f.index++)),r|=(o>0?1:0)*c,c<<=1;d[h++]=e(r),u=h-1,p--;break;case 1:for(r=0,l=Math.pow(2,16),c=1;c!=l;)o=f.val&f.position,f.position>>=1,0==f.position&&(f.position=t,f.val=a(f.index++)),r|=(o>0?1:0)*c,c<<=1;d[h++]=e(r),u=h-1,p--;break;case 2:return b.join("")}if(0==p&&(p=Math.pow(2,g),g++),d[u])x=d[u];else{if(u!==h)return null;x=i+i.charAt(0)}b.push(x),d[h++]=i+x.charAt(0),i=x,0==--p&&(p=Math.pow(2,g),g++)}}};return i}();void 0===(a=function(){return s}.call(n,t,n,e))||(e.exports=a)},function(e,n,t){switch(window.__kbnThemeTag__){case"v8dark":return t(36);case"v8light":return t(38)}},function(e,n,t){var a=t(25),s=t(37);"string"==typeof(s=s.__esModule?s.default:s)&&(s=[[e.i,s,""]]);a(s,{insert:"head",singleton:!1}),e.exports=s.locals||{}},function(e,n,t){(n=t(26)(!1)).push([e.i,".serverlessSearchCodeBoxPanel{border-top:1px solid #343741}",""]),e.exports=n},function(e,n,t){var a=t(25),s=t(39);"string"==typeof(s=s.__esModule?s.default:s)&&(s=[[e.i,s,""]]);a(s,{insert:"head",singleton:!1}),e.exports=s.locals||{}},function(e,n,t){(n=t(26)(!1)).push([e.i,".serverlessSearchCodeBoxPanel{border-top:1px solid #d3dae6}",""]),e.exports=n},function(e,n,t){var a=t(25),s=t(41);"string"==typeof(s=s.__esModule?s.default:s)&&(s=[[e.i,s,""]]);a(s,{insert:"head",singleton:!1}),e.exports=s.locals||{}},function(e,n,t){(n=t(26)(!1)).push([e.i,".serverlessSearchSelectClientPanelSelectedBorder{border:1px solid #36a2ef}.serverlessSearchSelectClientPanelBorder{border:1px solid #343741}",""]),e.exports=n},function(e,n,t){var a=t(25),s=t(43);"string"==typeof(s=s.__esModule?s.default:s)&&(s=[[e.i,s,""]]);a(s,{insert:"head",singleton:!1}),e.exports=s.locals||{}},function(e,n,t){(n=t(26)(!1)).push([e.i,".serverlessSearchSelectClientPanelSelectedBorder{border:1px solid #07c}.serverlessSearchSelectClientPanelBorder{border:1px solid #d3dae6}",""]),e.exports=n}])]);