@@ -111,7 +111,7 @@ def test_custom_search_params_with_string_list(index_with_documents):
111
111
assert 'overview' in response ['hits' ][0 ]
112
112
assert not 'release_date' in response ['hits' ][0 ]
113
113
assert 'title' in response ['hits' ][0 ]['_formatted' ]
114
- assert not 'overview' in response ['hits' ][0 ]['_formatted' ]
114
+ assert 'overview' in response ['hits' ][0 ]['_formatted' ]
115
115
116
116
def test_custom_search_params_with_facets_distribution (index_with_documents ):
117
117
index = index_with_documents ()
@@ -127,59 +127,8 @@ def test_custom_search_params_with_facets_distribution(index_with_documents):
127
127
assert len (response ['hits' ]) == 12
128
128
assert 'facetsDistribution' in response
129
129
assert 'exhaustiveFacetsCount' in response
130
- assert response ['exhaustiveFacetsCount' ]
130
+ assert not response ['exhaustiveFacetsCount' ]
131
131
assert 'genre' in response ['facetsDistribution' ]
132
132
assert response ['facetsDistribution' ]['genre' ]['cartoon' ] == 1
133
133
assert response ['facetsDistribution' ]['genre' ]['action' ] == 3
134
134
assert response ['facetsDistribution' ]['genre' ]['fantasy' ] == 1
135
-
136
- def test_custom_search_params_with_facet_filters (index_with_documents ):
137
- index = index_with_documents ()
138
- update = index .update_attributes_for_faceting (['genre' ])
139
- index .wait_for_pending_update (update ['updateId' ])
140
- response = index .search (
141
- 'world' ,
142
- {
143
- 'facetFilters' : [['genre:action' ]]
144
- }
145
- )
146
- assert isinstance (response , dict )
147
- assert len (response ['hits' ]) == 3
148
- assert 'facetsDistribution' not in response
149
- assert 'exhaustiveFacetsCount' not in response
150
-
151
- def test_custom_search_params_with_multiple_facet_filters (index_with_documents ):
152
- index = index_with_documents ()
153
- update = index .update_attributes_for_faceting (['genre' ])
154
- index .wait_for_pending_update (update ['updateId' ])
155
- response = index .search (
156
- 'world' ,
157
- {
158
- 'facetFilters' : ['genre:action' , ['genre:action' , 'genre:action' ]]
159
- }
160
- )
161
- assert isinstance (response , dict )
162
- assert len (response ['hits' ]) == 3
163
- assert 'facetsDistribution' not in response
164
- assert 'exhaustiveFacetsCount' not in response
165
-
166
- def test_custom_search_params_with_many_params (index_with_documents ):
167
- index = index_with_documents ()
168
- update = index .update_attributes_for_faceting (['genre' ])
169
- index .wait_for_pending_update (update ['updateId' ])
170
- response = index .search (
171
- 'world' ,
172
- {
173
- 'facetFilters' : [['genre:action' ]],
174
- 'attributesToRetrieve' : ['title' , 'poster' ]
175
- }
176
- )
177
- assert isinstance (response , dict )
178
- assert len (response ['hits' ]) == 3
179
- assert 'facetsDistribution' not in response
180
- assert 'exhaustiveFacetsCount' not in response
181
- assert 'title' in response ['hits' ][0 ]
182
- assert 'poster' in response ['hits' ][0 ]
183
- assert 'overview' not in response ['hits' ][0 ]
184
- assert 'release_date' not in response ['hits' ][0 ]
185
- assert response ['hits' ][0 ]['title' ] == 'Avengers: Infinity War'
0 commit comments