Skip to content

hyper63/hyper-adapter-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

062a79c · Nov 28, 2023

History

79 Commits
Mar 2, 2022
Nov 28, 2023
Nov 28, 2023
Nov 28, 2023
Jun 17, 2021
Nov 28, 2023
Nov 28, 2023
Jul 6, 2021
Nov 28, 2023
May 24, 2023
May 24, 2023
May 24, 2023
Nov 28, 2023
Nov 28, 2023
Nov 28, 2023
Nov 28, 2023
Nov 28, 2023
May 24, 2023
May 24, 2023
May 24, 2023
May 24, 2023

Repository files navigation

hyper-adapter-elasticsearch

A Search port adapter that uses Elasticsearch to index documents for full text search in the hyper service framework

Nest Badge Test Current Version


Getting Started

import { default as elasticsearch } from 'https://x.nest.land/[email protected]/mod.js'

export default {
  app,
  adapter: [
    {
      port: 'search',
      plugins: [elasticsearch({ url: 'http://localhost:9200' })],
    },
  ],
}

Installation

This is a Deno module available to import from nest.land

deps.js

export { default as elasticsearch } from 'https://x.nest.land/[email protected]/mod.js'

Features

  • create an index in Elasticsearch
  • delete an index in Elasticsearch
  • index a document using Elasticsearch
  • retrieving an indexed document from Elasticsearch index
  • update an indexed document in Elasticsearch index
  • remove an indexed document from Elasticsearch index
  • bulk operation to index multiple docs using Elasticsearch (uses Elasticsearches bulk api)
  • query an Elasticsearch index

Methods

This adapter fully implements the Search port and can be used as the hyper Search service adapter

See the full port here

Testing

  • Spin up docker image locally
docker run \
-p 9200:9200 -p 9600:9600 \
-e "discovery.type=single-node" \
-v /workspace/hyper-adapter-elasticsearch/scripts/opensearch.yml:/usr/share/opensearch/config/opensearch.yml \
opensearchproject/opensearch:1.2.3
  • Run hyper
./scripts/hyper.sh
  • Run hyper-test

Contributing

Contributions are welcome! See the hyper contribution guide

License

Apache-2.0