Questions tagged [elastica]

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

0
votes
0answers
17 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 ...
0
votes
0answers
26 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: ...
0
votes
0answers
21 views

Ruflin Elastica RandomScore and setSort

I have this query $boolQuery = new \Elastica\Query\BoolQuery(); $visibleQuery = new \Elastica\Query\Terms(); $visibleQuery->setTerms('visibleAndNotDeleted', array(true)); $boolQuery->addMust($...
1
vote
1answer
40 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
0answers
59 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
1answer
52 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, ...
0
votes
0answers
27 views

Combine get aggregations with scroll API

I used to get the results of a search like so : $search->setQuery($query); $results = $search->search()->getAggregations(); But now I'm using the scroll API : $search->getQuery()->...
0
votes
1answer
56 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 ...
0
votes
0answers
17 views

ES2 to ES 6 elastica migrate query builder

I'm trying to migrate the query builder's filter() function which is deprecated in the recent versions of elastica to the query() function. So the final goal is to migrate this code : $qb = new \...
0
votes
0answers
9 views

Type integer with analyzer standard [duplicate]

I'm migrating from ES2 to ES6. I've got these definitions I'm looking to migrate : '1' => array('type' => 'string', 'analyzer' => 'autocomplete', 'norms' => array('enabled' => false)),...
0
votes
0answers
20 views

Composite Aggregations with PHP Elastica

Does Elastica support Composite Aggregations, as per the Elasticsearch documentation: https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-aggregations-bucket-composite-aggregation....
0
votes
0answers
39 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. ...
0
votes
1answer
110 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 ...
0
votes
1answer
166 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, ...
0
votes
1answer
139 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 ...
1
vote
0answers
50 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 ...
0
votes
0answers
24 views

Check if elasticsearch is adding documents

I have a page that gets from an API source elasticsearch results. I want to be able, when I re-run the elasticsearch mapping, to show them a "This mapping is currently being rewritten" message or ...
0
votes
0answers
32 views

check if a field exists depending on date

I'm using elastica PHP. I have a PHP field called $old_clients that is equal to 1 if the client ordered a product before, and equal to 2 if not thus a new client. I want to show the results of only ...
0
votes
1answer
106 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 $...
4
votes
4answers
296 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 ...
-3
votes
2answers
82 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
1answer
35 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 ...
1
vote
1answer
39 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
1answer
44 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
1answer
103 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
1answer
45 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(); $...
0
votes
0answers
47 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 ...
1
vote
2answers
207 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" } ...
0
votes
1answer
105 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 - ...
1
vote
0answers
92 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
1answer
309 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
1answer
59 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:[email protected] but ...
0
votes
1answer
144 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 ...
0
votes
2answers
346 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 ...
0
votes
1answer
231 views

ruflin elastica how to use _source to get certain fields

how to use _source to get certain fields in ruflin elastica. please suggest how to use it. For Ex: { "_source": {"user", "message"}, "query" : { "term" : { "user" : "kimchy" } } } How can i ...
0
votes
1answer
31 views

Filtering by 2 field values in elastic?

I am not sure how to best word this question, so I will just use MySQL example. So in MySQL, I can write query like so: SELECT * FROM some_table WHERE some_field >= some_other_field What query ...
0
votes
1answer
133 views

illegal latitude value for [GeoDistanceSort] in Elasticsearch

Having an issue with geo distance sorting with elasticsearch where an error is being returned when attempting to define the location pin. Using the Elastica PHP client. $base->addSort([ '...
0
votes
0answers
270 views

Exact search query with Elastica QueryBuilder

I'm having a problem with an Elastica QueryBuilder exact search in a Symfony app. The Elastica version is 2.1, which depends on Elasticsearch 1.5.2. I'm searching an index where one of the fields is ...
0
votes
0answers
72 views

next word suggestion api in autocomplete elasticsearch query

I am implementing auto suggestion in elasticsearch using elastica library. When users search for "grinder", elasticsearch populates suggestions like "grinder mixer", "grinder machine", "grinder in ...
0
votes
1answer
104 views

Elasticsearch Filtered Bool Query

I am running into some serious Problems with a custom Search. All i want is a Wildcard Search in three Fields and the Result should to filtered by another field. In Elastica it results in this Query: ...
1
vote
1answer
199 views

Circular reference detected when using fos:elastica:populate

I was until now using the Groups annotation to serialize and populate my Elastic search index, and it was working fine as it was only using the fields in the group "elastica", and only for the ...
0
votes
0answers
178 views

elasticsearch/elastica limit nested results

is it possible to limit the results from a nested field ? I have shop owners and shops and for my search results i want to get only 2 shops and not all elements from a owner. my setup is ...
0
votes
1answer
315 views

FOSElasticaBundle: Setting analyzer for custom properties

I am using the FOSElasticaBundle in Symfony 3.3. I have registered an event listener on the POST_TRANSFORM event that computes and adds a custom property like this: public function addCustomProperty(...
0
votes
1answer
121 views

Elasticsearch connect range and term to same array item

I have a user document with a field called experiences which is an array of objects, like: { "experiences": [ { "end_date": "2017-03-02", "is_valid": false }, { "...
1
vote
0answers
35 views

Search within previous resultset of elasticsearch?

I have question about elasticsearch. I am using php elastica library. If i search with keyword shirt it gave me 5000 records out of 10000. Now when i insert another keyword in search box like blue, it ...
0
votes
0answers
183 views

How to index thousands sub-objects?

I've somethinh like it: MainObject ~3000x SubObjects Each sub ojects have ~2 SubSubObjects Idem: ~1 SubSubSubObject For each subOject I need to get a mainObject information (array of integer), ...
1
vote
1answer
368 views

Filtering global aggregation in Elastica

I have elastic query built with ruflin/Elastica, with global aggregation. Is it possible to somehow add some filters to it, separate from my main query. It looks like so: $query = new Query($...
2
votes
2answers
564 views

Resetting indexes with ruflin/elastica throws HttpException on heroku

I'm using elasticsearch in a Symfony project with FOSElasticaBundle, that requires ruflin/elastica client. In order to create indexes I use the command suggested in the documentation of ...
3
votes
0answers
337 views

simple match query with Elastica QueryBuilder

I try lot of thing for executing a simple Match value request in ElasticSearch with PHP - Elastica library (FosElasticaBundle). But nothing run. Do you have a idea for run correctly this kind of code :...
0
votes
1answer
79 views

elastic search aggregate doesn't return data

It possible that aggregate function returns data instead of count? Right now I get: array (size=3) 'doc_count_error_upper_bound' => int 0 'sum_other_doc_count' => int 0 'buckets' => array (...