<commit_before>{
  "query": {
    "bool": {
      "must": [ //AND podminka pro všechny slova
        {
          "bool": {
            "should": [  //OR podminka pro prvni slovo ve vsech typech
              {
                "query_string": {
                  "query": "07.06.1971",
                  "fields": [ //hlavní entita
                    "birthDateString",
                    "companyName",
                    "companyRegNo",
                    "crRefNo",
                    "crType",
                    "firstName",
                    "lastName",
                    "orderRefNo",
                    "status",
                    "products.serviceId",
                    "products.phoneNumber",
                    "products.imsi",
                    "products.serialNumber",
                    "products.status"
                  ]
                }
              },
              {
                "nested": {
                  "path": "products.installationAddress",
                  "query": {
                    "bool": {
                      "must": [
                        {
                          "query_string": {
                            "query": "07.06.1971",
                            "fields": [
                              "products.installationAddress.buildingNo",
                              "products.installationAddress.city",
                              "products.installationAddress.cityDistrict",
                              "products.installationAddress.countryCode",
                              "products.installationAddress.crossId",
                              "products.installationAddress.postalCode",
                              "products.installationAddress.street",
                              "products.installationAddress.streetNo"
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              },
              {
                "nested": {
                  "path": "crNote",
                  "query": {
                    "bool": {
                      "must": [
                        {
                          "query_string": {
                            "query": "07.06.1971",
                            "fields": [
                              "crNote.note"
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              },
              {
                "nested": {
                  "path": "contacts",
                  "query": {
                    "bool": {
                      "must": [
                        {
                          "query_string": {
                            "query": "07.06.1971",
                            "fields": [
                              "contacts.userId",
                              "contacts.sfaId",
                              "contacts.firstName",
                              "contacts.lastName",
                              "contacts.email",
                              "contacts.phoneNumber",
                              "contacts.phoneNumber2"
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              }
            ]
          }
        },
        {
          "bool": {
            "should": [   //OR podminka pro druhe slovo ve vsech typech

            ]
          }
        }
      ],

      "filter":[  //filter na opravneni
        {
          "has_parent": {
            "type": "customer_request_permission",
            "query": {
              "bool": {
                "must": [
                  {
                    "query_string": {
                      "query": "x0503109",
                      "fields": [
                        "login"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    }
  },
  "highlight": { //highlight
    "fields": {
      "birthDateString" :{},
      "companyName" :{},
      "companyRegNo" :{},
      "crRefNo" :{},
      "crType" :{},
      "firstName" :{},
      "lastName" :{},
      "orderRefNo" :{},
      "status" :{},
      "products.serviceId" :{},
      "products.phoneNumber" :{},
      "products.imsi" :{},
      "products.serialNumber" :{},
      "products.status" :{},
      "crNote.note":{},
      "products.installationAddress.buildingNo":{},
      "products.installationAddress.city":{},
      "products.installationAddress.cityDistrict":{},
      "products.installationAddress.countryCode":{},
      "products.installationAddress.crossId":{},
      "products.installationAddress.postalCode":{},
      "products.installationAddress.street":{},
      "products.installationAddress.streetNo":{},
      "contacts.userId":{},
      "contacts.sfaId":{},
      "contacts.firstName":{},
      "contacts.lastName":{},
      "contacts.email":{},
      "contacts.phoneNumber":{},
      "contacts.phoneNumber2":{}
    }
  }
}<commit_msg>highlight nested pomoci inner hits<commit_after>{
  "query": {
    "bool": {
      "must": [ //AND podminka pro všechny slova
        {
          "bool": {
            "should": [  //OR podminka pro prvni slovo ve vsech typech
              {
                "query_string": {
                  "query": "instanční",
                  "fields": [ //hlavní entita
                    "birthDateString",
                    "companyName",
                    "companyRegNo",
                    "crRefNo",
                    "crType",
                    "firstName",
                    "lastName",
                    "orderRefNo",
                    "status",
                    "products.serviceId",
                    "products.phoneNumber",
                    "products.imsi",
                    "products.serialNumber",
                    "products.status"
                  ]
                }
              },
              {
                "nested": {
                  "path": "products.installationAddress",
                  "query": {
                    "bool": {
                      "must": [
                        {
                          "query_string": {
                            "query": "instanční",
                            "fields": [
                              "products.installationAddress.buildingNo",
                              "products.installationAddress.city",
                              "products.installationAddress.cityDistrict",
                              "products.installationAddress.countryCode",
                              "products.installationAddress.crossId",
                              "products.installationAddress.postalCode",
                              "products.installationAddress.street",
                              "products.installationAddress.streetNo"
                            ]
                          }
                        }
                      ]
                    }
                  }

                }
              },
              {
                "nested": {
                  "path": "crNote",
                  "query": {
                    "bool": {
                      "must": [
                        {
                          "query_string": {
                            "query": "instanční",
                            "fields": [
                              "crNote.note"
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "inner_hits": {
                    "highlight": {
                      "fields": {
                        "crNote.note": {
                          "number_of_fragments": 3
                        }
                      }
                    },
                    "from": 0,
                    "size": 1
                  }
                }
              },
              {
                "nested": {
                  "path": "contacts",
                  "query": {
                    "bool": {
                      "must": [
                        {
                          "query_string": {
                            "query": "instanční",
                            "fields": [
                              "contacts.userId",
                              "contacts.sfaId",
                              "contacts.firstName",
                              "contacts.lastName",
                              "contacts.email",
                              "contacts.phoneNumber",
                              "contacts.phoneNumber2"
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              }
            ]
          }
        },
        {
          "bool": {
            "should": [   //OR podminka pro druhe slovo ve vsech typech

            ]
          }
        }
      ],

      "filter":[  //filter na opravneni
        {
          "has_parent": {
            "type": "customer_request_permission",
            "query": {
              "bool": {
                "must": [
                  {
                    "query_string": {
                      "query": "x0503109",
                      "fields": [
                        "login"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    }
  },
  "highlight": { //highlight
    "fields": {
      "*": {
        "highlight_query": { //highlight na hlavní entitě
          "bool": {
            "should": [
              {
                "query_string": {
                  "query": "instanční",
                  "fields": [
                    "birthDateString",
                    "companyName",
                    "companyRegNo",
                    "crRefNo",
                    "crType",
                    "firstName",
                    "lastName",
                    "orderRefNo",
                    "status",
                    "products.serviceId",
                    "products.phoneNumber",
                    "products.imsi",
                    "products.serialNumber",
                    "products.status"
                  ]
                }
              },
              {
                "query_string": {
                  "query": "YYY",
                  "fields": [
                    "birthDateString",
                    "companyName",
                    "companyRegNo",
                    "crRefNo",
                    "crType",
                    "firstName",
                    "lastName",
                    "orderRefNo",
                    "status",
                    "products.serviceId",
                    "products.phoneNumber",
                    "products.imsi",
                    "products.serialNumber",
                    "products.status"
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.10564002828854314, 'fraction_numerical': 0.004596888260254597, 'mean_word_length': 0.6310553633217993, 'pattern_counts': {'":': 123, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2558932', 'n_tokens_mistral': 2664, 'n_tokens_neox': 2440, 'n_words': 313}