Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 呼呼声没有';t为所有文件编制索引_Python_Django_Django Haystack_Whoosh_Django Oscar - Fatal编程技术网

Python 呼呼声没有';t为所有文件编制索引

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

我使用的是django oscar电子商务,背后是用于haystack搜索的whoosh实现。我的店铺有近7万件商品:

>>> 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。你能发布你用来索引文档的代码吗?