GithubHelp home page GithubHelp logo

pombredanne / suche Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sachin-philip/suche

0.0 0.0 0.0 11 KB

Elasticsearch Export Framework

License: BSD 2-Clause "Simplified" License

Python 100.00%

suche's Introduction

Suche

An Elasticsearch Export Framework

Documentation

Installation

pip install suche

You need to have elasticsearch installed and running. More info: https://www.elastic.co/

Basic Usage

from suche import Suche
suche = Suche(elastic_address, elastic_port, index)

elastic_address: address for elasticsearch (optional)

elastic_port: port number for elasticsearch (optional)

index: index name of elasticsearch

Specific Functions

Change Index

suche.set_index(index)

index: index name of elasticsearch

Configuration Options

ELASTIC_ADDRESS: Address to elasticsearch

ELASTIC_PORT: elasticsearch port

Either, create a configuration file with name suche_config.json in the pwd, like below

{
  "ELASTIC_ADDRESS": "localhost",
  "ELASTIC_PORT": 9200,
  "SUCHE_OUTPUT": ""
}

or

create Suche objects with custom configuration options required as shown below

suche = Suche(elastic_address="localhost", elastic_port=9300, 
    index="default")

Input Format For query

####The query input should be on below json Format for FilterData.

    {
        "key": "name",
        "query": "atm"
     }

####The query input should be on below json Format for MultiFilter Data.

    [
        {
            "key": "name",
            "query": "atm"
        },
        {
            "key": "name",
            "query": "almy"
        }
     ]

Advanced Features

AllData

suche.allData(doc_type = "person", fields= ["email", "name"], output_format= 'csv')

Matches all data in the doc type doc_type and filter data in accordance to fields and return output_format

Currently available output_format : csv and pickle

FilterData

Filtering takes a single json string to process

suche.filterData(doc_type="person", match_json = { "key": "is_custom_domain", "query": "false" }, 
                fields = ["email", "name", "current_location"], output_format= 'pkl')
  • Follow input format

Matches data in the doc type doc_type, match_json and filter data in accordance to fields and return output_format

MultiFilter Data

multifiltering takes a dict with multiple json to process output

suche.multiMatch(doc_type="person", multiple_match = [{ "key": "data", "query": "false" }, { "key": "country", "query": "India" }],
                fields = ["email", "name", "current_location"], output_format= 'pkl')
  • Follow input format

Matches data in the doc type doc_type, multiple_match and filter data in accordance to fields and return output_format

suche's People

Contributors

sachin-philip avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.