Problem Description
A document in the organization's index that contains all the department collections for this organization, such as
{
id:1,
org_name:'Google',
department_list:[
{
id: 1,
name: 'financial department'
... (7 fields more)
}
......(41666 object more )
]
}
But the document contains 41666 departments, because too many departments lead to search is very slow, search results time 43s, please provide the idea to solve the problem, thank your!
Whole Mapping
https://github.com/elastic/elasticsearch/issues/26796
Query DSL
{
"size": 10,
"query": {
"bool": {
"must": [
{
"match_phrase": {
"_all": "tech"
}
}
],
"should": [
{
"match_phrase": {
"name": {
"boost": 100,
"query": "tech"
}
}
}
]
}
},
"highlight": {
"fields": {
"*": {
"pre_tags": [
"<em class=\"es-search-highlight\">"
],
"post_tags": [
"</em>"
],
"require_field_match": "false"
}
}
}
}
OS Configuration
CPU: 2 Core 4 Thread
Memory: 4 GB
OS version: Ubuntu 16.5
Running environment:Rancher