fix: prioritize current company registration act

This commit is contained in:
2026-09-16 09:56:11 +03:00
parent af6b0b8098
commit c048f20734
5 changed files with 12 additions and 10 deletions

View File

@@ -45,7 +45,7 @@ class SearchApiTest(unittest.TestCase):
body = json.loads(request.call_args.args[2])
planned = body["query"]["bool"]["must"]["bool"]
self.assertEqual(planned["minimum_should_match"], 1)
self.assertIn({"terms": {"document_code": ["667", "4"]}}, planned["filter"])
self.assertIn({"terms": {"document_code": ["230044970", "667", "4"]}}, planned["filter"])
self.assertTrue(any("constant_score" in clause for clause in planned["should"]))
self.assertTrue(any("общество с ограниченной ответственностью" in clause.get("multi_match", {}).get("query", "") for clause in planned["should"]))