2011-09-29 32 views
1

我已經按照這裏的獅身人面像手冊:http://sphinxsearch.com/docs/current.html#delta-updates關於如何對您的索引執行增量更新。獅身人面像索引器三角洲 - 旋轉

我的searchd正在運行正確的配置文件。 索引器以前運行創建主索引。

當我運行這個命令:

indexer -c /home/brandon/workspace/gallery/server/lib/sphinx/sphinx.conf --rotate delta 

我得到這樣的結果:

using config file '/home/brandon/workspace/gallery/server/lib/sphinx/sphinx.conf'... 
read 0.1 of 0.1 MB, 100.0% done 
merged 10.8 Kwords 
merged in 0.010 sec 
total 389 reads, 0.000 sec, 2.0 kb/call avg, 0.0 msec/call avg 
total 7 writes, 0.000 sec, 78.6 kb/call avg, 0.0 msec/call avg 
rotating indices: succesfully sent SIGHUP to searchd (pid=28039). 

一切看起來好像它的工作,主要指標應該已經更新。然後我去我的搜索欄,但它沒有更新,因爲我無法搜索新項目。

有什麼建議嗎?

回答

1

確保你搜索你的應用程序中使用(主要和delta)指標。 三角洲指數只是另一個指數,所以基本上當你重新加索引增量指數時,它並沒有增加主指數。所以你的應用程序應該在兩個索引(主,三角洲)中搜索。

+0

非常好。這似乎是我的問題。 – lockdown

+0

或者您可以將delta索引合併到主索引中,這是我認爲大多數人所做的。 – Nate

-1

我的建議很簡單。 編寫一個簡單的程序來頻繁索引,然後重新啓動sphinx服務(searchd)。 結果會出來。

確保您在api代碼中同時包含main和index。 ($指數=「爲主,增量」;)

就可以按照我的指示在這裏以前的答案:Does Sphinx auto update is index when you add data to your SQL?

+1

不,不要重新啓動searchd。這是浪費並會導致停機。 --rotate將執行加載新索引所需的所有操作。 (它通過告訴searchd重新加載所需的索引來實現這一點,它無縫地發生) – barryhunter

相關問題