Questions tagged [elasticsearch-php]

27 questions
0
votes
1 answer

Combine OR, AND and IN operators in Elasticsearch query

I am very new to the elasticsearch and I need to prepare the query which combines OR, AND and IN operators. What I want to achieve is having something like this in SQL: SELECT * FROM tableWHERE (field_1 = 'foo' AND field_2 IN(1,2,3) ) OR ('field_1 =…
mkas
  • 351
  • 2
  • 8
0
votes
1 answer

Multiple OR and AND conditions with Elasticsearch php

I would like to achieve the following query with ElasticSearch : product_shipper = 1 AND ((product_type = product and price>0) OR (product_type = product_variation and price=0)) I've built the following query but it doesn't work, sending me an empty…
Hugo Trial
  • 366
  • 5
  • 12
0
votes
1 answer

How can I prioritize documents in Elasticsearch query

I have products in my index. Documents are basically structured like these: { "_id": "product", "_source": { ... "type": "product", "id": 1, "mainTaxon": { "name": "T-SHIRT", }, "attributes": [ …
0
votes
1 answer

Elasticsearch seach using wildcard, range and terms

I am trying to write a search DSL query on a Elasticsearch ( Version 7.1 ) index that has fields like, product_name, exported_at and category_id. From the document I understand that I would need to use the wildcard, range to search on the date field…
tanay jha
  • 349
  • 3
  • 11
0
votes
1 answer

Elasticsearch Completion Suggester ignores Index parameter and returns results for multiple indices

I'm using the PHP implementation of Elastic to use a Completion Suggester like this: $params_organisations = [ 'index' => $this->organisation_index, 'body' => [ "suggest" => [ "suggestions" => [ …
T. Altena
  • 752
  • 4
  • 15
0
votes
1 answer

Elasticsearch with grouped query_string

{ "query": { "query_string" : { "query" : "((name:the_search_phrase) OR (keywords:the_search_phrase)) AND (city:Sydney, Australia)" } } } New to elasticsearch. Building the JSON as per the documentation here:…
Mr Cathode
  • 73
  • 14
0
votes
1 answer

PHP Elasticsearch 7.5 - Painless script condition is not providing proper results

This is my elasticsearch query. I am trying to get all the documents which meets the condition where if job_id is 1 then get documents which has sourced = 0 else if job_id is not 1 then get documents with sourced = 1. But it returns all the…
Varshaan
  • 555
  • 9
  • 22
0
votes
0 answers

Need some guidance regarding Elasticsearch php

I need some help in understanding the following things, I am using composer for elasticsearch php integration. I have created a html page to post form data into elasticsearch. I am trying to access the html page from another pc by changing the…
0
votes
2 answers

Elasticsearch Mapping Types in PHP

I want to connect to our elasticsearch Server (V7.0.0) using the official PHP Client. The elasticsearch Documentation states that mapping types have been removed in Version 6.0.0. But in the whole official PHP Client documentation types are still…
KHansen
  • 784
  • 5
  • 21
0
votes
1 answer

ElasticSearch Filter Multiple Fields Required

I have this query (via PHP client) for ElasticSearch 6.2: [ "query"=> [ "bool" => [ "filter" => [ "term" => [ "row.name" => $name ], "term" => [ "row.origin" => $origin ] ] …
samiles
  • 3,768
  • 12
  • 44
  • 71
0
votes
3 answers

Coverting CURL command to CURL php

I am trying to add documents to elastic search index via bulk API. My CURL query works fine on command line and I converted it to PHP. When I am trying to run PHP code, nothing happens. Neither documents are added in index in elastic search, nor…
Sarah Mandana
  • 1,474
  • 17
  • 43
0
votes
1 answer

Cannot update ES settings using ElasticSearch-PHP

There is already an index in ES. I am using ElasticSearch-PHP as client. According to ES docs these code should change ES settings: $params = [ 'index' => 'my_index', 'body' => [ 'settings' => [ 'number_of_replicas' => 0, …
hd.
  • 17,596
  • 46
  • 115
  • 165
1
2