MCPcopy Index your code
hub / github.com/django-haystack/django-haystack / build

Method build

haystack/utils/loading.py:238–258  ·  view source on GitHub ↗
(self, indexes=None)

Source from the content-addressed store, hash-verified

236 self._facet_fieldnames = {}
237
238 def build(self, indexes=None):
239 self.reset()
240
241 if indexes is None:
242 indexes = self.collect_indexes()
243
244 for index in indexes:
245 model = index.get_model()
246
247 if model in self._indexes:
248 raise ImproperlyConfigured(
249 "Model '%s' has more than one 'SearchIndex`` handling it. "
250 "Please exclude either '%s' or '%s' using the 'EXCLUDED_INDEXES' "
251 "setting defined in 'settings.HAYSTACK_CONNECTIONS'."
252 % (model, self._indexes[model], index)
253 )
254
255 self._indexes[model] = index
256 self.collect_fields(index)
257
258 self._built = True
259
260 def collect_fields(self, index):
261 for fieldname, field_object in index.fields.items():

Callers 15

get_indexesMethod · 0.95
get_index_fieldnameMethod · 0.95
get_facet_fieldnameMethod · 0.95
all_searchfieldsMethod · 0.95
test_stored_fieldsMethod · 0.95
test_read_querysetMethod · 0.95
test_modelsMethod · 0.95
test_load_allMethod · 0.95
setUpMethod · 0.95
test_build_schemaMethod · 0.95
test_verify_typeMethod · 0.95

Calls 4

resetMethod · 0.95
collect_indexesMethod · 0.95
collect_fieldsMethod · 0.95
get_modelMethod · 0.45

Tested by 15

test_stored_fieldsMethod · 0.76
test_read_querysetMethod · 0.76
test_modelsMethod · 0.76
test_load_allMethod · 0.76
setUpMethod · 0.76
test_build_schemaMethod · 0.76
test_verify_typeMethod · 0.76
setUpMethod · 0.76
test_build_schemaMethod · 0.76
test_verify_typeMethod · 0.76
setUpMethod · 0.76