我基準2版我的Solr索引的第一個具有以下包括語句:做什麼:在太陽黑子/ solr搜索方法中包含什麼內容?
searchable(:auto_index => false, :auto_remove => true,
:include => { :account => true,
:user_practice_contact => [:city],
:user_professional_detail => [:specialty, :subspecialties]}) do
第二:
searchable(:auto_index => false, :auto_remove => true) do
我期待看到一個減速的版本包括但在這裏是結果:
版本包括:
Benchmark.measure { User.limit(50).each do |u|; u.index; end; Sunspot.commit; }
=> #<Benchmark::Tms:0x1130b34e8 @real=6.8079788684845, @utime=5.05, @cstime=0.0, @cutime=0.0, @total=5.2, @label="", @stime=0.149999999999999>
和不包括:
Benchmark.measure { User.limit(50).each do |u|; u.index; end; Sunspot.commit; }
=> #<Benchmark::Tms:0x112ef0fe8 @real=6.82465195655823, @utime=4.92, @cstime=0.0, @cutime=0.0, @total=5.07, @label="", @stime=0.15>
有誰知道,如果包括應該工作?如果是這樣,我做錯了嗎? 我看了一下文檔:http://outoftime.github.com/sunspot/rails/docs/,並沒有提到這一點。