Questions tagged [term-query]

22 questions
7
votes
1 answer

scoring of Term vs. Terms query different

I am retrieving documents by filtering and using a term query to apply a score. The query should match all animals having a specified color - the more colors are matched, the higher the score of a doc. Strange thing is, term and terms query result…
nonNumericalFloat
  • 1,348
  • 2
  • 15
  • 32
2
votes
1 answer

ElasticSearch exact match on text field with script

I'm trying to search with an ElasticSearch query documents that have exactly a certain value in a text field. I know that with a term query it could be possible if it were a keyword field. Unfortunately, I can't change the mapping. { "my_index":…
2
votes
1 answer

Elasticsearch match vs. term in filter

I don't see any difference between term and match in filter: POST /admin/_search { "query": { "bool": { "filter": [ { "term": { "partnumber": "j1knd" …
Lay András
  • 795
  • 2
  • 9
  • 14
2
votes
1 answer

Query builder not finding matches in Elastic Search JAVA high level reset client

I wrote JAVA code that queries an Elastic Search index (served by Elastic Cloud - although I don't think that's relevant to this question). With no query terms, the function returns all documents in the index as expected. When I add a search query…
2
votes
1 answer

Disabling Elasticsearch search analyzer

I'm working on the elasticsearch version 7.2 and i'm in the process of improving the performance of ES calls made by the application. From what I read, if we haven't set a "search analyzer" , by default standard analyzer will be set. But in…
1
vote
1 answer

How does multi field mapping work in Elastic Search

I want to support both text search (match query) as well as exact match (term query) on a single field in my elasticsearch index. Following is the mapping that I have created: PUT multi_mapping_test/_mapping { "properties": { "name": { …
1
vote
3 answers

Elasticsearch should has different scores

I am retrieving documents by filtering and using a bool query to apply a score. For example: { "query": { "bool": { "should": [ { "term": { "color": "Yellow" } }, { …
PkDev
  • 33
  • 3
1
vote
3 answers

Elastic search query not returning results

I have an Elastic Search query that is not returning data. Here are 2 examples of the query - the first one works and returns a few records but the second one returns nothing - what am I missing? Example 1 works: curl -X GET…
maloney
  • 1,633
  • 3
  • 26
  • 49
1
vote
2 answers

why does elasticsearch calculates score for term queries?

I want to make a simple query based on knowing a unique field value using a term query. For instance: { "query": { "term": { "products.product_id": { "value": "Ubsdf-234kjasdf" } } } } Regarding term queries, …
Amir Afianian
  • 2,679
  • 4
  • 22
  • 46
1
vote
1 answer

How to match one from many terms query?

Let's say I have a query language that parses "natural" language queries into elastic search queries. Assuming we have the following query: (type == "my-type" || device_id == "some-device-id") && id == "123456789" How can I achieve this in elastic…
Patryk
  • 22,602
  • 44
  • 128
  • 244
0
votes
1 answer

Problem searching domain with elastic search

I have registered the following document "ownDomainValue":"catalogonuevo1.com" When I perform the following query the document is found, value is "catalogonuevo1" [ { "query": { "bool": { "filter": [ …
Felipe Castillo
  • 536
  • 8
  • 25
0
votes
1 answer

Elasticsearch using term queries on text fields

I'm a bit puzzled by the way term queries work on text fields (I don't even know if it's ok to use them on text fields). This is my index using standard analyzer: { "my-index-000001" : { "mappings" : { "properties" : { "city" :…
user1934513
  • 693
  • 4
  • 21
0
votes
0 answers

Opensearch filter by multiple fields with different values

The data from opensearch index: { "_index" : "demoid", "_id" : "50014", "_score" : 1.0, "_source" : { "gender" : "FEMALE", "transactionNumber" : "JPP-SD", "shortname" : "nameS", "firstname" : "BLA BLA…
0
votes
1 answer

ElasticSearch: term vs match query decision

Being new to ElasticSearch, need help in my understanding. What I read about term vs match query is that term query is used for exact match and match query is used when we are searching for a term and want result based on a relevancy score. But if…
Vip
  • 1,448
  • 2
  • 17
  • 20
0
votes
1 answer

Why is there a difference in the search results when querying elasticsearch using a term query?

I have recently started learning elasticsearch and I am getting a difference in the search results of my query. The mapping of the index named "products" is provided below(I am pasting the response from my Kibana console tool) : { "products"…
Sarvagya Dubey
  • 435
  • 1
  • 7
  • 22
1
2