We have already tried what you propose. The query phase that weighs most in both environments are the text filters (children "PhraseQuery"), but obviously in the environment of our interest the execution times are considerably higher. I attach an example of profiling result.
{
"took" : 7559,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
},
"profile" : {
"shards" : [
{
"id" : "[ZhdjYylLSQuANsp7RwOenw][dovalue-1-1][0]",
"searches" : [
{
"query" : [
{
"type" : "BooleanQuery",
"description" : """#id:{3005817} #ToParentBlockJoinQuery (+(elements.text:"consenso assistenza"~5 elements.text:"mutuo agrario"~5 elements.text:"repubblica italiana"~5 elements.text:"richiesto importo euro"~5 elements.text:"signori identità personale"~5) #_type:__elements)""",
"time_in_nanos" : 4730171472,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 40799392,
"advance_count" : 348,
"score" : 0,
"build_scorer_count" : 697,
"create_weight" : 83502,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 4689288578
},
"children" : [
{
"type" : "PointInSetQuery",
"description" : "id:{3005817}",
"time_in_nanos" : 5803678,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 102497,
"advance_count" : 349,
"score" : 0,
"build_scorer_count" : 1045,
"create_weight" : 500,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 5700681
}
},
{
"type" : "ESToParentBlockJoinQuery",
"description" : """ToParentBlockJoinQuery (+(elements.text:"consenso assistenza"~5 elements.text:"mutuo agrario"~5 elements.text:"repubblica italiana"~5 elements.text:"richiesto importo euro"~5 elements.text:"signori identità personale"~5) #_type:__elements)""",
"time_in_nanos" : 5654116231,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 40607147,
"advance_count" : 349,
"score" : 0,
"build_scorer_count" : 1045,
"create_weight" : 63102,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 5613445982
},
"children" : [
{
"type" : "BooleanQuery",
"description" : """+(elements.text:"consenso assistenza"~5 elements.text:"mutuo agrario"~5 elements.text:"repubblica italiana"~5 elements.text:"richiesto importo euro"~5 elements.text:"signori identità personale"~5) #_type:__elements""",
"time_in_nanos" : 5651479030,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 39995678,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1045,
"create_weight" : 44601,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 5611438751
},
"children" : [
{
"type" : "BooleanQuery",
"description" : """elements.text:"consenso assistenza"~5 elements.text:"mutuo agrario"~5 elements.text:"repubblica italiana"~5 elements.text:"richiesto importo euro"~5 elements.text:"signori identità personale"~5""",
"time_in_nanos" : 5645504526,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 39982177,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1045,
"create_weight" : 28001,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 5605494348
},
"children" : [
{
"type" : "PhraseQuery",
"description" : """elements.text:"consenso assistenza"~5""",
"time_in_nanos" : 1826595107,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 18113388,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1027,
"create_weight" : 3900,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 1808477819
}
},
{
"type" : "PhraseQuery",
"description" : """elements.text:"mutuo agrario"~5""",
"time_in_nanos" : 949268811,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 3004781,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1033,
"create_weight" : 1100,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 946262930
}
},
{
"type" : "PhraseQuery",
"description" : """elements.text:"repubblica italiana"~5""",
"time_in_nanos" : 1507441729,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 5585150,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1031,
"create_weight" : 900,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 1501855679
}
},
{
"type" : "PhraseQuery",
"description" : """elements.text:"richiesto importo euro"~5""",
"time_in_nanos" : 1333288194,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 7456601,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1045,
"create_weight" : 1000,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 1325830593
}
},
{
"type" : "PhraseQuery",
"description" : """elements.text:"signori identità personale"~5""",
"time_in_nanos" : 18270966,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 5816857,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1023,
"create_weight" : 1101,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 12453008
}
}
]
},
{
"type" : "TermQuery",
"description" : "_type:__elements",
"time_in_nanos" : 2907022,
"breakdown" : {
"set_min_competitive_score_count" : 0,
"match_count" : 0,
"shallow_advance_count" : 0,
"set_min_competitive_score" : 0,
"next_doc" : 0,
"match" : 0,
"next_doc_count" : 0,
"score_count" : 0,
"compute_max_score_count" : 0,
"compute_max_score" : 0,
"advance" : 11500,
"advance_count" : 1,
"score" : 0,
"build_scorer_count" : 1044,
"create_weight" : 4500,
"shallow_advance" : 0,
"create_weight_count" : 1,
"build_scorer" : 2891022
}
}
]
}
]
}
]
}
],
"rewrite_time" : 60001,
"collector" : [
{
"name" : "SimpleTopScoreDocCollector",
"reason" : "search_top_hits",
"time_in_nanos" : 227312
}
]
}
],
"aggregations" : [ ]
}
]
}
}