Lucene中索引階段Boost的值會被存放在.nrm檔案中,用16進位開啟就能看的到。每個Boost值最終會被儲存於一個Byte中,如果細心的同學就會發現在SetBoost的時候參數類型是float,float是四個位元組的,也就是說最後會有精度丟失。廢了方便查詢給出代碼和0-255對應的float下面是換算的代碼: public static sbyte FloatToByte315(float f) { int num =
防止忘記的最好的方法就是記下來。這是一段最簡單的搜尋代碼: public void Search() { var dir=FSDirectory.Open(new DirectoryInfo("xxx")); var searcher = new IndexSearcher(dir, true); var query = new TermQuery(new Term("Title", "jinzhao"
public static HtmlHelper CreateHtmlHelper(ViewDataDictionary vd){ Mock<ViewContext> mockViewContext = new Mock<ViewContext>( new ControllerContext( new Mock<HttpContextBase>().Object, new RouteData(),
using System;using System.Collections.Generic;using System.Linq;using System.Runtime.Caching;using System.Text;namespace CNBlogs.Zzk.Domain.Entities{ public class DictionaryCacheManager<TK, TV> { private ObjectCache memoryCache;
雖然是很久了的資料,還是有很好的參考價值的:lucene.commit.batch.size=0 lucene.commit.time.interval=0These properties allow commits in batch, you can either set how many document changes a batch will contain (commit will happen after X docs are modified) or set a time
寫Tab時為了保證慢載入下tab輸出不亂必須在服務端寫,然後就是出現了很多難看的if else,今天花了點時間寫了個協助類,跟ActionLink的使用一樣。範例程式碼: <ul> <li>@Html.TabLink("新聞", "s", new { t = "n" }, new { onclick = "return channelSwitch('n');" }, "tab_selected")</li>