.NET開發過程中的全文索引使用技巧之Solr

??? 前言:相信許多人都聽說過.net開發過程中基于Lucene.net實現的全文索引,而Solr是一個高性能,基于Lucene的全文搜索服務器。同時對其進行了擴展,提供了比Lucene更為豐富的查詢語言,同時實現了可配置、可擴展并對查詢性能進行了優化,并且提供了一個完善的功能管理界面,是一款非常優秀的全文搜索引引擎,這里我就繞過Lucene,直接說Solr的應用了,總之,Solr比Lucene更加方便簡潔好用,而且上手快,開發效率高。

?? Solr應用場景:涉及到大數據的全文搜索。尤其是電子商務平臺還有現在流行的云計算,物聯網等都是需要強大的數據量作為支撐的,使用Solr來進行數據檢索最合適不過了,而且Solr是免費開源的,門檻低、投資少見效快。關于Solr的一些優點我這里就不在累贅陳述了,園子里也有很多大神也寫了很多關于Solr的技術博文,我這里也只是拋磚引玉,見笑了。

?? 好了,這里就開始Solr的奇幻之旅吧

?

基于.NET平臺下的Solr開發步驟

一、搭建Solr服務器,具體步驟如下:

?? 1.安裝JDK,因為是.NET平臺,不需要安裝JRE、JAVA虛擬機,只安裝JDK即可,而且安裝JDK不需要手動去配置環境變量,它會自動幫我們配置好環境變量,很方便,這里我安裝的是jdk1.7,官網地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html

?? 2.安裝Tomcat8.0,官網地址:http://tomcat.apache.org/download-80.cgi,安裝完成后啟動Monitor Tomcat,瀏覽器地址欄輸入http://localhost:8080/,能進入說明安裝成功

?? 3.下載Solr,這里我用的是Solr4.4版本,下載后進行下列配置

  (1)解壓Solr4.4,創建Solr目錄,比如D:/SorlServer/one,將解壓后的Solr4.4中的example目錄下的Solr文件夾中的所有文件拷貝到創建的目錄中

  (2)創建Solr?Web應用,具體步驟,將解壓后的Solr4.4中的dist目錄下的Solr-4.4.0.war文件拷貝到Tomcat下,比如C:\Program?Files\Apache?Software?Foundation\Tomcat?7.0\webapps下,重命名為one.war,啟動Tomcat后該文件會自動解壓,進入到D:\SorlServer\one\collection1\conf下,打開solrconfig.xml文件,找到?<dataDir>節點改為<dataDir>${solr.data.dir:c:/SorlServer/one/data}</dataDir>

注意:這一步很重要:打開C:\Program?Files\Apache?Software?Foundation\Tomcat?7.0\webapps\One\WEB-INF下的web.xml文件,找到<env-entry>節點開啟

env-entry-value值改為D:/SorlServer/one,如下:

<env-entry>???????

??????<env-entry-name>solr/home</env-entry-name>

??????<env-entry-value>D:/SorlServer/one</env-entry-value>

??????<env-entry-type>java.lang.String</env-entry-type>

?</env-entry>

  ?(3)將解壓后的Solr4.4下的/dist/solrj-lib目錄中的所有jar包拷貝到C:\Program?Files\Apache?Software?Foundation\Tomcat?7.0\lib

  (4)停止Tomcat,然后再啟動,訪問http://localhost:8080/one,即可打開

注意:如果是開發英文網站,我們就不需要使用第三方的分詞配置,Solr本身就內置支持英文分詞,如果是其他語種比如小語種(日語、意大利、法語等等),大家可以去網上找相關的分詞包,這里我們以中文分詞為例,畢竟國內大部分網站都是中文為主的。

?? 4.配置中文分詞,國內常用的分詞器(庖丁解牛、mmseg4j、IKAnalyzer),這里我用的是IKAnalyzer,這個分詞器比較活躍而且更新也快,挺好用的,具體步驟如下:

???(1)IKAnalyzerjar包以及IKAnalyzer.cfg.xml都復制到C:\Program?Files\Apache?Software?Foundation\Tomcat?7.0\webapps\one\WEB-INF\lib

???(2)配置D:\SorlServer\one\collection1\conf下的schema.xml,添加如下配置:

??????<!--?分詞配置?-->

?<fieldType?name="text_IKFENCHI"?class="solr.TextField">?

?????<analyzer?class="org.wltea.analyzer.lucene.IKAnalyzer"/>

?</fieldType>

????(3)停止Tomcat,然后再啟動,訪問http://localhost:8080/one/#/collection1/analysis,即可進行測試

??? 以上是Solr服務器端的相關配置工作

二、開始基于.NET平臺的Solr開發:

?? 1.下載Solr客戶端組件,我用的是園子里的Terry大哥的EasyNet.Solr,地址在微軟開源站:http://easynet.codeplex.com/,

Terry大哥已經把solr客戶端封裝的很完善了,里面封裝了很多現成的方法和參數配置,我們直接可以拿過來用,利用Easynet.solr創建索引,然后再查詢索引,具體使用方法如下:

  (1)下載EasyNet.Solr源碼直接放到項目中,也可以將源碼生成Dll組件后添加到項目引用進行使用,把源碼放到項目中最好不過了,我們也可以對其進行調整來滿足自己的需要

  (2)創建索引實體類,就是我們要保存的索引數據,比如創建一個產品實體類   

using System;
using System.Collections.Generic;namespace Seek.SearchIndex
{public partial class IndexProductModel{public IndexProductModel(){}#region  Propertiespublic int ID { get; set; }public int ProductID { get; set; }public string ClassPath { get; set; }public int ClassID1 { get; set; }public int ClassID2 { get; set; }public int ClassID3 { get; set; }public string Title { get; set; }public string Model { get; set; }public string PriceRange { get; set; }public string AttributeValues { get; set; }public string ProductImages { get; set; }public int MemberID { get; set; }public System.DateTime CreateDate { get; set; }public System.DateTime LastEditDate { get; set; }public string FileName { get; set; }public string ProductType { get; set; }public string Summary { get; set; }public string Details { get; set; }public string RelatedKeywords { get; set; }public int MemberGrade { get; set; }#endregion}
}
View Code

  (3)配置Solr服務器端的xml,就是將咱們的這個索引實體類配置到Solr服務器上,進入D:\SorlServer\one\collection1\conf,打開schema.xml文件,配置如下

 <field name="ID" type="string" indexed="true" stored="true" required="true" multiValued="false" /> <field name="ProductID" type="int" indexed="true" stored="true"/><!-- 快速高亮配置 termVectors="true" termPositions="true"  termOffsets="true" --><field name="Title" type="text_en_splitting" indexed="true" stored="true" termVectors="true" termPositions="true"  termOffsets="true"/><field name="Model" type="text_en_splitting" indexed="true" stored="true" termVectors="true" termPositions="true"  termOffsets="true"/><field name="ClassPath" type="string" indexed="true" stored="true"/><field name="ClassID1" type="int" indexed="true" stored="true"/><field name="ClassID2" type="int" indexed="true" stored="true"/><field name="ClassID3" type="int" indexed="true" stored="true"/><field name="PriceRange" type="string" indexed="true" stored="true"/><field name="AttributeValues" type="string" indexed="true" stored="true"/><field name="ProductImages" type="string" indexed="true" stored="true"/><field name="MemberID" type="int" indexed="true" stored="true"/><field name="CreateDate" type="date" indexed="true" stored="true"/><field name="LastEditDate" type="date" indexed="true" stored="true"/><field name="FileName" type="string" indexed="true" stored="true"/><field name="ProductType" type="string" indexed="true" stored="true"/><field name="Summary" type="string" indexed="true" stored="false"/><field name="Details" type="string" indexed="true" stored="false"/><field name="RelatedKeywords" type="string" indexed="true" stored="true"/><field name="MemberType" type="string" indexed="true" stored="true"/><field name="MemberGrade" type="int" indexed="true" stored="true"/>
View Code

  (4)開始創建索引,最好能寫一個生成索引的客戶端程序,我這里提供一下自己的索引器關鍵代碼

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Seek.SearchIndex;
using System.Data;
using System.Threading;
using System.Configuration;
using System.Reflection;
using EasyNet.Solr;
using EasyNet.Solr.Impl;
using EasyNet.Solr.Commons;
using System.Xml.Linq;
using EasyNet.Solr.Commons.Params;
using System.Threading.Tasks;namespace Seek.SearchIndex
{/// <summary>/// 索引器/// </summary>public class Indexer{private readonly static OptimizeOptions optimizeOptions = new OptimizeOptions();private readonly static CommitOptions commitOptions = new CommitOptions() { SoftCommit = true };private readonly static ISolrResponseParser<NamedList, EasyNet.Solr.ResponseHeader> binaryResponseHeaderParser = new BinaryResponseHeaderParser();private readonly static IUpdateParametersConvert<NamedList> updateParametersConvert = new BinaryUpdateParametersConvert();private readonly static ISolrQueryConnection<NamedList> connection = new SolrQueryConnection<NamedList>() { ServerUrl = ConfigurationManager.AppSettings["SolrServer"] };private readonly static ISolrUpdateConnection<NamedList, NamedList> solrUpdateConnection = new SolrUpdateConnection<NamedList, NamedList>() { ServerUrl = ConfigurationManager.AppSettings["SolrServer"], ContentType = "application/javabin" };private readonly static ISolrUpdateOperations<NamedList> solr = new SolrUpdateOperations<NamedList, NamedList>(solrUpdateConnection, updateParametersConvert) { ResponseWriter = "javabin" };private readonly static ISolrQueryOperations<NamedList> solrQuery = new SolrQueryOperations<NamedList>(connection) { ResponseWriter = "javabin" };public enum State{/// <summary>/// 運行中/// </summary>
            Runing,/// <summary>/// 停止/// </summary>
            Stop,/// <summary>/// 中斷/// </summary>
            Break}/// <summary>/// 窗口/// </summary>private Main form;/// <summary>/// 線程/// </summary>public Thread t;/// <summary>/// 消息狀態/// </summary>public State state = State.Stop;/// <summary>/// 當前索引/// </summary>private long currentIndex = 0;public long CurrentIndex{get { return currentIndex; }set { currentIndex = value; }}private int _startId = AppCongfig.StartId;public int StartId{get { return _startId; }set { _startId = value; }}/// <summary>/// 產品總數/// </summary>private int productsCount = 0;/// <summary>/// 起始時間/// </summary>private DateTime startTime = DateTime.Now;/// <summary>/// 結束時間/// </summary>private DateTime endTime = DateTime.MinValue;private static object syncLock = new object();#region 單利模式private static Indexer instance = null;private Indexer(Main _form){form = _form;productsCount = DataAccess.GetCount(0);       //產品數統計form.fullerTsslMaxNum.Text = productsCount.ToString();form.fullerProgressBar.Minimum = 0;form.fullerProgressBar.Maximum = productsCount;}public static Indexer GetInstance(Main form){if (instance == null){lock (syncLock){if (instance == null){instance = new Indexer(form);}}}return instance;}#endregion/// <summary>/// 啟動/// </summary>public void Start(){ThreadStart ts = new ThreadStart(FullerRun);t = new Thread(ts);t.Start();}/// <summary>/// 停止/// </summary>public void Stop(){state = State.Stop;}/// <summary>/// 中斷/// </summary>public void Break(){state = State.Break;}/// <summary>/// 創建索引/// </summary>public void InitIndex(object data){var docs = new List<SolrInputDocument>();DataTable list = data as DataTable;foreach (DataRow pro in list.Rows){var model = new SolrInputDocument();PropertyInfo[] properites = typeof(IndexProductModel).GetProperties();//得到實體類屬性的集合string[] dateFields = { "CreateDate", "LastEditDate" };string field = string.Empty;//存儲fieldnameforeach (PropertyInfo propertyInfo in properites)//遍歷數組
                {object val = pro[propertyInfo.Name];if (val != DBNull.Value){model.Add(propertyInfo.Name, new SolrInputField(propertyInfo.Name, val));}}docs.Add(model);StartId = Convert.ToInt32(pro["ID"]);}GetStartId();lock (syncLock){if (currentIndex <= productsCount){form.fullerProgressBar.Value = (int)currentIndex;}form.fullerTsslCurrentNum.Text = currentIndex.ToString();}var result = solr.Update("/update", new UpdateOptions() {  Docs = docs });}/// <summary>/// 創建索引/// </summary>public void CreateIndexer(DataTable dt){GetStartId();Parallel.ForEach<DataRow>(dt.AsEnumerable(), (row) =>{//從數據庫查詢商品詳細屬性if (row != null){var docs = new List<SolrInputDocument>();var model = new SolrInputDocument();PropertyInfo[] properites = typeof(IndexProductModel).GetProperties();//得到實體類屬性的集合string[] dateFields = { "CreateDate", "LastEditDate" };string field = string.Empty;//存儲fieldnameforeach (PropertyInfo propertyInfo in properites)//遍歷數組
                    {object val = row[propertyInfo.Name];if (val != DBNull.Value){model.Add(propertyInfo.Name, new SolrInputField(propertyInfo.Name, val));}}docs.Add(model);StartId = Convert.ToInt32(row["ID"]);var result = solr.Update("/update", new UpdateOptions() { Docs = docs });}});//GetStartId();lock (syncLock){if (currentIndex <= productsCount){form.fullerProgressBar.Value = (int)currentIndex;}form.fullerTsslCurrentNum.Text = currentIndex.ToString();}}/// <summary>/// 全部索引運行/// </summary>public void FullerRun(){//GetStartId();//form.fullerTsslCurrentNum.Text = currentIndex.ToString();DataTable dt = DataAccess.GetNextProductsInfo(StartId);StartId = AppCongfig.StartId;if (state == State.Break){this.SendMesasge("完全索引已繼續,起始ID[" + StartId + "]...");}else{startTime = DateTime.Now;this.SendMesasge("完全索引已啟動,起始ID[" + StartId + "]...");}state = State.Runing;form.btnInitIndex.Enabled = false;form.btnSuspend.Enabled = true;form.btnStop.Enabled = true;while (dt != null && dt.Rows.Count > 0 && state == State.Runing){try{InitIndex(dt);//單線程// CreateIndexer(dt);//多線程
                }catch (Exception ex){state = State.Stop;form.btnInitIndex.Enabled = true;form.btnSuspend.Enabled = false;form.btnStop.Enabled = false;GetStartId();this.SendMesasge(ex.Message.ToString());}form.fullerTsslTimeSpan.Text = "已運行 :" + GetTimeSpanShow(DateTime.Now - startTime) + ",預計還需:" + GetTimeSpanForecast();try{dt = DataAccess.GetNextProductsInfo(StartId);//獲取下一組產品
                }catch (Exception err){this.SendMesasge("獲取下一組產品出錯,起始ID[" + StartId + "]:" + err.Message);}}if (state == State.Runing){state = State.Stop;form.btnInitIndex.Enabled = true;form.btnSuspend.Enabled = false;form.btnStop.Enabled = false;AppCongfig.SetValue("StartId", StartId.ToString());this.SendMesasge("完全索引已完成,總計索引數[" + currentIndex + "]結束的產品Id" + StartId);}else if (state == State.Break){GetStartId();state = State.Break;form.btnInitIndex.Enabled = true;form.btnSuspend.Enabled = false;form.btnStop.Enabled = false;AppCongfig.SetValue("StartId", StartId.ToString());this.SendMesasge("完全索引已暫停,當前索引位置[" + currentIndex + "]結束的產品Id" + StartId);}else if (state == State.Stop){GetStartId();state = State.Stop;this.SendMesasge("完全索引已停止,已索引數[" + currentIndex + "]結束的產品Id" + StartId);form.btnInitIndex.Enabled = true;form.btnSuspend.Enabled = false;form.btnStop.Enabled = false;AppCongfig.SetValue("StartId", StartId.ToString());productsCount = DataAccess.GetCount(StartId);       //產品數統計form.fullerTsslMaxNum.Text = productsCount.ToString();form.fullerProgressBar.Minimum = 0;form.fullerProgressBar.Maximum = productsCount;}endTime = DateTime.Now;}/// <summary>/// 多線程構建索引數據方法/// </summary>/// <param name="threadDataParam"></param>public void MultiThreadCreateIndex(object threadDataParam){InitIndex(threadDataParam);}/// <summary>/// 獲取最大的索引id/// </summary>private void GetStartId(){IDictionary<string, ICollection<string>> options = new Dictionary<string, ICollection<string>>();options[CommonParams.SORT] = new string[] { "ProductID DESC" };options[CommonParams.START] = new string[] { "0" };options[CommonParams.ROWS] = new string[] { "1" };options[HighlightParams.FIELDS] = new string[] { "ProductID" };options[CommonParams.Q] = new string[] { "*:*" };var result = solrQuery.Query("/select", null, options);var solrDocumentList = (SolrDocumentList)result.Get("response");currentIndex = solrDocumentList.NumFound;if (solrDocumentList != null && solrDocumentList.Count() > 0){StartId = (int)solrDocumentList[0]["ProductID"];//AppCongfig.SetValue("StartId", solrDocumentList[0]["ProductID"].ToString());
            }else{StartId = 0;// AppCongfig.SetValue("StartId", "0");
            }}/// <summary>/// 優化索引/// </summary>public void Optimize(){this.SendMesasge("開始優化索引,請耐心等待...");var result = solr.Update("/update", new UpdateOptions() { OptimizeOptions = optimizeOptions });var header = binaryResponseHeaderParser.Parse(result);this.SendMesasge("優化索引耗時:" + header.QTime + "毫秒");}/// <summary>/// 發送消息到界面/// </summary>/// <param name="message">發送消息到界面</param>protected void SendMesasge(string message){form.fullerDgvMessage.Rows.Add(form.fullerDgvMessage.Rows.Count + 1, message, DateTime.Now.ToString());}/// <summary>/// 獲取時間間隔顯示/// </summary>/// <param name="ts">時間間隔</param>/// <returns></returns>protected string GetTimeSpanShow(TimeSpan ts){string text = "";if (ts.Days > 0){text += ts.Days + "";}if (ts.Hours > 0){text += ts.Hours + "";}if (ts.Minutes > 0){text += ts.Minutes + "";}if (ts.Seconds > 0){text += ts.Seconds + "";}return text;}/// <summary>/// 獲取預測時間/// </summary>/// <returns></returns>protected string GetTimeSpanForecast(){if (currentIndex != 0){TimeSpan tsed = DateTime.Now - startTime;double d = ((tsed.TotalMilliseconds / currentIndex) * productsCount) - tsed.TotalMilliseconds;return GetTimeSpanShow(TimeSpan.FromMilliseconds(d));}return "";}}
}
View Code

  (5)運行索引器,創建索引,這里是我的索引器界面,如圖

?  可以隨時跟蹤索引生成的情況

  (6)索引創建完畢后,可以進入Solr服務器界面http://localhost:8080/one/#/collection1/query進行測試

?

以上就是Solr的前期工作,主要是Solr服務器搭建和客戶端調用生成索引,后期再對客戶端的查詢進行詳細的說明,下期預告

1.全文搜索,分詞配置,以及類似于谷歌和百度那種輸入關鍵字自動完成功能

2.Facet查詢

?

?

?????

?

?

?

轉載于:https://www.cnblogs.com/johnwood/p/3447242.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/259116.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/259116.shtml
英文地址,請注明出處:http://en.pswp.cn/news/259116.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

關于字符的讀入與輸出

在筆試中&#xff0c;經常見到字符的讀入與輸出的題目。逆序打印輸入時最常見、最基本的考題&#xff0c;復雜點的就是統計單詞、逆序打印單詞之類的。難點是如何判斷輸入的結束&#xff0c;如果用getchar函數&#xff0c;其輸入結束符為EOF&#xff08;其打印值為-1&#xff0…

修正discuz發帖首次換行無效的問題

找遍了百度和google都沒有解決方案&#xff0c;連discuz官方都沒有出來解決&#xff0c;至今其官網仍有這個問題。 那就自己動手解決吧&#xff0c;順手打個補丁。雖然走了小路&#xff0c;但是能解決問題。 解決方案&#xff1a;修改static/js/bbcode.js 找到 html2bbcode()方…

auto.js停止所有線程_Java線程與并發編程實踐:深入理解volatile和final變量

同步有兩種屬性&#xff1a;互斥性和可見性。synchronized關鍵字與兩者都有關系。Java同時也提供了一種更弱的、僅僅包含可見性的同步形式&#xff0c;并且只以volatile關鍵字關聯。假設你自己設計了一個停止線程的機制(因為無法使用Thread不安全的stop()方法))。清單1中Thread…

項目實例改編:利用structs2的action 實時顯示圖片、pdf和其他內容的框架抽取。(轉)...

轉自&#xff1a;http://www.verydemo.com/demo_c167_i1382.html 針對&#xff1a;預覽文件&#xff08;圖片&#xff0c;PDF&#xff09;文件來源為action中的inputStream 重點&#xff1a; structs2的action的配置 action的寫法和結果類型 resulttype的寫法 網頁上實…

零碎的小知識點 ----------C# ToString()函數注意事項

C#中存在著大量的字符串操作&#xff0c;有專門的string類&#xff0c;各種各種的方法&#xff0c;其中使用最為頻繁的方法為ToString()&#xff0c;用起來很是順手&#xff0c;但是這里存在一個很大的問題&#xff0c;空字符是不能用ToString方法轉換的&#xff0c;不然就會報…

ios越獄系統UIGestureRecognizer事件截獲問題

越獄的機器給self.view設置一個UITapGestureRecognizer,這貨就把所有的點擊事件全截獲了,比如某個按鈕,點擊就沒效果.普通系統是沒有問題的. 因此要給UIGestureRecognizer設置delegate并且在其中對touch的view進行分別處理 比如要讓按鈕功能正常使用: 1 #pragma mark - UIGestu…

開始Go開發之旅-Golang架構師之路系列實戰

2019獨角獸企業重金招聘Python工程師標準>>> 作者: gomaster.me(馮琪超) 系列:Golang架構師之路 巧婦難做無米之炊&#xff0c;golang sdk就是gopher的大米 下載golang 點擊 官網下載golang sdk 根據不同系統&#xff0c;官網下載鏈接會選擇相應的平臺進行鏈接跳轉&…

delete與delete[]的區別

一直對C中的delete和delete[]的區別不甚了解&#xff0c;今天遇到了&#xff0c;上網查了一下&#xff0c;得出了結論。做個備份&#xff0c;以免丟失。 C告訴我們在回收用 new 分配的單個對象的內存空間的時候用 delete&#xff0c;回收用 new[] 分配的一組對象的內存空間的時…

event對應的各種坐標

IE8不支持的PageXY 相對于整個頁面鼠標的位置 包括溢出的部分 event.pageX; event.pageY; 所有瀏覽器支持的&#xff1a; 相對于當前瀏覽器窗口可視區域的坐標event.clientX;event.clientY; 相對于當前屏幕&#xff08;和瀏覽器窗口大小無關&#xff09;的坐標event.screenX;…

安卓9.0官方系統升級包_華為、榮耀公布可升級安卓10.0機型,你的手機在名單之內嗎?...

在近兩個月以前&#xff0c;美方將華為關進了小黑屋&#xff0c;隨后谷歌也將華為旗下的機型移出了安卓10.0升級名單&#xff0c;這一波操作之后&#xff0c;引起了不小的“恐慌”&#xff0c;許多華為用戶也在擔心是否還能正常使用安卓系統服務&#xff0c;不過&#xff0c;讓…

2. Mysql數據庫的入門知識

2. Mysql數據庫的入門知識 &#xff08;1&#xff09;打開Windows系統提供的服務查看相應的服務。 &#xff08;2&#xff09;在Windows任務管理器的進程中查看 &#xff08;3&#xff09;使用命令行管理windows的Mysql數據庫服務。 Net start 服務名 Net stop 服務名 mysql -h…

十月讀書心得

1.sizeof與strlen的區別。 #include <iostream> using namespace std; void main() {cout << sizeof("hello") << endl;}答案&#xff1a; 6原因&#xff1a; “hello”{‘h’,e,l,l,o,\0};共六個字節。 那么sizeof與strlen有什么區別呢&#xff…

nginx php-fpm 輸出php錯誤日志(轉)

nginx是一個web服務器&#xff0c;因此nginx的access日志只有對訪問頁面的記錄&#xff0c;不會有php 的 error log信息。 nginx把對php的請求發給php-fpm fastcgi進程來處理&#xff0c;默認的php-fpm只會輸出php-fpm的錯誤信息&#xff0c;在php-fpm的errors log里也看不到ph…

protobuf的安裝和使用

以下全部基于win7系統。 protobuf是什么&#xff0c;有什么用網上說的已經很多了。這里就是說一下怎么使用。就當給自己做個筆記吧。 .proto文件的語法什么的也請網上查看&#xff0c;挺多的。 第一步&#xff1a; 下載protoc.exe 和 protobuf-java-2.4.1.jar。這里要注意版本區…

win7優化設置_win7藍牙怎么打開?

當電腦需要連接藍牙設備的時候&#xff0c;就需要打開藍牙設置才行。鑒于一些win7的用戶還不知道藍牙功能在哪&#xff0c;win7藍牙怎么打開&#xff0c;故系統圣地分享本篇教程。1、win7藍牙怎么打開?首先要你的電腦支持藍牙功能。如果你的電腦有藍牙功能的話那么在電腦的右下…

Struts2 通配符

在配置<action …./>元素時&#xff0c;需要指定name,class和method屬性&#xff0c;這三個屬性都支持通配符。 例如&#xff1a; 1.<action name ”*Action” class “student.RegisterAction” method “{1}”> 如果用戶請求的URL為loginAction.action,則調用…

Doxygen從零學起———安裝和配置

Doxygen可以為多種語言生成說明文檔&#xff08;從程序的源代碼中提取其中按照約定格式寫的注釋中提取信息&#xff09; 例如C, Objective-C, C#, C, PHP, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, D ,從這期開始&#xff0c;我將系…

JAVA Drp項目實戰—— Unable to compile class for JSP 一波三折

交代下背景。電腦系統是64位的&#xff0c;用的是64位的Tomcat。安裝是32位的Myeclipse10&#xff0c;java環境也是32位的。Tomcat在開始啟動時會報這樣一個錯誤&#xff0c;“Cant load IA 64-bit .dll on a AMD32-bit platform”。可是不耽誤使用&#xff0c;近期在敲Drp項目…

Java中的ClassLoader

Java中類的加載過程&#xff08;如Dog類&#xff09;&#xff1a; 通過類型信息定位Dog.class文件。載入Dog.class文件&#xff0c;創建相應的Class對象。執行父類的靜態字段定義時初始化語句和父類的靜態初始化塊。執行子類的靜態字段定義時初始化語句和子類的靜態初始化塊。當…

excel刪除無盡空白行_excel如何批量刪除空白行 巧用 ctrl+G 只需1秒 最常用的技巧...

工作中我們使用excel通常都會遇到這種情況&#xff0c;就是表格中有很多多余的空行。我們需要把多余的空行刪除。 如果空行只有一兩行的話&#xff0c;可以把鼠標放在空白行上&#xff0c;然后點擊鼠標右鍵&#xff0c;在彈出的菜單中選擇刪除菜單。 在彈出的刪除確定窗口中&am…