我有草垛/ Solr中的一个简单的配置对我Django应用程序:的Django /草堆/ Solr的简单配置 - 部分场匹配问题
从这个应用程序的models.py:
class device(models.Model):
...
hostname = models.CharField(max_length=45, help_text="The hostname for this device")
...
从这个应用程序的search_sites.py:
class devIndex(indexes.SearchIndex):
'''Haystack class to allow for indexing device objects in TOMS'''
text = indexes.CharField(document=True, use_template=True)
从模板/搜索/索引/ systems_management/device_text.txt FO这个应用程序(名都嘲弄)
...
{{ object.hostname }}
...
问题:
的系统被命名为static1.foo.com:
如果我搜索“静”,我得到了所有静态服务器结果(“静态”在他们的描述字段)
如果我搜索“static1”,我得到0的结果
如果我搜索“static1.foo.com”我得到的结果,包括该服务器。
我的问题是,为什么haystack/solr不匹配“static1”查询?
感谢您的意见。我看到在config.xml中schema.xml中详细说明了这些内容。 我编辑我的schema.xml中读取如下: <字段名=“主机名”类型=“文本”索引=“真”存储=“真”的多值=“真” /> 然后我重建索引,但我仍然没有得到任何结果对部分主机名搜索: ... <海峡NAME = “q”> static1 ... <结果名称= “响应” numFound =” 0“start =”0“/> 我找不出什么(别的)我错过了。 –
jduncan
2010-02-08 18:57:22