S
S
Salavat Sitdikov2015-11-14 11:48:09
Sphinx
Salavat Sitdikov, 2015-11-14 11:48:09

The selection does not include all fields from the Sphinx query. Why?

There is such a source

{
sql_query = SELECT id, title, announcement, public_time FROM articles WHERE state = 1
sql_attr_timestamp = public_time
}

I make a request
$query = SphinxQL::create($conn)
                ->select('id', 'title', 'announcement', 'public_time')
                ->from('Index')
                ->match($field, $query_string)
                ->orderBy('public_time', 'DESC');

The returned query does not have the specified fields, so that they appear - you must specify them in sql_attr_*.
A question - for what then in sql_query to enumerate fields? Or is it necessary to enumerate them in the query and then specify their type via sql_field/attr_* ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2015-11-14
@opium

Globally, it seems to me that this is just a legacy, now you can automatically understand indexed types, on the other hand, the sphinx is quite universal and works not only with sql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question