Questions tagged [elastica]

Elastica is a PHP client for the elasticsearch full-text search and analytics engine.

Filter by
Sorted by
Tagged with
0 votes
1 answer
56 views

Elastica get all results order by matched

I am newer with elastica and i would like to get all products but sorting by favorites, in my mode : poductDocument, i added a collection field to store the ids of users how added this product to ...
  • 217
0 votes
2 answers
95 views

How to add "runtime_mappings" to the query for FOS/Elastica in PHP?

Need to add the next json query to php code with using FOSElasticaBundle: "runtime_mappings": { "Agreement": { "type": "keyword", "script": {...
  • 41
0 votes
0 answers
32 views

Elastica search Php - Can't able to search extact field "iDEAS-App Engineering"

I am trying to make a search API where I have multiple fields from which I have to search, one of the field has a string/text - "iDEAS-App Engineering". I am not to search this exact filed. ...
0 votes
1 answer
340 views

Elastica searches the elasticsearch index, but gives entity from mysql

I am using FOS Elastica. I indexed a page from mysql with title Homez with the command 'php bin/console fos:elastica:populate'. Then I changed the title in mysql to Homek. But when I search a page ...
  • 359
0 votes
0 answers
545 views

Class not found when using external library

I just deployed a fresh version of CI4 and I'm trying to get used to the new features and changes. I took some legacy code from a CI3 based application and started to upgrade it. This legacy code uses ...
  • 1
0 votes
1 answer
453 views

FOS Elastica bundle populate command killed by oom_reaper with out of memory

There are 1,8 million records in the database table that I want to index through the fos:elastica:populate command. As soon as ~500.000 documents are already in the elasticsearch the indexing stops ...
0 votes
1 answer
255 views

CakePHP 4, AWS Elasticsearch 7 - The security token included in the request is invalid

So I'm running CakePHP 4 on an EC2 instance, AWS ES 7 and I've setup the ElasticSearch plugin in CakePHP. composer require cakephp/elastic-search "^3.0" I've added the elastic datasource ...
  • 108
1 vote
1 answer
97 views

Elasticsearch - Research that returns too many bad results

I have an elasticsearch that works but it is really too large, it gives me too many results on terms that have nothing to do with it. I'm looking for a way to refine these results. On a sample of fake ...
  • 852
1 vote
1 answer
101 views

Nested Term ElasticSearch 7 problem / Elastica Don't work - BEGINNER

I'm trying to get exact search with slug in nested element in ElasticSearch but it seems like that it doesn't work. So when i'm trying a simple nested match with "my-slug" i get result with &...
1 vote
0 answers
189 views

How to do FOSElasticaBundle bulk index?

It seems that the default doctrine listener used by FOSElasticaBundle does not support bulk index by default. I have an application where I want to add support for more complex search queries through ...
0 votes
0 answers
205 views

Composer installing wrong version of ElasticSearch

I am requiring "elasticsearch/elasticsearch": "^7.1.1" in my Laravel project composer.json file, and when I perform "composer install" it says "- Downloading ...
0 votes
0 answers
140 views

Bifurcation diagram by C++ of the non-local elastica

I have tried to do a simulation using C++ of the equation of non-local elastica defined by the following system Using the following discretization with the boundary condition and by sitting lc=1/(6*...
1 vote
0 answers
284 views

Multiple independent Elasticsearch instances on one server

I have one VPS running two PHP applications (resp. production and test/staging environment of one application) that are using Elasticsearch. Until now I only had one cluster with one node, that was ...
0 votes
1 answer
120 views

Elastic Search / Elasica php - OR query on field containing NULL not working

How can I query only documents where location_id is null or locations.country_id is in a set of given ids? This is the current query but it doesn't return me anything at all... If I remove the ...
  • 25.5k
0 votes
1 answer
2k views

the website encountered an unexpected error. please try again later. drupal 8

I want configure elasticsearch(ES) with Drupal to integrate ES in Drupal following this tutorial In order to install ES followed steps mentioned on this link Drupal-8.8.4 search api version-8.x-1.15 ...
  • 608
2 votes
0 answers
306 views

FOS Elastica how to apply indexable_callback for level 2 entities?

Let's say, I have a "book" and an "author" entity; Then entity book has a getPublic() method that that returns "true" if the book is public. In the mapping config I use book: types: ...
  • 112
0 votes
1 answer
156 views

FOSElasticaBundle : Query matching combinaison of values

I need some help to make my elasticsearch query fully working (using version 6.8.5). I have a list of ES objects stored in my index : Object 1: name: abcd type: A tags: Tag one, Tag two ...
  • 1,118
2 votes
2 answers
11k views

ElasticSearch group by documents field and count occurences

My ElasticSearch 6.5.2 index look likes: { "_index" : "searches", "_type" : "searches", "_id" : "cCYuHW4BvwH6Y3jL87ul", "_score" : 1.0, "_source" : { "querySearched" : ...
  • 518
0 votes
1 answer
293 views

Ruflin/Elastica bulk insert without update

I have a code which needs to insert a huge among of data BUT ONLY if doc _id does not exists in the index. I found something like this: foreach($item as $i) { $elasticBulk[] = new \Elastica\...
  • 3,465
1 vote
1 answer
2k views

Elasticsearch query apply range if the field exists

My index has a "valid_until" field, which may be either null or a valid datetime. I want to write a query to get all documents from the index and apply a range filter only if "valid_until" has a valid ...
  • 421
0 votes
0 answers
120 views

Root mapping definition has unsupported parameters:

Error while run php app/console fos:elastica:populate I try to run php app/console fos:elastica:populate Configuration: "friendsofsymfony/elastica-bundle": "^5.1" fos_elastica.yml: fos_elastica: ...
0 votes
0 answers
464 views

Elasticsearch 6: Failed to parse date with milliseconds

I'm generating the date via php using the Chronos library. It's using the formatting syntax php uses. Elasticsearch is version 6.2.4. To connect with the ES server I'm using Elastica. I keep getting ...
  • 25.5k
3 votes
0 answers
685 views

Php Elastica - how to resolve - No enabled connection error - in long cycle

I have a php console script which processes long array in foreach cycle and send Elasticsearch bulks to database. I need to solve case if bulk insert fails on connection error like: No enabled ...
  • 3,465
1 vote
0 answers
251 views

FOSElastica don't recognize my ElasticSearch username and password

I've setup users and roles on my ElasticSearch and while it works like a charm with curl it doesn't seem to work through FOSElastica. I'm using it to populate my ElasticSearch indices. I've tried to ...
1 vote
2 answers
1k views

Elasticsearch\RuntimeException: Failed to JSON encode: 5 in file /Elasticsearch/Serializers/SmartSerializer.php on line 33

I am trying to run a project that uses elasticsearch on my computer. But at the point that the API. Queries something from elasticsearch I get the following error and the query does not execute: ...
  • 1,363
6 votes
2 answers
16k views

Error in bulk request : [arg] cannot be changed from type [long] to [float]

I'm having trouble with the FOSElastica bundle config. I use the JMS Serializer, and I try to add objects which have fields which contains literally a json array. But, when I try to populate some of ...
1 vote
0 answers
809 views

Error in bulk request : index : ... caused failed to parse

I'm having trouble with the FOSElastica bundle config. I'm trying to use the Symfony serializer to populate Elastic search with FOSElastica, and it works well for simple objects which don't need to ...
0 votes
1 answer
195 views

Search result in Symfony project with Elasticsearch

Problem: I have the following problem. I'm able to search through my data with the SKU. But since there are multiple distributors I want to filter on SKU & distributor. But how can I do that, ...
  • 722
13 votes
2 answers
25k views

Where should I configure max_result_window index setting?

I'm trying to add to my elasticsearch.yml index.max_result_window: 10000 But the problem is it doesn't like me adding index. in the configuration (it results in an error), this was working in ...
user avatar
0 votes
0 answers
195 views

PHP Ruflin/Elastica loading without composer - Class 'Psr\Log\NullLogger' not found

I have a problem with a manually loaded (without Composer) PHP library, Ruflin/Elastica. As documentation says in include section I made a loader.php file which dynamically loads the required files. ...
  • 3,465
0 votes
1 answer
1k views

Attempted to call an undefined method named "search" of class "FOS\ElasticaBundle\Repository"

I want to use search method from elastica repository but i got error Attempted to call an undefined method named "search" of class "FOS\ElasticaBundle\Repository". I use symfony 4 with fos elastica ...
user avatar
2 votes
1 answer
2k views

Unrecognized option "mappings" under "fos_elastica.indexes.app.types.user"

I use symfony with fos elastica bundle. I'm trying add mappings like in this tutorial https://www.codevate.com/blog/14-implementing-search-as-you-type-autocomplete-with-elasticsearch-and-symfony but, ...
user avatar
2 votes
1 answer
2k views

Service "fos_elastica.finder.app.user" not found

Symfony can't find service for fos_elastica Service "fos_elastica.finder.app.user" not found: even though it exists in the app's container, the container inside "App\Controller\DevController" is a ...
user avatar
1 vote
0 answers
207 views

Ruflin/Elastica + ES6 thorws error: Content-Type header [application/x-www-form-urlencoded] is not supported

Can somebody help me please fix the problem with headers send from Ruflin/Elastica to Elasticsearch 6. It seems Ruflin/Elastica is old version which is not quite compatible with Elasticsearch 6. As I ...
  • 3,465
0 votes
1 answer
660 views

PHP Ruflin/Elastica - how to refresh index on huge data insert

I need to insert about 1.5 million documents to Elasticsearch databse. I do it via PHP library Elastica according this example (BULK example) I would like to know if it is posible to use call $...
  • 3,465
4 votes
4 answers
2k views

Search in multiple indexes in elastica

I am looking for a way to search in more than one index at the same time using Elastica. I have an index products, and an index user. products contains {product_id, product_name, price} and user ...
-4 votes
2 answers
261 views

Elastica : IN equivalent operator in Elastica

Following this question and it's answers, I'm trying to do the same but with the PHP Elastica and I wasn't successful doing it. I am trying to give my new \Elastica\Query\Terms an array and I can't ...
0 votes
1 answer
70 views

Date histogram every half a month

How to write an interval that groups by every half a month? Rather than 1M I want something like 1/2M to group by from the first to the 16th and from the 16th to the end of the month, every month. Is ...
user avatar
0 votes
1 answer
79 views

group by custom date

I want to "group by" my results by year and month using a field that has a format of YYYY-MM-DD. I want to group them by month, so with a format of YYYY-MM . I tried with a Terms aggregation to group ...
0 votes
1 answer
123 views

How can I make a generic function to reduce a nested object into a CSV style array?

I am trying to figure out how I can flatten a nested array/tree into a CSV style format. I have a result from elasticsearch which looks like the following (note - every 'buckets' property can have ...
0 votes
1 answer
321 views

Elastica not grouping aggregation before setScript

I have a type product in elasticsearch that contains a column containing multiple ids, some of them are the same. There are also columns containing current price and the quantity. I want the to get ...
0 votes
1 answer
244 views

Include 'NULL' values in filter along with range filter in Elastica

I'm using Elastica and I need to create the filter that will get NULL values along with values that lower than 100. For now my code looks like this: $this->filter = $qb->query()->bool(); $...
  • 1
0 votes
0 answers
118 views

Elastica and Json Field

I am looking for a way to map a string field of one table of a sql db to json with elastica. This field (valueFloat) contains a json representation of a large table with numerical value. The idea ...
  • 112
1 vote
2 answers
942 views

Get Elasticsearch Score in Symfony

Elasticsearch provides a score field if you do a get request via cURL. { "_index": "twitter", "_type": "tweet", "_id": "123", "_score": 4.2, "firstName": "Max" "lastName": "Mustermann" } ...
  • 617
1 vote
1 answer
516 views

Elastica, KNP Paginator and Resultset > 10000

Pagination works fine even for large Results. It even shows that there are 25k Results for the Query. Pagination works fine for the first 10000 entries. Though, if i want to display entry 10000 - ...
user avatar
1 vote
0 answers
245 views

How to integrate elasticsearch with sonata-admin bundle

Hi everyone I'm using SonataAdminBundle and I want to integrate Elasticsearch in order to improve performance. I have setup the elasticsearch and I have configured the fos_elastica. I have one ...
0 votes
1 answer
1k views

FOS elastica bundle 4.* - automatic index entity does not work

I'm currently trying to let the FOS Elastica bundle to automatically update the index when there are new entries with the following settings: fos_elastica: clients: default: { host: localhost, ...
0 votes
1 answer
593 views

php elastica: how to set username / password?

I'm using ruflin/elastica 6.0.1 library, but didn't find a way to set username / password params for connection. I've tried to set it in host url like this: https://username:password@host.com but ...
  • 8,595
0 votes
1 answer
408 views

Group by in Elastica PHP?

There's absolutely no documentation about a group by in Elastica. Any idea if such aggregation exists? I've seen that it's possible to do it using a raw query, but I can't combine raw query results ...
user avatar
0 votes
2 answers
2k views

Elastic search crashes with large data

So I've got a query that gives me as a result 500 hundred thousand data, and then I loop on it to add 20 documents for each result. Elastic search becomes not responding (the page keeps loading ...
user avatar

1
2 3 4 5 6