开发者

How is a sphinxql query evaluated / interpretated?

开发者 https://www.devze.com 2023-04-10 06:15 出处:网络
Suppose i have a sphinx index named \"worldcities\" with the with the following fields / attributes: country_id# int attribute

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开发者_Python百科


"give me all the results that start with 'New Yor' and the filter them by country_id"

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('@(city,accent_city) "New Yor*"')

Match function takes a string.

0

精彩评论

暂无评论...
验证码 换一张
取 消