Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

searchkit-express

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

searchkit-express

A thin library to create an express to elasticsearch proxy to support the searchkit ui framework

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-63.33%
Maintainers
2
Weekly downloads
 
Created
Source

Searchkit Express

A thin library to create an express to elasticsearch proxy to support the searchkit ui framework

npm install searchkit-express --save
var SearchkitExpress = require("searchkit-express")
Add _search, _msearch endpoints to root url

if you just want to create a proxy to the root express url then use the SearchkitExpress function directly like this

var app = express()
//...

SearchkitExpress({
  host:process.env.ELASTIC_URL || "http://localhost:9200",  
  index:'movies',
  queryProcessor:function(query, req, res){
    //do neccessery permissions, prefilters to query object
    //then return it
    return query
  }
 }, app)

then in your Clientside UI code

const searchkit = new SearchkitManager("/")
Alternative express router

If you wish to get hold of an express.Router instance so you can configure the suburl and add specific express middleware; use as follows

var app = express()

//...

var searchkitRouter = SearchkitExpress.createRouter({
  host:process.env.ELASTIC_URL || "http://localhost:9200",  
  index:'movies',
  maxSockets:500, // defaults to 1000
  queryProcessor:function(query, req, res){
    console.log(query)    
    return query
  }
 })
app.use("/movie-search", searchkitRouter)

then in your Clientside UI code

const searchkit = new SearchkitManager("/movies-search")
Debugging

To enable debugging, enable debugging by setting environment variable when starting your server.

DEBUG=SearchkitExpress node server.js

FAQs

Package last updated on 08 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc