Python 呼呼声没有';t为所有文件编制索引
我使用的是django oscar电子商务,背后是用于haystack搜索的whoosh实现。我的店铺有近7万件商品:Python 呼呼声没有';t为所有文件编制索引,python,django,django-haystack,whoosh,django-oscar,Python,Django,Django Haystack,Whoosh,Django Oscar,我使用的是django oscar电子商务,背后是用于haystack搜索的whoosh实现。我的店铺有近7万件商品: >>> from catalogue.models import Product >>> Product.objects.all().count() 69084 但显然,该索引只包含21000个文档: >>> from whoosh.index import open_dir >>> from whoos
>>> from catalogue.models import Product
>>> Product.objects.all().count()
69084
但显然,该索引只包含21000个文档:
>>> from whoosh.index import open_dir
>>> from whoosh.query import Every
>>> ix = open_dir('whoosh_index')
>>> len(list(ix.searcher().documents()))
21000
>>> len(ix.searcher().search(Every('text')))
21000
你知道为什么搜索引擎只能为我的部分文档(产品)编制索引吗?我认为21000的整数被编入索引并不是巧合(而不是随机数,比如24861),但我可能错了。有什么想法吗,在哪里可以找到这个问题的解决方案?您可以在问题中添加您正在使用的搜索索引吗?我刚刚构建并检查了一个运行您上面运行的代码的大索引,得到了正确的结果67766。你能发布你用来索引文档的代码吗?