私はこのようなDjapianインデクサーを持っています。
class SomeModelIndexer(Indexer):
fields = ["body"]
tags = [('title', 'title', 2),
('tag', 'strtags')]
space.add_index(SomeModel, SomeModelIndexer, attach_as="indexer")
これにより、「tag:sausages」のような検索でタグでSomeModelsを検索できます。これにより、「sausages」でタグ付けされた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もありますが、そのインデクサーで「tag:sausages」を検索しても結果はゼロになります。
composite_index = CompositeIndexer(SomeModel.indexer, AnotherModel.indexer)
In [4]: index.composite_index.search("tag:sausages").count()
Out[4]: 0L
それをどのように機能させるかについての手がかりはありますか?