Code Monkey home page Code Monkey logo

opensearch-php-dsl's Introduction

OpenSearch DSL

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

This is a fork of ongr-io/ElasticsearchDSL, which will be more regularly updated. Thanks for ongr-io for building this Library!

If you need any help, Github issues is the preferred and recommended way to ask support questions.

Test codecov Latest Stable Version Total Downloads

Version matrix

OpenSearch version OpenSearchDSL version
>= 1.0 >= 1.0
>= 2.0 >= 1.0

Documentation

The online documentation of the bundle is here

Try it!

Installation

Install library with composer:

$ composer require shyim/opensearch-php-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(); //opensearch-php client

$matchAll = new OpenSearchDSL\Query\MatchAllQuery();

$search = new OpenSearchDSL\Search();
$search->addQuery($matchAll);

$params = [
'index' => 'your_index',
'body' => $search->toArray(),
];

$results = $client->search($params);

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

opensearch-php-dsl's People

Contributors

saimaz avatar grandltu avatar einorler avatar shyim avatar mvar avatar ltrocky avatar tchiotludo avatar juliensantos87 avatar 84m avatar niels-nijens avatar tomaspocevicius avatar bcremer avatar lernhart avatar knysakpatryk avatar trandangtri avatar sbofirov avatar asev avatar j13k avatar pmishev avatar zylius avatar tw99 avatar wesolowski avatar pascalthesing avatar emgiezet avatar linasmo avatar jdreesen avatar ivannis avatar chyzas avatar ansata2001 avatar luciansabo 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.