lennon

command module
v0.0.0-...-01e6a36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 11 Imported by: 0

README

lennon

Go utility for ElasticSearch and Bleve

Status

  • ElasticSearch support
  • Bleve support
  • Index a document file
  • Index a folder with documents
  • Delete indexes
  • Search
  • Batch support
  • KV Store support for Bleve (LevelDB and BoltDB)

Prerequisite

  • ElasticSearch installed and running - not relevant when using Bleve

Install

  • go get -u -t -v github.com/dorsha/lennon
  • go get ./...
  • [optional] go install (from the root directory)

Usage

lennon --help

Index a given document
lennon -vendor <elastic/bleve> -action index -document <path_to_document> [-url <es_engine_url>] [-store <boltdb/goleveldb>]

Index documents inside folder
lennon -vendor <elastic/bleve> -action index -folder <path_to_folder> [-url <es_engine_url>] [-store <boltdb/goleveldb>]

Search in the indexed document
lennon -vendor <elastic/bleve> -action search -query <search_query> [-url <es_engine_url>] [-store <boltdb/goleveldb>]

Delete index
lennon -vendor <elastic/bleve> -action deleteIndex [-url <es_engine_url>] [-store <boltdb/goleveldb>]

Examples (without running go install)

ElasticSearch

Index person.json file
go run lennon.go -vendor elastic -action index -url http://192.168.1.26:9200 -document samples/persons.json

Search for a person
go run lennon.go -vendor elastic -action search -url http://192.168.1.26:9200 -query john

Delete the index
go run lennon.go -vendor elastic -action deleteIndex -url http://192.168.1.18:9200

Bleve

Index person.json file (LevelDB)
go run lennon.go -vendor bleve -action index -document samples/persons.json

Index person.json file (BoltDB)
go run lennon.go -vendor bleve -action index -document samples/persons.json -store boltdb

Search for a person (LevelDB)
go run lennon.go -vendor bleve -action search -query john

Delete the index (LevelDB)
go run lennon.go -vendor bleve -action deleteIndex

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL