Questions tagged [elastica]

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

Introduction

Elastica is open source and you can download or clone the source code on Github from ruflin/Elastica.

You can find the complete API here.

Requirements

Elastica v.0.20.5 require PHP 5.3 >=, for using Elastica on PHP 5.2 let see Elastica v0.19.8

Download

You can download this project in either zip or tar formats.

The prefered way is to clone Elastica with Git by running:

$ git clone git://github.com/ruflin/Elastica

Composer

You can also install Elastica by using composer:

{
    "require": {
       "ruflin/Elastica": "dev-master"
    }
}
257 questions
1
vote
1 answer

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 "my" and "slug", Normal... GET my-index/_search { …
Titeufggg
  • 21
  • 3
1
vote
0 answers

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 ElasticSearch. The search engine only will…
1
vote
0 answers

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 shared between both apps (at port 9200). I now need…
1
vote
1 answer

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 date. Some Index Data: [ ['name' => 'book1',…
arakibi
  • 441
  • 7
  • 24
1
vote
0 answers

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 setup username and password through fos_elastica…
Malcom HAMELIN
  • 305
  • 1
  • 3
  • 11
1
vote
2 answers

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: Elasticsearch\Common\Exceptions\RuntimeException:…
TheDevWay
  • 1,363
  • 1
  • 16
  • 45
1
vote
0 answers

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 have groups of attributes, but when I try to…
Malcom HAMELIN
  • 305
  • 1
  • 3
  • 11
1
vote
0 answers

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 found out here Elasticsearch changes its behavior…
Čamo
  • 3,863
  • 13
  • 62
  • 114
1
vote
2 answers

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" } Is there a way to get this score inside symfony.…
Rob Bauer
  • 737
  • 2
  • 14
  • 24
1
vote
1 answer

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 - 10010 (for example) everything breaks with this…
user1512255
1
vote
0 answers

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 Entity for testing, and now I want to use elasticsearch…
1
vote
0 answers

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 should search in previous result-set and get…
Rahul Hedaoo
  • 153
  • 1
  • 13
1
vote
0 answers

Elasticsearch: sort documents on nested field

I have severals doc and each doc contains nested fields and I want to order by position depending on thematic id Document1 : { ... "thematics":[ { "id": 1, "position": 100 }, { "id":…
Fr0z3n7
  • 2,548
  • 2
  • 14
  • 15
1
vote
1 answer

foselasticabundle nested queries

Im using FOSElasticaBundle to integrate my symfony3 project with elasticsearch. I have a mapping similar to: company: mappings: id: { boost: 1, type: string, index: not_analyzed } cik: { boost: 2, type: string, index:…
bitgandtter
  • 2,179
  • 6
  • 31
  • 60
1
vote
1 answer

Building queries in ruflin Elastic search Symfony3

I am having hard times with Elastica and ruflin library for PHP to build the queries. There are no many examples I could follow. I have User entity in Symfony project which consists of the following fields: firstName, lastName, emailAddress, studio…
undefinedman
  • 620
  • 1
  • 11
  • 25