N
N
NemuiSaburau2019-01-17 15:02:59
MySQL
NemuiSaburau, 2019-01-17 15:02:59

Why doesn't Sphinx indexing start?

VPS server: Ubuntu 18.04, LAMP, Nginx, firewall off. I installed Sphinx, set up the indexing of one database with grief in half, everything was fine (it was indexed), then I redid it for a new database (the old one was not needed, and its index, respectively, too).
Set up sphinx config:

source table_sourse
{
    # Тип данных (mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc)
    type            = mysql

    # Необходимые параметры для подключения к базе данных
    sql_host      = localhost
    sql_user      = User
    sql_pass      = Pass
    sql_db        = table
    sql_port      = 3306

    # пред-запрос, выполняется перед выполнением основного запроса на получение данных из базы (кодировка UTF-8)
    sql_query_pre       = SET NAMES utf8

    # запрос, который получает данные документов для поиска (первое поле обязательно уникальный положительный ID документа)
    sql_query = SELECT code, name, nds, posh FROM table 

    sql_attr_bigint = code
    sql_attr_string = name
}


# индекс для поиска
index table
{
     # Источник данных (таблица в БД) для индексирования
    source            = table

    # Адрес, где будут хранится данные индекса
    path            = /home/user/data

    # Индекс с учетом морфологии
    morphology        = stem_ru

    # Минимальная длина слова для индексации
    min_word_len        = 1

    # Кодировка
    charset_type        = utf-8

    # Так и не понял, что это, поэтому закомментировал
    # docinfo           = extern
}

indexer 
{
    mem_limit = 1024M # лимит памяти для работы индексатора 
}


# Поисковая служба
searchd
{
    # какой порт и какой протокол "слушает" служба  
    listen            = 9306:mysql41

    # файл с логами
    log               = /var/log/sphinxsearch/searchd.log

    # файл с логами поисковых запросов
    query_log         = /var/log/sphinxsearch/query.log

    read_timeout      = 60
    max_children      = 30

    # PID file, searchd process ID file name
    pid_file          = /var/run/sphinxsearch/searchd.pid

    seamless_rotate   = 0
    preopen_indexes   = 1
    unlink_old        = 1
    binlog_path       = /var/lib/sphinxsearch/data
}

Rebooted the server. I logged in as root, I start Sphinx with the command:
searchd
Then I start indexing:
sudo indexer --all
Before that, they recommended me to delete the PID file (I did it, but I can restore it) and the old index. I did everything, but little has changed.
As a result, when starting indexing, it turns out like this:
5c406ed98a375755764308.png
As if he had performed this indexing, but there are no index files in the /var/lib/sphinxsearch/ folder (there are no files at all).
Yes, another clarification: in this database, the column with a unique date number is the name column. The Sphinx also swears at him (see screenshot)
What is the mistake and how to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
NemuiSaburau, 2019-03-28
@NemuiSaburau

Problem No. 1 - there was not enough space on the server
. Problem No. 2 - there were minor problems in the settings (already forgot where exactly), plus a small inaccuracy in the config.

P
Pavel, 2019-01-17
@PavelMonro

He also writes a fatal error that he cannot open the file along the path, see if this file exists, the rights to it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question