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
0
votes
1 answer

Elasticsearch Compounded Words

we're using elasticsearch with seperate index for each language. This is our config for german analyzer: settings: index: analysis: filter: nGramFilter: type: nGram …
user3303589
0
votes
1 answer

Symfony2 :FOS:elastica populate fails for serializer with callback

I am using symfony LTS with master FOS:elastica and master jms_serializer. Config fos_elastica: clients: default: { host: %elastic_host%, port: %elastic_port% } serializer: callback_class: FOS\ElasticaBundle\Serializer\Callback …
cob cob
  • 11
  • 1
  • 2
0
votes
1 answer

Elasticsearch PHP connection settings for searchly.com

I have difficulties connecting to searchly.com with elasticsearch-php (http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/) $params = array(); $params['hosts'] = array ( …
jeff
  • 1,169
  • 1
  • 19
  • 44
0
votes
3 answers

Count query with PHP Elastica and Symfony2 FosElasticaBundle

I'm on a Symfony 2.5.6 project using FosElasticaBundle (@dev). In my project, i just need to get the total hits count of a request on Elastic Search. That is, i'm querying Elastic Search with a normal request, but through the special "count"…
Ninj
  • 1,492
  • 1
  • 15
  • 27
0
votes
0 answers

foselasticabundle nested conditional search

here is my config fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: allstock: types: clip: mappings: clipInfo: …
Anil Gupta
  • 2,329
  • 4
  • 24
  • 30
0
votes
0 answers

Failed to execute phase [query], all shards failed - ElasticSearch

I have a problem with elastic search, with query DSL 'mustNot' Here my code : $string = new Query\QueryString(); $string->setQuery('*'); $term = new Term(); $term->setTerm($this->attribute,$this->value); $mustNot =…
Yra Yra
  • 1
  • 3
0
votes
1 answer

UPSERT function for elastica?

I would like to do batch updates in elastic search using elastica. The data comes from a postgresql db and the es id's are the same as psql id's. After an operation in the sql db id`s and it's data can be changed, deleted or inserted. When doing…
fisch
  • 683
  • 1
  • 6
  • 17
0
votes
1 answer

Showing featured results with Elastic Search

I'm using Elastic Search on PHP using Elastica. I am retrieving a list which is composed of items. Some items are paid and/or chosen by the editors. Currently, I just sort them via a custom field 'score', which ranks these items based on their…
gerky
  • 6,267
  • 11
  • 55
  • 82
0
votes
0 answers

Integrating Elastica to an Existing PHP Project

I am a little confused as to how to go about this but basically I am trying to integrate Elastic Search into an existing mySQL database. I've done a bit of research and discovered a PHP Client called Elastica which makes it easier to work with…
Javacadabra
  • 5,578
  • 15
  • 84
  • 152
0
votes
1 answer

Elasticsearch - Using both query string query with suggest in array form

I am relatively new to elasticsearch and am trying to perform a search using the below query in php but I am getting an error. $query = array( 'query' => array( 'query_string' => array( 'query' => "(name_en:cook)^2 OR…
0
votes
1 answer

How to filter by embedded object field in elastic search

Here is my search object: { "_index": "search", "_type": "product", "_id": "2", "_version": 1, "found": true, "_source": { "datePublished": "2014-01-01T00:00:00-08:00", "published": true, "name":…
Derick F
  • 2,749
  • 3
  • 20
  • 30
0
votes
1 answer

ElasticSearch matching paths

I have an index with various types where user may have different access permissions for each type. All records have path field that is used to determine what user can and can't see. Here's an example of records: id: 12 type: Project path:…
Ilija
  • 4,105
  • 4
  • 32
  • 46
0
votes
1 answer

How to get occurrence count of specific field value in elasticsearch from 650 M data

I have indexed Twitter data in ES. There are 110 M Twitter unique users profiles and there 650 M Tweets. Both are in seperate index (index: twitter-profiles, type: profiles), for tweets (index: twitter-tweets, type: tweets). There is user_id_str of…
Sohail Ahmed
  • 1,667
  • 14
  • 23
0
votes
1 answer

script score function not working but addDecayFunction is working of FunctionScore query

I am using Elastica and going to use \Elastica\Query\FunctionScore(); function score --> script_score. Here addDecayFunction() woking fine but addScriptScoreFunction() not work and not through any exception. DecyFunction is commented because it is…
Sohail Ahmed
  • 1,667
  • 14
  • 23
0
votes
1 answer

how to translate "and or" where clause from sql query to elasticsearch filter

I have a WHERE clause in my SQL query, which have to be translated into the elasticsearch bool filter. here's the where clause: WHERE ( option = "weight" AND value = "50kg" ) OR ( option = "weight" AND value = "500kg" ) AND ( option = "magic" AND…
ArFeRR
  • 85
  • 1
  • 5