Skip to content

Latest commit

 

History

History

enterprise-search-universal

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Elastic Enterprise Search

js-standard-style Build Status. Universal CI

Official universal JavaScript client for Elastic App Search and Workplace Search.

ℹ️ This client is not yet released (not yet in beta phase)

Install

npm install @elastic/enterprise-search-universal

Quick start

This module expects to find the fetch API in the global environment, if you need to use it in Node.js as well, you can add it with cross-fetch.

const { Client } = require('@elastic/enterprise-search-universal')
const client = new Client({
  url: 'http://localhost:3002',
  token: 'my-token'
})

// App Search API
const response = await client.app.search({
  engine_name: 'games',
  body: {
    query: 'Pack-Man'
  }
})
console.log(response)

// Workplace Search API
const response = await client.workplace.getDocument({
  content_source_id: 'test',
  document_id: 'id'
})
console.log(response)

License

This software is licensed under the Apache 2 license.