0
Djapian 복합 인덱스에 태그 검색을 수행하는 방법 ..나는이 같은 Djapian 인덱서 뭔가를
이class SomeModelIndexer(Indexer):
fields = ["body"]
tags = [('title', 'title', 2),
('tag', 'strtags')]
space.add_index(SomeModel, SomeModelIndexer, attach_as="indexer")
이 날 같은 검색과 태그로 SomeModels를 검색 할 수 있습니다 : 하나를 찾을 것 "태그 소시지" SomeModels는 "소시지"로 태그되었습니다. (strtags는 SomeModel의 @property 장식 함수입니다).
In [1]: from project.someapp.models import SomeModel
In [2]: from project.someapp import index
In [3]: SomeModel.indexer.search("tag:sausages").count()
Out[3]: 2L
그래서 작동,하지만 나는 또한 SomeModelIndexer 만에 그 인덱서 검색을 포함하는 CompositeIndexer이 "태그 : 소시지하는"제로 결과를 반환합니다.
composite_index = CompositeIndexer(SomeModel.indexer, AnotherModel.indexer)
In [4]: index.composite_index.search("tag:sausages").count()
Out[4]: 0L
어떻게 작동시킬 수 있는지에 대한 단서가 있습니까?