Giter Site home page Giter Site logo

novaway / elasticsearch-client Goto Github PK

View Code? Open in Web Editor NEW
5.0 9.0 7.0 265 KB

A lightweight PHP 7.0+ client for Elasticsearch, providing features over Elasticsearch-PHP

License: MIT License

PHP 81.64% Gherkin 17.50% Makefile 0.46% Shell 0.40%
library elasticsearch php elasticsearch-php

elasticsearch-client's People

Contributors

2brito avatar cheaphasz avatar delphiki avatar ouark avatar skwi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elasticsearch-client's Issues

Multiple filters don't work on 1.7 | Missing BoolFilter and BoolQuery support

As soon as the filterCollection has more than one filter set, the filtering doesn't seem to work on 1.7.

I was able to obtain the desired result by replacing

            $this->queryBody['query']['filtered']['filter'] = $this->filterCollection;

by

            if (count($this->filterCollection) > 1) {
                $this->queryBody['query']['filtered']['filter']['bool']['must'] = $this->filterCollection;
            } else {
                $this->queryBody['query']['filtered']['filter'] = $this->filterCollection;
            }

Which seem to indicate that a BoolFilter is a good solution to that problem.

I'm not convinced that this is a good solution to the problem at hand, it seems a bit too magical and rigid.

But we could use support for BoolFilter in this branch and BoolQuery in all branches.

Optional type parameter

public function execute(array $queryBody, string $type, ResultTransformer $resultTransformer = null): Result
{
return $this->index->search([
'type' => $type,
'body' => $queryBody
], $resultTransformer);
}

Do you think the parameter $type could be optional in order to make search over multiple types of document ? Or do you have another way to do such kind of search ?

Update the release tags

The release tags are not up to date, it could be interesting to follow the ES versions, the way elasticsearch-php does.

It would make it easier to know which version of the lib to use with the version of ES used.

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.