I’m trying to use Sphinx API to get the text result all I get is something like this:
16809 Array (
[error] =>
[warning] =>
[status] => 0
[fields] => Array (
[0] => name
[1] => description
)
[attrs] => Array ( )
[matches] => Array (
[16809] => Array ( [weight] => 2 [attrs] => Array ( ) )
)
[total] => 1
[total_found] => 1
[time] => 0.000
[words] => Array (
[radell] => Array (
[docs] => 1
[hits] => 2
)
)
)
I’m using the following additional lines in sphinx.conf:
sql_query = \
SELECT \
id, name, description \
FROM \
products_description;
sql_field_string = name
sql_query_info = SELECT * FROM products_description WHERE id=$id
Is it possible to get the full text result like name and description instead of above array ?
Sphinx provides you the index of your database record but not store it.
You have to fetch the id from search result and write another sql select to fetch data from that row.