複数のアプリを含むプロジェクトで django-haystack を使用しています。したがって、アプリに search_indexes.py があり、同じプロジェクトに別の search_indexes.py があります。
project
├── app
│ ├── search_indexes.py
│
├── app2 ├── search_indexes.py
私の 2 つのインデックスは比較的簡単で、同じ問題があります。
Haystack の複数のインデックス - search_indexes が異なっていてもインデックスは同じ
elasticsearch では両方とも統合されており、結果でそれらを区別することはできません。さらに、2 つのうちの 1 つであると感じています。どちらも elsticsearch で適切にインデックス化されているため、方法がわかりません。build_index を作成すると:
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
All documents removed.
Indexing 25 custom forms
Indexing 12 articles
すべてが適切に索引付けされています。私は、彼が両方の索引を探し、区別できることを気に入っています。
ありがとう