Answer the question
In order to leave comments, you need to log in
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
Скорее всего сфиксу нужно явно указать поле по кторому он создаст аттрибут
sql_query = SELECT
post_id AS 'post_id'
,post_title
,post_content
,post_url
FROM posts
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question