Skip to content

Commit

Permalink
[Filter SIRET] perf: filter siret on the root doc to prevent ESToPare…
Browse files Browse the repository at this point in the history
…ntBlockJoinQuery
  • Loading branch information
MKCG committed Nov 7, 2023
1 parent 5cbdb63 commit 35797bc
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions aio/aio-proxy/aio_proxy/search/filters/siret.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@
def filter_by_siret(search, siret_string):
"""Filter by 'siret' number"""
siret_filter = {
"nested": {
"path": "unite_legale.etablissements",
"query": {
"bool": {
"filter": [
{"term": {"unite_legale.etablissements.siret": siret_string}}
]
}
},
"inner_hits": {},
}
"term": {"unite_legale.etablissements.siret": siret_string}
}
search = search.query(Q(siret_filter))
return search

0 comments on commit 35797bc

Please sign in to comment.