Hello @Nathan_Reese thanks for replying!
Configuration for term join
Configuration for control
Request & response when no filter is introduced
For Geo (Elastic geo map data)
{
"docvalue_fields": [],
"size": 10000,
"track_total_hits": 10001,
"_source": [
"coordinates",
"name"
],
"sort": [
{
"name.keyword": {
"order": "asc",
"unmapped_type": "boolean"
}
}
],
"script_fields": {},
"stored_fields": [
"coordinates",
"name"
],
"runtime_mappings": {},
"query": {
"bool": {
"must": [],
"filter": [],
"should": [],
"must_not": []
}
}
}
{
"id": "FndZNkFRZVJYVHlPZFB0clpLcEJfZUEcenlfQmtMTk9TZUMwc2c0ZC1sZzB4UTo2OTM2Nw==",
"rawResponse": {
"took": 1111,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 250,
"relation": "eq"
},
"max_score": null,
"hits": [
{
"_index": "geo",
"_type": "_doc",
"_id": "gFO-A30BXh0EoPEHqbvL",
"_score": null,
"_source": {
"coordinates": {
"coordinates": [
[
[
[
20.278023,
60.142064
],
.
.
.
[
67.780591,
37.188672
]
]
],
"type": "Polygon"
},
"name": "Afghanistan"
},
"sort": [
"Afghanistan"
]
}
]
}
},
"isPartial": false,
"isRunning": false,
"total": 1,
"loaded": 1,
"isRestored": true
}
Request & response when no filter is introduced
For Article country(my dataset)
{
"size": 0,
"track_total_hits": false,
"aggs": {
"join": {
"terms": {
"size": 65535,
"field": "documentMessage.documents.document.countries.country.keyword"
},
"aggs": {}
}
},
"fields": [
{
"field": "documentMessage.documents.document.captureDatetime",
"format": "date_time"
},
{
"field": "documentMessage.documents.document.reportDatetime",
"format": "date_time"
},
{
"field": "documentMessage.documents.document.translation.translatedDatetime",
"format": "date_time"
}
],
"script_fields": {},
"stored_fields": [
"*"
],
"runtime_mappings": {
"newDate": {
"type": "keyword",
"script": {
"source": "ZonedDateTime input = doc['documentMessage.documents.document.reportDatetime'].value;\r\nString output = input.format(DateTimeFormatter.ISO_LOCAL_DATE);\r\nemit(output)"
}
}
},
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [],
"filter": [
{
"range": {
"documentMessage.documents.document.reportDatetime": {
"format": "strict_date_optional_time",
"gte": "2008-11-01T00:57:51.566Z",
"lte": "2031-12-14T07:21:55.810Z"
}
}
}
],
"should": [],
"must_not": []
}
}
}
{
"id": "FlM3YlhlSjcxUTFhZGt1Q2Z6R3ZJMGccenlfQmtMTk9TZUMwc2c0ZC1sZzB4UTo2OTQ0OQ==",
"rawResponse": {
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"max_score": null,
"hits": []
},
"aggregations": {
"join": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "Jakarta",
"doc_count": 779
},
{
"key": "JAKARTA",
"doc_count": 364
},
.
.
.
{
"key": "加帛",
"doc_count": 1
},
{
"key": "马鲁帝",
"doc_count": 1
}
]
}
}
},
"isPartial": false,
"isRunning": false,
"total": 1,
"loaded": 1,
"isRestored": false
}
Request & response when english language filter is introduced
For Geo(Elastic map geo data)
{
"docvalue_fields": [],
"size": 10000,
"track_total_hits": 10001,
"_source": [
"coordinates",
"name"
],
"sort": [
{
"name.keyword": {
"order": "asc",
"unmapped_type": "boolean"
}
}
],
"script_fields": {},
"stored_fields": [
"coordinates",
"name"
],
"runtime_mappings": {},
"query": {
"bool": {
"must": [],
"filter": [
{
"match_phrase": {
"documentMessage.documents.document.contentLanguage.keyword": "en"
}
}
],
"should": [],
"must_not": []
}
}
}
{
"id": "FkRwMFY5al9SUzdxT2NUeWx4cnVmdHccenlfQmtMTk9TZUMwc2c0ZC1sZzB4UTo3MjY1MQ==",
"rawResponse": {
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"max_score": null,
"hits": []
}
},
"isPartial": false,
"isRunning": false,
"total": 1,
"loaded": 1,
"isRestored": false
}
Request & response when english language filter is introduced
For Article(my dataset)
It is the exact same as without filter.
I can send another reply with it attached if needed.
I'm guessing the issue is that they are trying to match with the string 'en'? But even so, how do I avoid this issue?
"match_phrase": { "documentMessage.documents.document.contentLanguage.keyword": "en"
I downloaded the geo data (world countries layer) from: Elastic Maps Service
Thank you so much for your help! Really appreciate it