A
A
Anton Smirnov2016-07-13 12:32:43
MySQL
Anton Smirnov, 2016-07-13 12:32:43

Sphinx search. Indexing error, why can't one of the table fields be seen?

Good afternoon. I want to do a search with a filter. I take a simple example: there is a table of posts - posts, in the sphinx config I write the query sql_query = SELECT post_id, post_title, post_content, post_url FROM posts, then using api I make search queries - everything works here. For the filter in the config, I add sql_attr_uint = post_id, and when using api in the script, I add the line $this->sphinxsearch->setFilter('post_id', array(7)); Thus, 1 post should remain in the search results (I checked that the post with id = 7 is displayed without a filter). When starting indexing in the terminal, it writes an error that the post_id field was not found: WARNING: attribute 'post_id;' not found. Tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Пума Тайланд, 2016-07-13
@opium

Дайте таблицу конфиге сфинкса и его версию

Андрей Панов, 2016-07-14
@PanovAndrey

Скорее всего сфиксу нужно явно указать поле по кторому он создаст аттрибут

sql_query = SELECT 
             post_id AS 'post_id'
             ,post_title
              ,post_content
               ,post_url 
            FROM posts

A
Anton Smirnov, 2016-07-14
@antonzz321

Screenshot of the config, I also forgot to say I use CodeIgniter, and for it the sphinx library, the syntax is also in the screenshot.
In the screenshot, where the php code is, if you comment out the 9th line, then the results are displayed, otherwise not.
e60b274c1c9a402a99474580dfa2d317.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question