среда, марта 07, 2012

Подключение к SphinxQL, sphinx.conf с поддержкой иврита

гребаны SphinxQL оказвается чтоб подключится к нему из комманд лайн нужно указать тип соединения:
mysql --port=9306 --protocol=tcp

ну и для примера простенький sphinx.conf с поддержкой иврита

#
# Minimal Sphinx configuration sample (clean, simple, functional)
#

source job_title_source
{
        type                    = mysql

        sql_host                = localhost
        sql_user                = sphinx
        sql_pass                = PASS
        sql_db                  = DBNAME
        sql_port                = 3306  # optional, default is 3306

        sql_query   = \
                SELECT id, title, UNIX_TIMESTAMP(datetime_created) as timestamp_created, access_id, lang_id \
                FROM job_title \

        sql_attr_uint = lang_id
        sql_attr_timestamp  = timestamp_created
        sql_field_string = access_id

        sql_query_info          = SELECT * FROM job_title WHERE id=$id
}


index job_title_index
{
        source                  = job_title_source
        path                    = /var/lib/sphinx/job_title_index
        docinfo                 = extern
        charset_type = utf-8

        charset_table   = 0..9, A..Z->a..z, _-> , a..z, \
         U+FB1D->U+05D9, U+FB1F->U+05F2, U+FB20->U+05E2, U+FB21->U+05D0, U+FB22->U+05D3, U+FB23->U+05D4, U+FB24->U+05DB, U+FB25->U+05DC, U+FB26->U+05DD, U+FB27->U+05E8, U+FB28->U+05EA, U+FB2A->U+05E9, U+FB2B->U+05E9, U+FB2C->U+05E9, U+FB2D->U+05E9, U+FB2E->U+05D0, U+FB2F->U+05D0, U+FB30->U+05D0, U+FB31->U+05D1, U+FB32->U+05D2, U+FB33->U+05D3, U+FB34->U+05D4, U+FB35->U+05D5, U+FB36->U+05D6, U+FB38->U+05D8, U+FB39->U+05D9, U+FB3A->U+05DA, U+FB3B->U+05DB, U+FB3C->U+05DC, U+FB3E->U+05DE, U+FB40->U+05E0, U+FB41->U+05E1, U+FB43->U+05E3, U+FB44->U+05E4, U+FB46->U+05E6, U+FB47->U+05E7, U+FB48->U+05E8, U+FB49->U+05E9, U+FB4A->U+05EA, U+FB4B->U+05D5, U+FB4C->U+05D1, U+FB4D->U+05DB, U+FB4E->U+05E4, U+FB4F->U+05D0, U+05D0..U+05F2

 # STRIP HTML TAGS
        html_strip = 1

}


indexer
{
        mem_limit               = 128M
}


searchd
{
        listen                  = localhost:9312
        listen                  = localhost:9306:mysql41
        log                     = /var/log/sphinx/searchd.log
        query_log               = /var/log/sphinx/query.log
        read_timeout            = 5
        max_children            = 30
        pid_file                = /var/run/sphinx/searchd.pid
        max_matches             = 10000
        seamless_rotate         = 1
        preopen_indexes         = 1
        unlink_old              = 1
        workers                 = threads # for RT to work
  compat_sphinxql_magics = 0 # the future is now
}

Комментариев нет: