Linked Questions

1 vote
2 answers
2k views

Elasticsearch bool query must match single field single term, and another field with OR terms

I want to find a document with a name that contains 'Bob' and has a location that is in either 'paducah' or 'smyrna'. Here's what I have now: query: { bool: { must: [ { match: { name: '...
SweetCoco's user avatar
1 vote
1 answer
1k views

How do I combine elasticsearch filter queries with OR using the Java API

I have these fields: country (can be "DK", "US", "UK" and so on) media ("book", "ebook", "cd") state ("active", "inactive&...
npeder's user avatar
  • 828
0 votes
3 answers
738 views

Is there a way to build an Elastic query with changing search values?

I want to use Elastic in PHP to process a search request from my website. For example, I have the search parameter name age height weight. But it should not be necessary to always search for all ...
Hella Koe's user avatar
0 votes
1 answer
637 views

How to nest bool queries?

I am building a search query which dynamically adds a set of constraints (bool) to the query. The general expected structure is as follows OR ( AND ( condition condition ... ) AND ( ...
WoJ's user avatar
  • 28.7k
0 votes
1 answer
340 views

Search for multiple fields in a nested document divided by an or clause in elasticsearch

The title of the question does not fully justify what I require. I have a nested document in the form { "tags": [ { "context": "context_pic_elements", "name": "...
Moiz Mansur's user avatar
1 vote
1 answer
315 views

How to put or condition in two different keys in DSL query

I have dsl query which need to return Country Owner is list of dictionaries Territory Owner is list of dictionaries Need to check where id is part of that dictionary My query which is below which ...
sim's user avatar
  • 488
1 vote
0 answers
268 views

ElasticSearch match field or field be absent (scoring, not filtering)

As part of a more complex query there is a should condition on a field: boolQuery.should(QueryBuilders.matchQuery("myOptionalField", myValue)); This way the records having the field myOptionalField ...
Fabian Kessler's user avatar
0 votes
1 answer
268 views

ElasticSearch multiple terms search json

I have a ton of items in a Db with many columns. I need to search across two of these columns to get one data set. The first column, genericCode, would group together any of the rows that have that ...
jeffcodes's user avatar
  • 736
0 votes
1 answer
250 views

Convert MySQL query (with where condition) to Elasticsearch query

I need to "transform" mysql query to Elasticsearch query. What is blocking me is "where" statement. Basically what I need is to find all items that are within distance of 25 miles based on latitude ...
Dejan Dragas's user avatar
0 votes
1 answer
182 views

Elasticsearch tutorial OR search (combining must and should)

to get started with elasticsearch and kibana I tried the tutorial. But now I get an error I can't solve on my own. It's pretty smiliar to this one: elasticsearch bool query combine must with OR But ...
G. H.'s user avatar
  • 1
0 votes
1 answer
142 views

How do i combine different search parameters in an elasticscearch dsl query?

Good day together, I have a little problem in Elastic/Kibana. In the Kibana Query Language "KQL" it is possible for me to execute a certain query: car:* AND coun: * AND doc: (bes* OR *rvr*) ...
user18790229's user avatar
0 votes
1 answer
108 views

How to get the exact match of using DSL

How mapping have role to find the search?? GET courses/_search return is below { "took" : 2, "timed_out" : false, "_shards" : { "total" : 5, "...
user avatar
0 votes
0 answers
88 views

ElasticSearch exclude with if condition

I am trying to write a query that gives me results with the following condition: get all user data with multiple statues but on certain status, only get it if another filed equals some value. user ...
Taghreed Alshammari's user avatar
0 votes
1 answer
55 views

Elasticsearch, is it possible to query an index with two different type that have different set of fields?

I have an index with two different types : [hits] => Array ( [total] => 408863 [max_score] => 1 [hits] => Array ( ...
ventomachine45's user avatar
0 votes
1 answer
37 views

Combining `term` and `match` in `should`

I'd like to search items that either have firstField (mapped as text) similar to a query string or secondField (mapped as an integer) equal to 1. After reading the docs, I understand I should be ...
Kathandrax's user avatar
  • 1,004

15 30 50 per page