where match('"감자" "고구마"') OPTION FIELD_WEIGHTS=(title=2,body=1);where match('@id abc')
where match('@id *abc')(index 에 enable_star=1
min_infix_len=2)
===================================================================
CREATE TABLE sph_counter
( counter_id INTEGER PRIMARY KEY NOT NULL,
max_doc_id INTEGER NOT NULL
);
# in sphinx.confsource main
{
# ...
sql_query_pre = SET NAMES utf8
sql_query_pre = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM documents
sql_query = SELECT id, title, body FROM documents \
WHERE id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
}
source delta : main
{
sql_query_pre = SET NAMES utf8
sql_query = SELECT id, title, body FROM documents \
WHERE id>( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
}
index main
{
source = main
path = /path/to/main
# ... all the other settings
}
# note how all other settings are copied from main,
# but source and path are overridden (they MUST be)
index delta : main
{
source = delta
path = /path/to/delta
}
===========================================================
/home/sphinx/bin/indexer -c /home/sphinx/etc/sphinx.conf --all
home/sphinx/bin/indexer -c /home/sphinx/etc/sphinx.conf --all
Sphinx 2.1.4-release (rel21-r4421)
Copyright (c) 2001-2013, Andrew Aksyonoff
Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/home/sphinx/etc/sphinx.conf'...
indexing index 'breaknews_com'...
collected 381010 docs, 1430.4 MB
sorted 377.0 Mhits, 100.0% done
total 381010 docs, 1430409814 bytes
total 323.673 sec, 4419302 bytes/sec, 1177.14 docs/sec
indexing index 'delta2'...
FATAL: failed to lock /home/sphinx/var/data/breaknews_dalta.spl: Resource temporarily unavailable, will not index. Try --rotate option.
/home/sphinx/bin/indexer --config /home/sphinx/etc/sphinx.conf --rotate breaknews_com
///////////////////////////
전체 업데이트
/home/sphinx/bin/indexer --all --rotate
/////////////////////////////////////////////////////
delta 업데이트 업데이트
--merge 로 합
/home/sphinx/bin/indexer delta --rotate
sleep 20
/home/sphinx/bin/indexer --merge newsview_kr delta --rotate
sleep 20;
/home/sphinx/bin/searchd --stop
sleep 10;
/home/sphinx/bin/searchd