fazland / fazlandelasticabundle Goto Github PK
View Code? Open in Web Editor NEWElasticsearch PHP integration for your Symfony project using Elastica
License: MIT License
Elasticsearch PHP integration for your Symfony project using Elastica
License: MIT License
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
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: ~
I think we should drop support for old Symfony versions as 2.3 reached the end of maintenance
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)
How I understand there are no problems with merging this PR https://github.com/FriendsOfSymfony/FOSElasticaBundle/pull/1171/files
That brings support of ES 5.
That will be great if you merge it.
Hello,
I use symfony, where is doc for option "_parent" ??
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.
For now I get "Version of dependencies should be fixed" issue from https://insight.sensiolabs.com/what-we-analyse/composer.unfixed_dependency_version in my project.
Please make release tag for current version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.