SphinxSearch不返回某些已定义的属性

时间:2019-09-17 12:33:33

标签: sphinx

我正在处理Sphinx Search的配置。问题是-并非每个值都从索引返回。 我当前的配置:

source pl_PL_main_source {
    type = pgsql
        sql_host = xxx
        sql_user = xxx
        sql_pass = xxx
        sql_db = xxx
        sql_port = xxx
}

source pl_PL_artifacts_search : pl_PL_main_source {
    sql_query = select \
            id, \
            title, \
            description, \
            slug, \
            '-' AS thumb_url, \
            '/' AS test, \
            '\.' AS test2, \
            '\:' as test3, \
            (CASE WHEN COALESCE(thumb_width, 0) = 0 THEN 280 ELSE thumb_width END) AS thumb_width, \
            (CASE WHEN COALESCE(thumb_height, 0) = 0 THEN 280 ELSE thumb_height END) AS thumb_height, \
            (COALESCE(thumb_height, 0) > COALESCE(thumb_width, 0)) AS is_vertical, \
            add_timestamp \
        FROM artifacts.item WHERE is_removed IS FALSE AND is_public IS TRUE 
    sql_field_string = title
    sql_attr_string = description
    sql_attr_string = slug

    sql_attr_string = thumb_url
    sql_attr_string = test
    sql_attr_string = test2
    sql_attr_string = test3
    sql_attr_uint = thumb_width
    sql_attr_uint = thumb_height
    sql_attr_bool = is_vertical
    sql_attr_string = add_timestamp
}

index pl_PL_artifacts_search {
    source = pl_PL_artifacts_search
    path = /usr/local/sphinx/var/data/pl_PL/pl_PL_artifacts_search
    min_word_len = 2
    infix_fields = title
    charset_table = 0..9, A..Z->a..z, a..z, U+0143->U+0144, \
            U+0104->U+0105, U+0106->U+0107, U+0118->U+0119, \
            U+0141->U+0142, U+00D3->U+00F3, U+015A->U+015B, \
            U+0179->U+017A, U+017B->U+017C, U+0105, U+0107, \
            U+0119, U+0142, U+00F3, U+015B, U+017A, U+017C, \
            U+0144
    wordforms = /usr/local/sphinx/wordform-pl-dict-urf-8
}


indexer {
    mem_limit = 512M
}

searchd {
    listen = xxx:sphinx
    log = /usr/local/sphinx/var/log/pl_PL/pl_PL_searchd.log
    query_log = /usr/local/sphinx/var/log/pl_PL/pl_PL_query.log
    read_timeout = 5
    max_children = 30
    pid_file = /usr/local/sphinx/var/log/pl_PL/pl_PL_searchd.pid
    seamless_rotate = 1
    unlink_old = 1
    binlog_path = /usr/local/sphinx/var/log/pl_PL
}

索引器重建索引没有问题。问题是当我使用Sphinx Client并查询该索引时。它返回正确的结果,但不返回所有属性。以下是示例或结果:

[692307] => Array
                (
                    [weight] => 100
                    [attrs] => Array
                        (
                            [title] => xxx
                            [description] => 
                            [slug] => xxx
                            [thumb_url] => -
                            [thumb_width] => 533
                            [thumb_height] => 400
                            [is_vertical] => 0
                            [add_timestamp] => 
                        )

                )

            [692411] => Array
                (
                    [weight] => 100
                    [attrs] => Array
                        (
                            [title] => yyy
                            [description] => 
                            [slug] => yyy
                            [thumb_url] => -
                            [thumb_width] => 563
                            [thumb_height] => 388
                            [is_vertical] => 0
                            [add_timestamp] => 
                        )

                )

为什么未返回我的测试属性(test,test2,test3)?

0 个答案:

没有答案