Questions tagged [elasticsearch-php]
27 questions
6
votes
1 answer
Specify elasticsearch username/password with Elasticsearch-PHP ClientBuilder
I have activated default "elastic" user and set a password for that user. I am using elasticsearch-php to connect and query my elasticsearch. It was working good, but after activating the password I cannot connect using my previous code.
While…

Mainuddin
- 416
- 5
- 15
2
votes
4 answers
i have faced a problem in search for arabic work inside an array
Hi everyone i have faced a problem during my working to return a response for a api
the main problem is
$name = "تش";
$restaurants = [
"تشك تشيكن",
"بيتزا ساخنة",
"كينتاكي",
"تشيكن سبوت"
];
foreach ($restaurants as $restaurant) {
if…

Mhammed Talhaouy
- 1,129
- 10
- 14
2
votes
1 answer
Return position and highlighting of search queries in Elasticsearch
I am using the official Elasticsearch-PHP client installed on a personal Debian server, and what I am trying to do involves indexing, searching and highlighting individual documents. i.e. each search result will only return one document - which will…

Cogicero
- 1,514
- 2
- 17
- 36
2
votes
1 answer
Search with "And" operator in Elastic search PHP package
I'm trying to learn Elastic Search with help of php composer package. I'm having a index with the name of media_data which contains nits_account, nits_url, session_id, timestamp fields. I want to have filters based on above fields and it should be…

Nitish Kumar
- 6,054
- 21
- 82
- 148
1
vote
0 answers
elasticsearch using more_like_this with some constraints
I am using elasticsearch to detect duplicates in user names.
Here is a sample of code to get similar users which their names is close to john doe and their first name is the john
"query" => [
"bool" => [
"must"…

Basem
- 443
- 2
- 7
- 15
1
vote
0 answers
Having issues searching polygons that intersect with other polygons with elasticsearch
In our app, ES holds objects with areas field, where areas field in a type of MultiPyligon. (basically, it's an array of polygons).
Now, we need to search for all the objects in which one of their polygons in at least partially falls within a given…

Vik Semenov
- 11
- 2
1
vote
1 answer
Elasticsearch-PHP 7 Return All documents of a given mapping
Summary
Failing to get any/all documents from my ElasticSearch instance using the ElasticSearch-PHP 7 package.
When I run Curl query, works just fine. So I know I have bulk inserted the documents properly. Meaning that documents do exist.
Curl…

meatch
- 11
- 3
1
vote
0 answers
Elasticsearch bulk operation: insert if not existing, otherwise update or add a nested element
In elasticsearch 7.11.0 I have products as described.
{
"_index" : "products",
"_type" : "_doc",
"_id" : "1234567890123",
"_source" : {
"ean" : "1234567890123",
"title" : "Very nice product",
"merchants" : [
{
"id"…

Clee
- 11
- 1
1
vote
1 answer
Generating data tables in elastic search
I'm trying to make a data table which consists of some calculations
******************************************************
** Bidder * Request * CPM * Revenue * Response Time **
******************************************************
I've created an…

Nitish Kumar
- 6,054
- 21
- 82
- 148
1
vote
1 answer
Elasticsearch cardinality aggregation with text fields
I'm trying to query out average request generated in per session, I'm inserting a session_id while putting the data in my indices, I want to count distinct sessions and take out the average, while checking the mapping of data I came to know that it…

Nitish Kumar
- 6,054
- 21
- 82
- 148
1
vote
0 answers
How to count most occurring word from a set of documents then perform sub aggregations
From an Elasticsearch query, I am able to produce let's say around 5000 documents
Now, I'm trying to determine which non-stop words (stop words are auxiliary verbs / non-significant words) are appearing the most.
So I tried this query using the…

Suomynona
- 639
- 1
- 5
- 20
1
vote
0 answers
Why i get this illegal_argument_exception in Elasticsearch php search basic query?
I am using the Elasticsearch PHP package for execute queries. When I execute this basic search query, I get the illegal_argument_exception. The function
elastic() returns the Client of Elasticsearch.
$query = $this->elastic()->search([
'index'…

Alan Flores
- 35
- 1
- 8
0
votes
1 answer
Elasticsearch: Sort by _script using php client
Is there a way to sort by _script from php client? I haven't found a way to achieve that, but I did manage to do it from cURL.
If I do the query from cURL I can do the following and it works.
curl -X GET "localhost:9200/name/_search?pretty" -H…

Khriz
- 5,888
- 6
- 34
- 39
0
votes
1 answer
How to cancel update in elasticsearch painless script
While working on trying to switch out PHP code with pure elasticsearch-painless, I noticed that the document doesn't return "noop" even if the document is identical before and after update.
I'm not sure if there is any consequences of having a…

Typewar
- 825
- 1
- 13
- 28
0
votes
1 answer
Failing to search polygons that intersect with other polygons with elasticsearch
In our app, ES holds objects with areas field, where areas field in a type of MultiPyligon. (basically, it's an array of polygons).
Now, we need to search for all the objects in which one of their polygons in at least partially falls within a given…

Shurik Agulyansky
- 2,607
- 2
- 34
- 76