Spaces:
Sleeping
Sleeping
Update doc_searcher.py
Browse files- doc_searcher.py +15 -2
doc_searcher.py
CHANGED
|
@@ -32,7 +32,7 @@ class DocSearcher:
|
|
| 32 |
)
|
| 33 |
]
|
| 34 |
|
| 35 |
-
if type ==
|
| 36 |
filter = Filter(
|
| 37 |
must=[
|
| 38 |
FieldCondition(
|
|
@@ -45,7 +45,7 @@ class DocSearcher:
|
|
| 45 |
),
|
| 46 |
]
|
| 47 |
)
|
| 48 |
-
elif type ==
|
| 49 |
filter = Filter(
|
| 50 |
must=[
|
| 51 |
FieldCondition(
|
|
@@ -54,6 +54,19 @@ class DocSearcher:
|
|
| 54 |
)
|
| 55 |
]
|
| 56 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
else:
|
| 58 |
return []
|
| 59 |
|
|
|
|
| 32 |
)
|
| 33 |
]
|
| 34 |
|
| 35 |
+
if type == 1 and law_type is not None:
|
| 36 |
filter = Filter(
|
| 37 |
must=[
|
| 38 |
FieldCondition(
|
|
|
|
| 45 |
),
|
| 46 |
]
|
| 47 |
)
|
| 48 |
+
elif type == 1:
|
| 49 |
filter = Filter(
|
| 50 |
must=[
|
| 51 |
FieldCondition(
|
|
|
|
| 54 |
)
|
| 55 |
]
|
| 56 |
)
|
| 57 |
+
elif type == 0 and law_type is not None:
|
| 58 |
+
filter = Filter(
|
| 59 |
+
must=[
|
| 60 |
+
FieldCondition(
|
| 61 |
+
key="tip_dokumenta",
|
| 62 |
+
match=MatchValue(value=type)
|
| 63 |
+
),
|
| 64 |
+
FieldCondition(
|
| 65 |
+
key="vrsta_akta",
|
| 66 |
+
match=MatchText(text=law_type)
|
| 67 |
+
),
|
| 68 |
+
]
|
| 69 |
+
)
|
| 70 |
else:
|
| 71 |
return []
|
| 72 |
|