elastica

FOSElasticaBundle CustomScore query pagination

≯℡__Kan透↙ 提交于 2019-12-10 00:21:35
问题 I have just started using the FOSElasticaBundle and have so far found it really good to use. I am not sure if it is my ignorance of the bundle/Elastica or my lack of knowledge about ElasticSearch in general, but is it possible to have a CustomScore query with pagination? If I try calling setFrom/setSize on the CustomQuery object I am told that the methods do not exist. If I create a Query object and setFrom and size there and pass this query into the CustomScore query object then the

elasticsearch boost importance of exact phrase match

倾然丶 夕夏残阳落幕 提交于 2019-12-08 23:05:44
问题 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 compared to "web" and "developer" appearing separately throughout the document. Thereby any document that contained "web developer" together would appear first in the results. 回答1: You can combine different queries together using a bool query, and

Combination of two different filters in one Query - Elastica

女生的网名这么多〃 提交于 2019-12-07 10:22:20
问题 my question is very simple. I want to combine two filters one filter_bool and one filter_range in one query in Elastica. The code is public function getAdvancedTweetsEs($keyword, $location, $datepicker, $datepicker1, $offset) { $elasticaClient = new Elastica_Client(); // Load index $elasticaIndex = $elasticaClient->getIndex('mongoindex3'); // Define a Query. We want a string query. $elasticaQueryString = new Elastica_Query_QueryString(); //$elasticaQueryString->setDefaultOperator('AND');

How to sort on analyzed/tokenized field in Elasticsearch?

风流意气都作罢 提交于 2019-12-06 03:44:12
问题 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 rather than score. The index/filter/analyzer is defined like so: array( 'number_of_shards' => $this->shards, 'number_of_replicas' => $this->replicas, 'analysis' => array( 'filter' => array( 'nGram_filter' => array( 'type' => 'nGram', 'min_gram' => 2,

Combination of two different filters in one Query - Elastica

笑着哭i 提交于 2019-12-05 16:50:16
my question is very simple. I want to combine two filters one filter_bool and one filter_range in one query in Elastica. The code is public function getAdvancedTweetsEs($keyword, $location, $datepicker, $datepicker1, $offset) { $elasticaClient = new Elastica_Client(); // Load index $elasticaIndex = $elasticaClient->getIndex('mongoindex3'); // Define a Query. We want a string query. $elasticaQueryString = new Elastica_Query_QueryString(); //$elasticaQueryString->setDefaultOperator('AND'); $elasticaQueryString->setQuery($keyword); // Create the actual search object with some data. $elasticaQuery

Elasticsearch match substring in php

巧了我就是萌 提交于 2019-12-05 03:38:25
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 with particular field.This is working fine if I use $params['body']['query']['wildcard']['field'] = '*sub_word*'; .(i.e. search for 'to' gives 'tom kruz' but search for 'tom kr' returns no result). This matches only particular word in string.I want to match substring containing multiple words(i.e. 'tom kr' should return 'tom kruz'). I found few docs,

How to sort on analyzed/tokenized field in Elasticsearch?

瘦欲@ 提交于 2019-12-04 07:25:13
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 rather than score. The index/filter/analyzer is defined like so: array( 'number_of_shards' => $this->shards, 'number_of_replicas' => $this->replicas, 'analysis' => array( 'filter' => array( 'nGram_filter' => array( 'type' => 'nGram', 'min_gram' => 2, 'max_gram' => 20, 'token_chars' => array('letter','digit','punctuation','symbol') ) ), 'analyzer' =>

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

*爱你&永不变心* 提交于 2019-12-03 03:37:58
问题 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 server. My current scenario these indexes are available to other servers (the servers are formed in a cluster), and they can make any changes to my indexes. But I don't want it. I went through some other blogs but not getting best solution. So can

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

末鹿安然 提交于 2019-12-02 15:48:21
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 server. My current scenario these indexes are available to other servers (the servers are formed in a cluster), and they can make any changes to my indexes. But I don't want it. I went through some other blogs but not getting best solution. So can you please let me know steps for same? I ve got the answer from http://elasticsearch-users.115913.n3

elasticsearch boost importance of exact phrase match

做~自己de王妃 提交于 2019-11-30 03:44:40
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 compared to "web" and "developer" appearing separately throughout the document. Thereby any document that contained "web developer" together would appear first in the results. You can combine different queries together using a bool query , and you can assing a different boost to them as well. Let's say you have a regular match query for both the terms