K
K
KoRNeT46RuS2021-01-20 16:14:56
Sphinx
KoRNeT46RuS, 2021-01-20 16:14:56

Why does Sphinx show 'unknown local index' error?

source tasks : common
{
    sql_query = \
        SELECT \
            t.tasks_id, \
            t.tasks_id AS task_id, \
            t.message AS message \
        FROM \
            tasks AS t \

    sql_field_string = task_id
    sql_field_string = message
}


Request through a method In theory, sql_field creates both a field and an index. Why is he cursing? How to fix?
$sphinx->Query('добро', 'message');

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
ManticoreSearch, 2021-01-21
@KoRNeT46RuS

sql_field creates both field and index

`sql_field_string` defines the column type as well as the full text field (field) and the string attribute (string). By itself, a field type definition does not create an index. The `source` directive that says `sql_field_string` does not create an index either. A simple index is created via the `index` directive, which defines one or more `source`s from which the index will be built. The index is then indexed using the `indexer` utility.
$sphinx->Query('good', 'message');

message in this case is the index name, not the field name. Hence the error - `unknown local index 'message'`

S
Sergey Tikhonov, 2021-01-20
@tumbler

source is where and how to index the index. And still it is necessary to define an index.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question