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
0 answers

how to use Decay_function with Elastica?

I have a question on how to query the code below using Elastica?: curl 'localhost:9200/hotels/_search/' -d '{ "query": { "function_score": { "functions": [ { "DECAY_FUNCTION": { "price": { …
2
votes
3 answers

fos elasticabundle mapping type "array"

I have a doctrine array in column "tags" in table/entity "category". FOS ElasticaBundle is up and working, and now I want to add the "tags" column to the search. I cannot find any resources on how to set this up. Here is what I've tried and would…
Theodore Enderby
  • 622
  • 1
  • 6
  • 19
2
votes
0 answers

How to perform a Prefix query with Elastica

I'm attempting to create an autocomplete search using Elastica and Elastic Search (more specifically, FOSElasticaBundle for Symfony2). I've created a simple index, populated it with objects. A basic search works, ie: $finder =…
Pez
  • 1,251
  • 16
  • 32
2
votes
1 answer

Maintain the natural sort of overall results, but sort a subfield array within each result in elasticsearch?

Our defined Type is something like this: 'title' => ... , 'body' => ... , 'links' => 'type'=>'object', 'properties'=> array 'link' => ... , 'locations' => 'type'=>'object', 'properties'=> array 'label' => ... , 'pin' =>…
oucil
  • 4,211
  • 2
  • 37
  • 53
2
votes
1 answer

PHP Elastica filtered search returns no results when expected

I have created a small dataset (currently only 8 items) in an Elastic Search index. The entries are structured as follows { "value_a": "Foo", "value_b": "Bar", "value_c": "Baz" } In Elastic Search this then looks as follows (taken from…
bScutt
  • 872
  • 8
  • 23
2
votes
1 answer

Search for values of nested facet in elasticsearch

This represents my mapping: { "name": {"type": "string", "include_in_all": true}, "properties": { "type": "nested", "properties": { "name": {"type": "string"}, "value": {"type": "string"} } } How can I use…
dmncgr
  • 21
  • 1
2
votes
0 answers

Elastica mapping of array of tags

I'm trying to set an index of cities in my elasticsearch server each city has an array of tags, and I want to index these tags as an array what I do: config.yml: tags: {type:"string", boost: 3} my document: /** *…
Aysennoussi
  • 3,720
  • 3
  • 36
  • 60
2
votes
1 answer

how to set Elastica suggest from specific type?

I am faily new to elasticsearch and try to get along with elastica. I try to set suggester which suggest from a specific type. I have tried to used a method addType from \Elastica\Search, but it cann't work. $search = new…
2
votes
1 answer

Elasticsearch index search with different limits

I'm using elasticsearch to serve people when they are using dropdown. So far, so good. Right now I'm trying to figure out is it possible to search from different types with different sorts/filters/limits. So far I've found my way out with different…
Mihkel Viilveer
  • 432
  • 2
  • 10
2
votes
1 answer

How to make Elastica Query sorting work?

I'm trying to get search results sorted, but I just get the unsorted results with the following code (in this example I query for all results): $query = new \Elastica\Query(); $query->setSort(array('id' => array('order' => 'desc'))); $resultSet =…
RayOnAir
  • 2,038
  • 2
  • 22
  • 33
2
votes
1 answer

Update ElasticSearch Document while maintaining its external version the same?

I would like to update an ElasticSearch Document while maintaining the document's version the same. I'm using version_type=external as indicated in the versioning section of the index_ documentation. Updating a document with another of the same…
RayOnAir
  • 2,038
  • 2
  • 22
  • 33
2
votes
1 answer

Elastica multiple term search not returning the correct result

I have code with php using elastica to perform searching of products. When I select product categories as "off_furniture" and "home_furniture", the elasticsearch only return me the product with category "home_category". Kindly throw me some lights…
2
votes
1 answer

Elastica filter not working

I am testing out Elastica and Elastic Search. I am trying to add a filter to my query that only returns results by city location. It is returning empty. I've tried filter by username, and so on and it always returns empty, so it would seem my…
landland
  • 2,117
  • 3
  • 20
  • 26
2
votes
1 answer

elastica with terms and facets

I am faily new to elasticsearch and try to get along with elastica. I try to find out what Items are often togehter in a set of items when one of them is 2 and/or 7. So the index contains a lot of nested sets of items. The mutual items will be…
fisch
  • 683
  • 1
  • 6
  • 17
1
vote
1 answer

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 text when I search for the term music, the terms…
arno
  • 792
  • 14
  • 33