Giter VIP home page Giter VIP logo

elasticsearch-dsl's Introduction

ElasticsearchDSL

codecov Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Fork of ongr-io/ElasticsearchDSL library with updated PHP and Elasticsearch version.

Introducing Elasticsearch DSL library to provide objective query builder for elasticsearch-php client. You can easily build any Elasticsearch query and transform it to an array.

Version matrix

Elasticsearch version ElasticsearchDSL version
>= 8.0 >= 8.0

Documentation

The online documentation of the bundle is here

Try it!

Installation

Install library with composer:

$ composer require imreish/elasticsearch-dsl

elasticsearch-php client is defined in the composer requirements, no need to install it.

Search

The library is standalone and is not coupled with any framework. You can use it in any PHP project, the only requirement is composer. Here's the example:

Create search:

 <?php
  require 'vendor/autoload.php'; //Composer autoload

  $client = ClientBuilder::create()->build(); //elasticsearch-php client
  
  $matchAll = new ONGR\ElasticsearchDSL\Query\MatchAllQuery();
  
  $search = new ONGR\ElasticsearchDSL\Search();
  $search->addQuery($matchAll);
  
  $params = [
    'index' => 'your_index',
    'body' => $search->toArray(),
  ];
  
  $results = $client->search($params);

Elasticsearch DSL covers every elasticsearch query, all examples can be found in the documentation

elasticsearch-dsl's People

Contributors

saimaz avatar grandltu avatar einorler avatar mvar avatar c0mp4ct avatar ltrocky avatar tchiotludo avatar juliensantos87 avatar niels-nijens avatar tomaspocevicius avatar bcremer avatar knysakpatryk avatar trandangtri avatar sbofirov avatar asev avatar ivannis avatar linasmo avatar emgiezet avatar pascalthesing avatar tw99 avatar zylius avatar chyzas avatar ansata2001 avatar pmishev avatar luciansabo avatar vadersv avatar ronrademaker avatar imreish avatar j13k avatar htaghizadeh 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.