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
41
votes
9 answers

How to config Single node for Single Cluster (Standalone Cluster) ElasticSearch

I installed elastic search in my local machine, I want to configure it as the only one single node in the cluster(Standalone Server). it means whenever I create a new index, it will only available to my server. It will not be accessible to other's…
channa ly
  • 9,479
  • 14
  • 53
  • 86
38
votes
1 answer

Elasticsearch relationship mappings (one to one and one to many)

In my elastic search server I have one index http://localhost:9200/blog. The (blog) index contains multiple types. e.g.: http://localhost:9200/blog/posts, http://localhost:9200/blog/tags. In the tags type I have created more than 1000 tags and 10…
Aruljothi
  • 497
  • 1
  • 6
  • 14
23
votes
6 answers

elasticsearch boost importance of exact phrase match

Is there a way in elasticsearch to boost the importance of the exact phrase appearing in the the document? For example if I was searching for the phrase "web developer" and if the words "web developer" appeared together they would be boosted by 5…
user2724314
  • 251
  • 1
  • 2
  • 3
15
votes
2 answers

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 elastica version 2.X, but now in 6.X it doesn't seem to…
user11101096
9
votes
2 answers

Elasticsearch match substring in php

Below given is my code to generate index using elasticsearch.Index is getting generated successfully.Basically I am using it to generate autosuggest depending upon movie name,actor name and gener. Now my requirement is, I need to match substring…
Dinesh Belkare
  • 639
  • 8
  • 24
7
votes
1 answer

Foselasticabundle : How to add a script to FunctionScore in a query ? Elastica

I need to add a functionScore to my query to define a specific relevance for my results. Here is my working code : $query = new BoolQuery(); $filters = new BoolFilter(); $query = new Query\Term(); $query->setTerm($field, $value); …
GregOs
  • 403
  • 3
  • 13
6
votes
2 answers

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 them, it gives me these errors : Error in one…
Malcom HAMELIN
  • 305
  • 1
  • 3
  • 11
6
votes
2 answers

Error in ResponseExeption while populating FOSElasticaBundle/Symfony2

I am trying to get FOSElasticaBundle to work. ElasticSearch Instance is running on localhost:9200 and responding. I followed each step in the docs https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Resources/doc/setup.md but at the…
RoyRobsen
  • 457
  • 1
  • 9
  • 20
6
votes
3 answers

Sub-queries with "union" in elasticsearch

I'm currently busy working on a project in which we chose to use Elasticsearch as the search engine for a classifieds website. Currently, I have the following business rule: List 25 adverts per page. Of these 25, 10 of the displayed adverts must…
iLikeBreakfast
  • 1,545
  • 23
  • 46
6
votes
1 answer

ElasticSearch - Searching with hyphens in name

I have a product catalog which I am indexing in ElasticSearch using the Elastica client. I am very new to ElasticSearch BTW. There are products in my catalog which have 't-shirt' in their names. But, they won't appear in search results if I type…
Hitesh
  • 330
  • 1
  • 4
  • 10
6
votes
1 answer

How to sort on analyzed/tokenized field in Elasticsearch?

We're storing a title field in our index and want to use the field for two purposes: We're analyzing with an ngram filter so we can provide autocomplete and instant results We want to be able to list results using an ASC sort on the title field…
oucil
  • 4,211
  • 2
  • 37
  • 53
5
votes
3 answers

Elasticsearch foselastica repository and groupBy

Hello I have a problem.. I have my elastica repository namespace XX\xxx; use FOS\ElasticaBundle\Repository; class TestRepository extends Repository { public function getExamples($argOne, $argTwo) { $query = new BoolQuery(); $matchOne =…
Jack Red
  • 51
  • 2
5
votes
1 answer

Order by timeUpdated, if exists, otherwise timeCreated

I have 2 fields in an elastic type, namely timeCreated and timeUpdated. Now my business case is that we should always order by timeUpdated, unless it's null (or non-existent), which then obviously leaves us with timeCreated, which is always set.…
iLikeBreakfast
  • 1,545
  • 23
  • 46
5
votes
1 answer

How to configure correctly FOS Elastica analyzers and filters?

In my symfony2 application, I am using FOS Elastica bundle to perform searches. I have tried to set up analyzers and filters but it seems they just have no effect. For instance, if I search for the word 'cake', the objects containing the sentence…
Sébastien
  • 5,263
  • 11
  • 55
  • 116
5
votes
1 answer

FOSElasticaBundle for Symfony2. How to configure to connect to a cluster?

I'm using Elasticsearch and Symfony2 in a system via FOSElasticaBundle. While I was using only one server it was ok to configure the clients config like this: https://github.com/FriendsOfSymfony/FOSElasticaBundle#basic-configuration fos_elastica: …
Mestre San
  • 1,806
  • 15
  • 24
1
2 3
17 18