如何评估/解释 sphinxql 查询?
假设我有一个名为“worldcities”的sphinx索引,具有以下字段/属性:
country_id#int attribute
city#文本字段
accent_city#文本字段
,并且我运行以下sphinxql查询:
SELECT * FROM worldcities WHERE country_id = 16 AND MATCH((@(city,accent_city) "New Yor*"))
sphinx如何评估查询?: 是不是先搜索所有记录,然后通过count_id过滤结果: “给我所有以‘New Yor’开头的结果并按country_id过滤它们”?
或者它是否首先按国家/地区 ID 进行过滤并通过结果进行搜索: “给我所有 countr_id = 16 的结果,然后在其中搜索”?
希望我说清楚了
Suppose i have a sphinx index named "worldcities" with the with the following fields / attributes:
country_id # int attribute
city # text field
accent_city # text field
and i run the following sphinxql query:
SELECT * FROM worldcities WHERE country_id = 16 AND MATCH((@(city,accent_city) "New Yor*"))
How does sphinx evaluates the query?:
Is it first searching through all the records and then filters the results by countr_id:
"give me all the results that start with 'New Yor' and the filter them by country_id"?
Or does it filter first by country id and the searches through the results:
"give me all the results that have countr_id = 16 then search in those"?
Hope i made myself clear
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这一个。
首先运行全文查询。然后过滤器“排除”不需要的匹配项。
顺便说一句,您的查询缺少一些引号,应该是
Match 函数接受一个字符串。
this one.
The full-text queries runs first. Then the filters 'exclude' non required matches.
btw, your query is missing some quotes, should be
Match function takes a string.