当我计划在Django应用程序中使用这个接口时,我发现了下面的错误跟踪:
进口日晒 si = sunburnt.SolrInterface
("http://localhost:8984/solr/sprod/")si.query(global_attr_.execute_type=‘便鞋’).execute() 回溯(最近一次调用): 文件"",第1行,在 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/search.py",第599行,在执行中 结果= self.interface.search(**self.options()) 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/sunburnt.py",第212行,正在搜索中 返回self.schema.parse_response(self.conn.select(params)) 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第510行,以parse_response表示 返回SolrResponse(self,msg) 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第652行,在init中 self.result =SolrResult(模式,result_node) 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第691行,在init中 self.docs = schema.parse_result_doc(n) in node.xpath("doc") 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第519行,在parse_result_doc中 返回dict(self.parse_result_doc(n)表示doc.getchildren()中的n) 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第516行,在parse_result_doc中 值= self.parse_result_doc(n,name)用于doc.getchildren()中的n 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第525行,在parse_result_doc中 返回名称,SolrFieldInstance.from_solr(field_class,doc.text或'').to_user_data() 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第326行,以from_solr格式 self.value =self.field.from_solr(数据) 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第161行,在from_solr中 返回self.normalize(值) 文件"/usr/local/lib/python2.7/dist-packages/sunburnt/schema.py",第219行,正规化 (价值,自我,类,self.name) 'sunburnt.schema.SolrFieldType_SolrIntField_indexed_True_omitNorms_True_stored_True‘类(字段设计器)的SolrError:为无效值
索引文档中的设计器字段实际上是空的。
<arr name="designer"> <int/> </arr> <arr name="discount"> <float>0.0</float> </arr> <arr name="discount_label"> <str/> </arr>
下面是模式的内容
<fieldType name="integer" class="solr.IntField" omitNorms="true"/>
..
...
....
<field name="designer" type="integer" indexed="true" stored="true"/>
我知道这与字段为空有关,但是由于模式没有提到“required”= true,所以我想知道到底是怎么回事。
发布于 2013-02-13 02:49:57
我猜
<arr name="designer"> <int/> </arr> 意味着您试图在Solr中存储多值整数字段?但是designer的字段定义需要一个单值整数。如果您没有文档的designer字段,那么您索引的文档应该没有此字段的任何内容。
https://stackoverflow.com/questions/14840524
复制相似问题