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
2
votes
3 answers

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 FOSElasticaBundle and in my local machine everything is going…
2
votes
0 answers

How to use highlight_query with Elastica / FOSElasticaBundle?

I'm new to Elastica and I'm searching for a way to highlight nested query results with highlight_query. I checked the code and $query->setHighlight() accepts only an array as a parameter. Maybe there's another way to achieve this result using…
unadivadantan
  • 363
  • 4
  • 14
2
votes
1 answer

FilterAggregation don't work as expect

I am trying to combine the filters for a FilterAggregation. Here the example: $agg = new Elastica\Aggregation\Filters('size'); $filter1 = new Elastica\Query\Terms(); $filter1->setTerms('color', $color); $filter2 = new…
Mutatos
  • 1,675
  • 4
  • 25
  • 55
2
votes
1 answer

elasticsearch sort not working at all

I am using below code for sorting //http://10.132.150.186:8010/rest-client/service/movie/romance/hindi/2012/0/10/asc if($urlParam[1] != 'all') $params['body']['query']['filtered']['filter']['and'][]['term']['gener'] =…
Dinesh Belkare
  • 639
  • 8
  • 24
2
votes
1 answer

How to include search suggestions grouped by entity type?

How would you search an index in Elastic Search that would include different matching indexes/entities along with it. I need to have complex search suggestions, they need to be grouped per entity. An image speaks a thousand words, so the following…
Steffen Brem
  • 1,738
  • 18
  • 29
2
votes
1 answer

FOSElasticaBundle and SoftDeletable Doctrine not working very well

I am currently using FOSElasticaBundle in my projects and the entities that is to be searched is using softdeletable . It seems that this is not going very well since when the entity is softdeleted the index on elastic search is not removed.…
adit
  • 32,574
  • 72
  • 229
  • 373
2
votes
1 answer

Elastica with FOS : ElasticsearchIllegalArgumentException

In my symfony2 / doctrine 2 application, I get an error when running fos:elastica:populate : [Elastica\Exception\Bulk\ResponseException] Error in one or more bulk request actions: index: /foodmeup/offer/4 caused MapperParsingException[failed to…
Sébastien
  • 5,263
  • 11
  • 55
  • 116
2
votes
2 answers

Elastica Client with cluster

I have an Elasticsearch cluster with Compose.io but I can't connect with Elastica Client. This is my configuration : $elasticaClient = new \Elastica\Client(array( 'servers' => array( array('host' =>…
Siol
  • 311
  • 8
  • 21
2
votes
2 answers

Convert Elastic Search Query to Elastica

I have an Elastic Search query as: { "query": { "bool": { "must": [ { "match": {"title": "accountant"} }, { "nested": { "path": "schools", "query": { "bool":…
Ibrahim
  • 837
  • 2
  • 13
  • 24
2
votes
3 answers

Elasticsearch OR query

Can anyone tell me how do I write the below Mysql query in elastisearch Select * from `table` WHERE `Name`='A' OR `Name`='B' order by `rank` DESC I have tried multiple solutions the internet like { "sort":{"rank":{"order":"desc"}}, "query": { …
Ironman
  • 173
  • 1
  • 3
  • 10
2
votes
3 answers

How to secure Elasticsearch

I have a Elasticsearch running on my server by default it runs on port 9200 and link is public means any one can insert, update, delete anything form anywhere. How do I make it secure like phpMyadmin which can be only accessed with the help of my…
Ironman
  • 173
  • 1
  • 3
  • 10
2
votes
2 answers

How to export Elasticsearch Index to local

How can I export elasticsearch index to my local computer from server and import it to another sever like we do from phpMyadmin for mysql database?
Ironman
  • 173
  • 1
  • 3
  • 10
2
votes
1 answer

How to get existing index object, if index exists in php elastica

I am new to elastic search. I am using php elastica client and facing a problem: If an index exists, I want to get the object of this existing index and not recreate it. How can this be done? client = new \Elastica\Client($arrServerConf,…
Tarun
  • 152
  • 1
  • 15
2
votes
1 answer

Combine filtered and bool query

i am trying to get the closest locations to the current location with the following query and it runs very well. { "from": 0, "size": 3, "query": { "filtered": { "query": { "matchAll": {} }, "filter": { …
smartius
  • 633
  • 3
  • 10
  • 24
2
votes
3 answers

How do I delete all percolator queries in an Elasticsearch index

I wish to delete all the percolator queries on an index, but leave the documents intact. Is there an easy way to perform this?
GlennJ
  • 167
  • 7