0

我正在尝试获得所有可能的响应,但到目前为止,我得到的只是:

索引 test_responses:未找到分组属性“rr”

这是 sphinx.conf:

source test_responses {
    type = mysql
    sql_host = ******
    sql_user = ******
    sql_pass = ******
    sql_db = ******
    sql_query_pre = SET NAMES utf8

    sql_query = \
        SELECT responseID, respondentID, response, \
            questionID, surveyID, response as rr \
        FROM responses WHERE deleted IS NULL
    sql_attr_string = rr
    sql_attr_uint = questionID
    sql_query_info = SELECT * from responses where responseID = $id
}

index test_responses {
    source = test_responses
    path = /var/run/sphinxsearch
    charset_type = utf-8
}

和PHP代码:

$query_string = "";
$index_name = "test_responses";
$sphinx_client = new SphinxClient();
$sphinx_client->SetServer(SPHINX_HOSTNAME, 3312); 
$sphinx_client->SetMatchMode(SPH_MATCH_EXTENDED2);
$sphinx_client->setLimits(0, 0);

$sphinx_client->SetFilter("questionID", 604);
$sphinx_client->SetGroupBy("rr", SPH_GROUPBY_ATTR);
$result = $sphinx_client->Query($query_string, $index_name);

为什么会发生在我身上???;}

4

1 回答 1

0

关于http://sphinxsearch.com/docs/2.0.7/conf-sql-attr-string.html

sql_attr_string = title # 将被存储但不会被索引

尝试 sql_attr_str2ordinal = rr

于 2013-07-15T17:01:14.767 回答