【发布时间】:2010-02-03 03:16:14
【问题描述】:
我在 django 应用上有一个简单的 haystack/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(名称全部为jibe)
...
{{ object.hostname }}
...
问题:
一个系统被命名为 static1.foo.com:
如果我搜索“静态”,我会得到所有静态服务器的结果(“静态”在它们的描述字段中)
如果我搜索“static1”,我会得到 0 个结果
如果我搜索“static1.foo.com”我会得到结果,包括这个服务器。
我的问题是,为什么 haystack/solr 不匹配“static1”查询?
【问题讨论】:
标签: python django solr django-haystack pysolr