Git Product home page Git Product logo

fazlandelasticabundle's People

Contributors

ajgarlag avatar alekitto avatar cassianotartari avatar christianriesen avatar cordoval avatar craigmarvelley avatar dafish avatar damienalexandre avatar dbu avatar fran6co avatar gimler avatar giovannialbero1992 avatar gnucki avatar jmikola avatar jseverson avatar l3l0 avatar leabaertschi avatar lsmith77 avatar merk avatar oleg-andreyev avatar ornicar avatar piotrantosik avatar richardmiller-zz avatar robertplant avatar sebastianhoitz avatar solocommand avatar stof avatar whatson avatar willdurand avatar xwb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fazlandelasticabundle's Issues

Attempted to call an undefined method named "hasFacets" of class "Elastica\ResultSet".

Hello,

Thanks for resolving last issue.

I got a new one:

I wanted to query the list of adverts that matches a search value.

Here is my repository code:

<?php

namespace Skonsoft\ModelBundle\Search;

use Fazland\ElasticaBundle\Repository as BaseRepository;
use Elastica\QueryBuilder;
use Elastica\Query\Nested;
use Elastica\Query\BoolQuery;
use Elastica\Query\MatchPhrase;

/**
 * Description of AdvertRepository
 *
 * @author skander
 */
class AdvertRepository extends BaseRepository
{

    public function getQueryBuilder($filter)
    {
        $boolQuery = new BoolQuery;

        if (isset($filter['search']) && !empty($filter['search'])) {
            $boolQuery->addShould(new MatchPhrase('title', $filter['search']));
        }

        $results = $this->finder->createPaginatorAdapter($boolQuery);

        return $results;
    }

}

And when i call the querybuilder method inside the controller with this code:

//$filter is an array containing a list of criterias,

        $repositoryManager = $this->get('fazland_elastica.manager');
        $repository = $repositoryManager->getRepository('SkonsoftModelBundle:Advert');
        $query = $repository->getQueryBuilder($filter);

        $pagination = $paginator->paginate($query, 1, self::MAX_PER_PAGE);

I got:

Attempted to call an undefined method named "hasFacets" of class "Elastica\ResultSet".

This is the stacktrace:


 in vendor/fazland/elastica-bundle/Paginator/RawPartialResults.php at line 46  -

         */
        public function getFacets()
        {
            if ($this->resultSet->hasFacets()) {
                return $this->resultSet->getFacets();
            }

at RawPartialResults ->getFacets ()
in vendor/fazland/elastica-bundle/Subscriber/PaginateElasticaQuerySubscriber.php at line 45  -

                $event->count = $results->getTotalHits();
                $event->items = $results->toArray();
                $facets = $results->getFacets();
                if (null != $facets) {
                    $event->setCustomPaginationParameter('facets', $facets);
                }


Note: I'm using ElasticSearch 2

Unrecognized options "groups, serialize_null" under "fazland_elastica.serializer"

Hello,

I followed documentation as described here

When i put jms serializer as global option, i got this error:

  [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]      
  Unrecognized options "groups, serialize_null" under "fazland_elastica.serializer"

Here is my config:

fazland_elastica:
    clients:
        default: { host: localhost, port: 9200 }
    serializer:
         groups: [elastica, Default]
         serialize_null: true
    indexes:
        app:
            index_name: %database_name% #We use the database name as index 
            types:
                country:
                    persistence:
                        driver: orm # orm, mongodb, propel are available
                        model:  "\\Skonsoft\\ModelBundle\\Entity\\Country"
                        provider: ~

Incompatible declaration in Fazland\ElasticaBundle\Elastica\Client:16

php7.0.18
symfony 2.8
fazland/elastica-bundle: dev-master
ruflin/elastica: dev-master

After commit:
ruflin/Elastica@3e3a1af
getting warning:

ContextErrorException in Client.php line 16:
Warning: Declaration of Fazland\ElasticaBundle\Elastica\Client::request($path, $method = Elastica\Request::GET, $data = Array, array $query = Array) should be compatible with Elastica\Client::request($path, $method = Elastica\Request::GET, $data = Array, array $query = Array, $contentType = Elastica\Request::DEFAULT_CONTENT_TYPE)

Index Manager Update API

Hi,

Really loving the new features and up-to date dependencies over FOSElastica.

I'm wondering if there is or could be an easy way to insert, update and delete documents. For example, if we were to borrow from the easy API used in FOSHttpCacheBundle for cache invalidates and refresh

http://foshttpcachebundle.readthedocs.io/en/latest/features/invalidation.html#cache-manager

Ours could be for example

$indexManager = $container->get('fazlandelastica.index_manager');

$index = $indexManager->getIndex('app');
$type = $index->getType('users');

// Update a user id
$type->updateId('1');

// Bulk Update user ids
$type->bulkUpdateIds('1,2,3,4,5');

// Or if we already have the objects to avoid re-querying

// Update a user object
$type->updateObject($user);

// Bulk Update user objects
$type->bulkUpdateObjects($users);

Or does this functionality already exist? I went through the docs and code but couldn't find such a method.

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.