K
K
Kirows2014-08-11 14:38:04
Sphinx
Kirows, 2014-08-11 14:38:04

How to correctly index a remote DB through Sphinxsearch?

There is a shared hosting with a spinning store based on Bitrix.
There is a VDS server with Centos 6 spinning on it, and a running sphinx.
At the moment, all the tinsel is working, but with one problem, the Bitrix database is not indexed. There are no problems in the logs. If you search on the site, then an entry appears in the query log of the sphinx, but since the index is empty, it does not find anything.
When re-indexing, it gives the following:

Success: Sphinx 2.1.9-id64-release (rel21-r4761)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinx/sphinx.conf'...
indexing index '*******'...
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.082 sec, 0 bytes/sec, 0.00 docs/sec
total 97 reads, 0.006 sec, 98.6 kb/call avg, 0.0 msec/call avg
total 6 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
rotating indices: successfully sent SIGHUP to searchd (pid=29759).

If he could not connect to the database, should he write an error?
If it shouldn't, then how do you know it connects/not?
There are several million records in the database.
Sphinx config for interest
source **********.
{
    type = mysql # PostgreSQL / mssql
    sql_host = **********
    sql_user = **********
    sql_pass = **********
    sql_db = **********
    sql_port = 3306 # 3306

    sql_query_pre = SET NAMES utf8
    sql_query_pre = SET CHARACTER SET utf8

sql_query = SELECT P.id, P.article, P.title, P.original_article, P.brand_title, 
CONCAT( P.article, ' ', P.original_article, ' ', P.brand_title, ' ', P.title ) 
AS all_fulltext FROM b_products P WHERE P.quantity > 0 AND 
P.supplier_id IN (SELECT id FROM b_sphinx_active_suppliers)
<------>
    # update index time
    sql_query_post_index = INSERT INTO b_option (MODULE_ID, NAME, 
VALUE) VALUES ('**********sphinx',     'last_sphinx_reindex', NOW()) 
ON DUPLICATE KEY UPDATE VALUE = NOW()
}

index lm_auto.
{
    source = **********.
    path = /var/lib/sphinx/**********
    docinfo = none
........
    min_infix_len       = 2
    min_prefix_len       = 0
    infix_fields        = article
    enable_star     = 1
    morphology = lemmatize_ru_all
    charset_type = utf-8
    charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
    stopwords = /etc/sphinx/stopwords.txt
}

indexer
{
    mem_limit = 32M 
    lemmatizer_base = /etc/sphinx/dicts/
}

searchd
{
    listen = **********
    log = /var/log/sphinx/searchd-main.log
    query_log = /var/log/sphinx/query-main.log
    read_timeout = 5
    max_children = 30
    pid_file = /var/run/sphinx/searchd-main.pid
    max_matches = 10000
    binlog_path = #
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2014-08-11
@Kirows

Are you reindexing via indexer --all --rotate ? Your output shows that it indexed 0 documents, it is logical that the index is empty.
Set up a normal sphinx is simple.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question