Djangohaystack和外部索引

2024-09-28 22:18:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我想知道什么是正确的方法:

  1. 将用于索引的文档直接馈送到搜索后端(以防我使用elasticsearch)
  2. 然后使用haystack生成的索引与webapp集成

我注意到从haystack到elasticsearch后端的所有查询请求都使用doc\u type='modelresult'。模块haystack/backends/elasticsearch_后端.py充满了硬编码的“modelresult”条目。我想知道这有什么原因吗?你知道吗

[2013-05-31 15:51:50,322][TRACE][index.search.slowlog.query] [Captain Fate] [poces][0] took[207micros], took_millis[0], types[modelresult], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[{"query":{"filtered":{"filter":{"fquery":{"query":{"query_string":{"query":"django_ct:(snote.note)"}},"_cache":true}},"query":{"query_string":{"query":"(content_auto:(title) AND content_auto:(t1) AND content_auto:(1))","default_operator":"AND","default_field":"text","auto_generate_phrase_queries":true,"analyze_wildcard":true}}}},"from":0}], extra_source[],

我是否应该使用“modelresult”doctype将所有文档提交到搜索后端以允许haystack使用索引?你知道吗

将提交和查询过程分开的想法是不是很糟糕?你知道吗

谢谢。你知道吗


Tags: and文档truedefaultsourceautosearchstring