GithubHelp home page GithubHelp logo

priestd09 / coldfusion-elasticsearch-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jasonfill/coldfusion-elasticsearch-client

0.0 0.0 0.0 220 KB

Full featured CFML client for ElasticSearch.

License: Apache License 2.0

coldfusion-elasticsearch-client's Introduction

IMPORTANT NOTES

Please feel free to submit additional code to enhance this project. The goal is to create a full featured ElasticSearch client for ColdFusion, Railo, BlueDragon, and any other CFML engine.

Before proceeding, please keep in mind that this library is:

  • Still under development and should be considered as a BETA at this time.
  • Has only been tested with Railo 4+
  • Developed with ElasticSearch 0.90.3

Introduction

Currently a semi-full featured client for ElasticSearch. This library uses all native ColdFusion/Railo/BlueDragon code, no additional jars required for communication. All interactions with the ElasticSearch cluster are done through the ElasticSearch REST interface.

Supported Queries

  • Boolean
  • Id
  • Match
  • MatchAll
  • MultiMatch
  • Nested
  • Prefix
  • Range
  • RegEx
  • Term
  • Terms

Supported Filters

  • Boolean
  • Exists
  • Ids
  • Limit
  • MatchAll
  • Missing
  • Not
  • Numeric Range
  • Or
  • Prefix
  • Query
  • Range
  • Term
  • Terms
  • Type

Supported Facets

  • Date Histogram
  • Filter
  • Histogram
  • Range
  • Statistical
  • Terms
  • Terms Stats

Getting Started

// Cluster Connection
	// allows for connecting to multiple clusters.

	ClusterManager = new ClusterManager()
							.addNode(new lib.NodeConfig(host="Node1", port="9200", secure=true))
							.addNode(new lib.NodeConfig(host="Node2", port="9200", secure=true))

// Create the ElasticSearchClient which serves as the factory for the library.
	es = new ElasticSearchClient(ClusterManager);

// Example Get Request
	GetResponse = es.prepareGet("MyIndex","MyType","MyId").execute();

// Example Index
	IndexResult = es.prepareIndex("MyIndex","MyType","MyId")
						.setBody('{"status":"Hello World"}')
						.execute();

// Example Boolean Search
	qb = es.queryBuilder();
	Query = qb.BoolQuery()
				.mustNot(qb.rangeQuery("age")
							.from(10)
							.to(20))
				.must(qb.termQuery("user", "kimchy"))
				.should(qb.termQuery("tag", "wow"))
				.minMatch(1)
				.boost(1.0);

	SearchResponse = es.prepareSearch("MyIndex")
						.setTypes("MyType")
						.setQuery(Query)
						.setFrom(0)
						.setSize(20)
						.execute();

coldfusion-elasticsearch-client's People

Contributors

jasonfill 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.