我想在 Windows 7 中索引 MSSql 2008 数据库。这是我的配置文件
source main
{
type = mssql
sql_host = localhost
sql_user = sa
sql_pass = pass
#mssql_winauth = 1
sql_db = article
sql_port = 1433 # optional, default is 3306
mssql_unicode = 1 # request Unicode data from server
sql_query_pre = insert into IndexLog(StartDateTime, Count, Successful) select top 1 getdate(), (select COUNT(id) from article),0 from article
sql_query = SELECT ID ,ROW_NUMBER() OVER(ORDER BY Title) AS TitleRowNo\
,Title,abstract \
FROM article
#Log index end
sql_query_post_index = update IndexLog set EndDateTime = getdate(), successful = 1 where id = (select max(id) from IndexLog)
sql_attr_uint = ID
sql_attr_uint = TitleRowNo
}
index news_main
{
source = main
path = C:/sphinx/article/data/news_main
docinfo = extern
charset_type = utf-8
min_word_len = 3
min_infix_len = 3
infix_fields = Title, abstract
# min_stemming_len = 0
# index_exact_words = 1
}
indexer
{
mem_limit = 32M
}
searchd
{
port = 6550 # 9312
log = C:/sphinx/article/log/searchd.log
query_log = C:/sphinx/article/log/query.log
read_timeout = 5
max_children = 0 # concurrent searches to run in parallel
pid_file = C:/sphinx/article/log/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 0
unlink_old = 1
collation_server = utf8_general_ci
collation_libc_locale = utf8_general_ci
}
我使用这个命令来运行 index.html。
indexer --config "C:\sphinx\a.sphinx.conf" news_main
但不是工作。