내 mysql db에있는 문서를 기반으로 사전을 만들려면 sphinx 인덱서를 사용하고 있지만 소스의 sql 쿼리를 선택한 열로 제한 할 수는 없습니다. 스핑크스에서 소스의 sql 쿼리에서 열을 선택하는 방법
이
내가 development.sphinx.conf에서 다음 소스로indexer --buildstops dict.txt 1000 --verbose --print-queries --dump-rows listing_rows --buildfreqs listing_core -c config/development.sphinx.conf
를 사용하는 명령입니다, 어떤 문서를 찾을 수 없습니다와 dict.txt이 비어 있습니다
source listing_source {
type = mysql
sql_host = mysql
sql_user = sharetribe
sql_pass = secret
sql_db = sharetribe_development
sql_query = SELECT title AS title, description AS description FROM listings;
}
출력
Sphinx 2.2.10-id64-release (2c212e0)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file 'config/development.sphinx.conf'...
WARNING: key 'max_matches' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'enable_star' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'enable_star' was permanently removed from Sphinx configuration. Refer to documentation for details.
indexing index 'listing_core'...
building stopwords list...
SQL-CONNECT: ok
SQL-QUERY: SELECT title AS title, description AS description FROM listings;: ok
total 0 docs, 0 bytes
total 0.008 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
모든 열을 반환하도록 sql_query를 변경하면 인덱서에서 예상되는 문서 수를 찾습니다. (2) 사전에 추가합니다.
source listing_source {
type = mysql
sql_host = mysql
sql_user = sharetribe
sql_pass = secret
sql_db = sharetribe_development
sql_query = SELECT * FROM listings;
}
출력 :
Sphinx 2.2.10-id64-release (2c212e0)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file 'config/development.sphinx.conf'...
WARNING: key 'max_matches' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'enable_star' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'enable_star' was permanently removed from Sphinx configuration. Refer to documentation for details.
indexing index 'listing_core'...
building stopwords list...
SQL-CONNECT: ok
SQL-QUERY: SELECT * FROM listings;: ok
total 2 docs, 485 bytes
total 0.008 sec, 56303 bytes/sec, 232.18 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
은 어떻게 선택 컬럼 만 반환하는 쿼리를 제한 할 수 있습니다?