Category : elasticsearch

I was checking a part of my application in which I connect to elasticsearch host server and then I realized for every time the front-end sends an report request to my back-end I’m creating an instance of elasticsearch client class using the following code : $elasticClient = ClientBuilder::create()->setHosts($this->setHostsParams())->build(); Since our application sends about 20 requests ..

Read more

I am using laravel elastic search package. In Scout.php file. I am giving index laravel which is working with one model staff but not working with other models. scout.php ‘elasticsearch’ => [ ‘index’ => env(‘ELASTICSEARCH_INDEX’, ‘laravel’), ‘config’ => [ ‘hosts’ => [ env(‘ELASTICSEARCH_HOST’, ‘http://localhost’), ], ], In models i am using public function searchableAs() { ..

Read more

I have a Q&A website that use Elasticsearch on it and also use MathML to type formulas. For example <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>d</mi> <mi>e</mi> <mi>t</mi> <mo> </mo> <mi>A</mi> <mo>≠</mo> <mn>0</mn> </math> is the outpout for det A ≠ 0. the problem is that elasticsearch is indexing it like a simple text(not formula), so the result of ..

Read more

I’m trying to fetch some data from the Elasticsearch query on my Laravel framework. We are actually switching from MongoDB to elastic. //mongoDB query $data = AppMongoModel::select(intVal, ‘StringVal’)->groupBy(‘intVal’)->orderBy(‘StringVal’)->get()->toArray(); this is my MongoDB query by which I’m fetching data. Now I want to do the same query in elastic. I tried with it. $params = [ ..

Read more

I’m working with Elastic Search in Laravel my index has 3 fields text,mood,haloha_id First I want to match “haloha_id”(consider haloha_id as post and text as comments on that post) if match then do further matching. suppose “haloha_id” is matched now I want to match a substring in the “text” field then match “mood”(which is integer ..

Read more