我对startswith
来自SearchQuerySet
. 我是以下索引:
class PropertyProjectIndex(indexes.SearchIndex):
text = indexes.CharField(document=True, use_template=True)
project_district_num = indexes.CharField(model_attr='project_district_num', null=True)
property_type = indexes.CharField(model_attr='property_type', null=True)
project_title = indexes.CharField(model_attr='project_title', null=True)
def get_model(self):
return PropertyProject
当我运行查询
sqs = SearchQuerySet().models(PropertyProject).filter(project_title__startswith='S')
我有类似PALM SPRING
和的结果RISING SUITES
。似乎还考虑了后续单词的第一个字母。当我阅读 django 的文档时,它会__startswith=S
翻译成where attribute like 'S%'
SQL。这不一样SearchQuerySet
吗?