我想知道創建網站搜索的最佳方式是在MVC 3中。我想能夠以某種方式索引我的所有靜態.cshtml視圖文字並且可以搜索。MVC 3 - 在我的'視圖'上創建搜索的最佳方法
我已經搜索了一下,並認爲IndexTank可能是要走的路,但它似乎是最近獲得,不再支持。
我很新MVC所以最簡單的路線是我在這裏後。 :)
謝謝!
我想知道創建網站搜索的最佳方式是在MVC 3中。我想能夠以某種方式索引我的所有靜態.cshtml視圖文字並且可以搜索。MVC 3 - 在我的'視圖'上創建搜索的最佳方法
我已經搜索了一下,並認爲IndexTank可能是要走的路,但它似乎是最近獲得,不再支持。
我很新MVC所以最簡單的路線是我在這裏後。 :)
謝謝!
將您的靜態內容的資源文件,然後不喜歡Lucene.net
這裏使用的東西的資源文件的搜索是用它http://www.ifdefined.com/blog/post/2009/02/Full-Text-Search-in-ASPNET-using-LuceneNET.aspx
最簡單的解決方案是在您的網站中嵌入一個只搜索您的域名的Google搜索框。
<!-- SiteSearch Google -->
<form method="get" action="http://www.google.com/search">
<label for="q">Search:</label>
<input id="q" name="q" size="20" maxlength="255" value="" type="text"/>
<input name="domains" value="http://www.mydomain.com/" type="hidden"/>
<input name="sitesearch" value="http://www.mydomain.com/" checked="checked" id="mysite" type="radio"/>
<label for="mysite">Just this site</label>
<input name="sitesearch" value="" id="www" type="radio"/>
<label for="www">WWW</label>
<input name="btnG" value="Go" type="submit"/>
</form>
<!-- SiteSearch Google -->
是的,我想到了,以及Bing Web Helpers VS2011可以與NuGet安裝 - 但我不能在我們的網站上的品牌。任何其他類似於沒有標誌的解決方案? – cardiac7 2012-04-16 17:21:33
的可能重複[如何實現人的例子搜索功能在ASP.NET MVC應用程序](http://stackoverflow.com/questions/563308/how-to-implement-search-features-in-asp-net-mvc-applications) – 2012-04-16 15:58:27
是的,indextank不再支持從2011年4月10日開始,但您可以繼續使用來自其中一個提供商的IndexTank API服務。例如從http://indexden.com – 2012-04-19 11:17:40