﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>单调专注的明王子 &#187; solr</title>
	<atom:link href="http://www.uyun.com/category/solr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.uyun.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Apr 2010 17:09:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-beta1</generator>
		<item>
		<title>Installing solr on Tomcat version 5.5 開源碼Java搜尋引擎 solr 跟 Tomcat 5.5 的安裝步驟</title>
		<link>http://www.uyun.com/2008/04/installing-solr-on-tomcat-version-5-5-open-source-java-search-engine-solr-with-the-tomcat-5-5-installation-steps/</link>
		<comments>http://www.uyun.com/2008/04/installing-solr-on-tomcat-version-5-5-open-source-java-search-engine-solr-with-the-tomcat-5-5-installation-steps/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 02:11:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://www.uyun.com/?p=427</guid>
		<description><![CDATA[English: These are some simple steps for installing solr on Tomcat 5.5 Please note the update date of this document, since solr and Tomcat&#8217;s installation method can be changed in the future, this may not help you if you are referencing this long after I posted this blog entry. Chinese: Solr 跟 Lucene的中文資料不容易找,根據我自己經過多次嘗試後安裝成功的經驗在此先記錄下我自己的安裝方法,本來是以為Tomcat 5.5 跟 [...]]]></description>
			<content:encoded><![CDATA[<p class="content">
<p id="excerpt">English:<br />
These are some simple steps for installing solr on Tomcat 5.5 Please note the update date of this document, since solr and Tomcat&#8217;s installation method can be changed in the future, <strong>this may not help you if you are referencing this long after I posted this blog entry.</strong></p>
<p>Chinese:<br />
Solr 跟 Lucene的中文資料不容易找,根據我自己經過多次嘗試後安裝成功的經驗在此先記錄下我自己的安裝方法,本來是以為Tomcat 5.5 跟 Tomcat 6.x 會一樣,結果發現有點小改變,但這裡因為我自己用的是Tomcat 5.5跟solr 1.2,所以暫時沒有關於Tomcat 6.x 跟 solr 1.2的詳細安裝方式,如果有人有Tomcat 6.x 跟 solr 1.2的安裝問題再發問吧.<br />
<strong>Step 1.</strong><br />
Download a solr release from <a href="http://cspeed.net/index.php?q=aHR0cDovL3d3dy5hcGFjaGUub3JnL2R5bi9jbG9zZXIuY2dpL2x1Y2VuZS9zb2xyLw%3D%3D" target="_blank">http://www.apache.org/dyn/closer.cgi/lucene/solr/</a>, and extract it.</p>
<p>先下載 solr 壓縮檔並解壓縮到你的主機內.</p>
<p><strong>Step 2.</strong><br />
Assuming that you extracted your solr to a folder named: apache-solr-1.2.0 (you can name it anyway and store it anywhere you want it.)</p>
<p>假設你的 solr 是解壓縮到 apache-solr-1.2.0 這個資料夾.</p>
<p><strong>Step 3.</strong><br />
Stop Tomcat server.<br />
Copy the apache-solr-1.2.0/dist/apache-solr-versionOfSolr.war to /usr/local/solr.war</p>
<p>(Do not put the solr.war in webapps directory)</p>
<p>停止 Tomcat, 先找這個資料途徑內的war檔: apache-solr-1.2.0/dist/apache-solr-xxx.war<br />
複製這個war檔到/usr/local/ 並更名為 solr.war.</p>
<p>(solr.war 檔放哪都可以,就是不要放在webapps裡)</p>
<p>Copy the apache-solr-xxxx (or apache-solr-1.2.0 whatever the source folder is named)/example/solr directory to /usr/</p>
<p>複製 apache-solr-xxxx(下載後解壓縮的資料夾名稱,在此以apache-solr-xxx代表)/example/solr 這個資料夾到 /usr/</p>
<p><strong>Step 4.</strong><br />
Creat a solr.xml under tomcat/conf/Cataline/localhost/ with the following content:</p>
<p>&lt;Context docBase=&#8221;/usr/local/solr.war&#8221; debug=&#8221;0&#8243; crossContext=&#8221;true&#8221; &gt;<br />
&lt;Environment name=&#8221;solr/home&#8221; type=&#8221;java.lang.String&#8221; value=&#8221;/usr/solr&#8221; override=&#8221;true&#8221; /&gt;<br />
&lt;/Context&gt;</p>
<p>在 tomcat的 conf/Cataline/localhost/ 裡建立一個 solr.xml檔,並在內容寫上</p>
<p>&lt;Context docBase=&#8221;/usr/local/solr.war&#8221; debug=&#8221;0&#8243; crossContext=&#8221;true&#8221; &gt;<br />
&lt;Environment name=&#8221;solr/home&#8221; type=&#8221;java.lang.String&#8221; value=&#8221;/usr/solr&#8221; override=&#8221;true&#8221; /&gt;<br />
&lt;/Context&gt;</p>
<p>docBase 要指定到你的solr.war的位置.<br />
value 要指到你的 /solr/資料夾的位置.</p>
<p><strong>Step 5.</strong><br />
Start Tomcat, and go to <a href="http://cspeed.net/index.php?q=aHR0cDovL2xvY2FsaG9zdChvcg%3D%3D" target="_blank">http://localhost(or</a> tomcat IP)/solr/admin<br />
If you get the solr admin page as shown on the solr wiki site, you have your solr installed and running.</p>
<p>啟動 Tomcat. 然後去tomcat的ip或 localhost下的 /solr/admin 頁面看看, 如果不是錯誤訊息頁面應該就安裝成功了.</p>
<p><strong>Step 6.</strong><br />
Once you get your solr running, you can start configuring your solrconfig.xml and schema.xml of solr in solr/conf/ directory according to the guide on Solr wiki site. (Note: Don&#8217;t forget to restart your tomcat after editing solrconfig.xml or schema.xml)</p>
<p>solr 會跑後當然就是要根據你的需要更改設定啦. 需要設定的檔有 solrconfig.xml 跟 schema.xml兩個檔.<br />
你可以在 /usr/solr/conf 資料夾內找到這兩個檔. 設定方法可以參考 solr wiki的網站,這裡就暫時不討論.<br />
最重要的是要記得每次跟改後要記得重新開啟 tomcat 這樣新的設定才會被套用.</p>
<p>That&#8217;s it for today, I will try my best to keep this post up to date, and I will keep posting some related topics about solr.<br />
For more detail about solr please refer to <a href="http://cspeed.net/index.php?q=aHR0cDovL3dpa2kuYXBhY2hlLm9yZy9zb2xyL1NvbHJUb21jYXQ%3D" target="_blank">http://wiki.apache.org/solr/SolrTomcat</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uyun.com/2008/04/installing-solr-on-tomcat-version-5-5-open-source-java-search-engine-solr-with-the-tomcat-5-5-installation-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solr 及 lucene 的 query 使用方法初級解說</title>
		<link>http://www.uyun.com/2008/04/solr-and-use-lucene-primary-explanation-of-the-query/</link>
		<comments>http://www.uyun.com/2008/04/solr-and-use-lucene-primary-explanation-of-the-query/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 02:11:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://www.uyun.com/?p=426</guid>
		<description><![CDATA[Solr, Lucene Query 使用方法: - 檢索/查詢 因為 solr 是用 lucene 的引擎,所以它們的 query 用法原則上是一樣的. 1. 首先假設我的資料裡fields有:name, subbranch, tel, address 預設的搜尋是name這個欄位, 如果要搜尋的資料剛好就是 name 這個欄位,就不需要指定搜尋欄位名稱. 2. 查詢規則: 如欲查詢特定欄位(非預設欄位),請在查詢詞前加上該欄位名稱加 &#8220;:&#8221; (不包含&#8221;號) 符號, 例如: address:台北台北市中正區重慶南路一段xxx號 tel:23xxxxx1 1. q代表query input 2. version代表solr版本(建議不要變動此變數) 3. start代表顯示結果從哪一筆結果資料開始,預設為0代表第一筆, rows是說要顯示幾筆資料,預設為10筆 (因為有時查詢結果可能有幾百筆,但不需要顯示所有結果,所以預設是從第一筆開始到第十筆) 所以若要顯示第10到30筆就改為: http: //localhost:8080/solr/select/?indent=on&#38;version=2.2&#38;q=address:台北 台北市中正區重慶南路一段xxx號+tel:23xxxxx1&#38;version=2.2&#38;start=10&#38;rows= 20&#38;indent=on 4. indent代表輸出的xml要不要縮行.預設為開啟 on 5. 另外,要限定輸出結果的內容可用 &#8220;fl=&#8221; 加上你要的欄位名稱,如以下這個範例: http: //localhost:8080/solr/select/?indent=on&#38;version=2.2&#38;q=text:總統府+ OR+text:郵局&#38;start=0&#38;rows=10&#38;fl=name,subbranch,tel [...]]]></description>
			<content:encoded><![CDATA[<p id="excerpt">Solr, Lucene Query 使用方法:<br />
- 檢索/查詢<br />
因為 solr 是用 lucene 的引擎,所以它們的 query 用法原則上是一樣的.</p>
<p>1. 首先假設我的資料裡fields有:name, subbranch, tel, address 預設的搜尋是name這個欄位, 如果要搜尋的資料剛好就是 name 這個欄位,就不需要指定搜尋欄位名稱.<br />
2. 查詢規則:<br />
如欲查詢特定欄位(非預設欄位),請在查詢詞前加上該欄位名稱加 &#8220;:&#8221; (不包含&#8221;號) 符號,<br />
例如: address:台北台北市中正區重慶南路一段xxx號 tel:23xxxxx1</p>
<p>1. q代表query input<br />
2. version代表solr版本(建議不要變動此變數)<br />
3. start代表顯示結果從哪一筆結果資料開始,預設為0代表第一筆, rows是說要顯示幾筆資料,預設為10筆<br />
(因為有時查詢結果可能有幾百筆,但不需要顯示所有結果,所以預設是從第一筆開始到第十筆)<br />
所以若要顯示第10到30筆就改為:<br />
<a href="http://cspeed.net/index.php?q=aHR0cDovL2xvY2FsaG9zdDo4MDgwL3NvbHIvc2VsZWN0Lz9pbmRlbnQ9b24mYW1wO3ZlcnNpb249Mi4yJmFtcDtxPWFkZHJlc3M65Y%2Bw5YyX5Y%2Bw5YyX5biC5Lit5q2j5Y2A6YeN5oW25Y2X6Lev5LiA5q61eHh46JmfK3RlbDoyM3h4eHh4MSZhbXA7dmVyc2lvbj0yLjImYW1wO3N0YXJ0PTEwJmFtcDtyb3dzPTIwJmFtcDtpbmRlbnQ9b24%3D" target="_blank">http: //localhost:8080/solr/select/?indent=on&amp;version=2.2&amp;q=address:台北 台北市中正區重慶南路一段xxx號+tel:23xxxxx1&amp;version=2.2&amp;start=10&amp;rows= 20&amp;indent=on</a><br />
4. indent代表輸出的xml要不要縮行.預設為開啟 on</p>
<p>5. 另外,要限定輸出結果的內容可用 &#8220;fl=&#8221; 加上你要的欄位名稱,如以下這個範例:<br />
<a href="http://cspeed.net/index.php?q=aHR0cDovL2xvY2FsaG9zdDo4MDgwL3NvbHIvc2VsZWN0Lz9pbmRlbnQ9b24mYW1wO3ZlcnNpb249Mi4yJmFtcDtxPXRleHQ657i957Wx5bqcK09SK3RleHQ66YO15bGAJmFtcDtzdGFydD0wJmFtcDtyb3dzPTEwJmFtcDtmbD1uYW1lLHN1YmJyYW5jaCx0ZWw%3D" target="_blank">http: //localhost:8080/solr/select/?indent=on&amp;version=2.2&amp;q=text:總統府+ OR+text:郵局&amp;start=0&amp;rows=10&amp;fl=name,subbranch,tel</a><br />
在fl=之後加上了name,subbranch,tel<br />
所以結果會如下:<br />
&lt;result name=&#8221;response&#8221; numFound=&#8221;1340&#8243; start=&#8221;0&#8243;&gt;<br />
&lt;doc&gt;<br />
&lt;str name=&#8221;name&#8221;&gt;總統府郵局&lt;/str&gt;<br />
&lt;str name=&#8221;subbranch&#8221;&gt;台北15支&lt;/str&gt;<br />
&lt;str name=&#8221;tel&#8221;&gt;23xxxxxx9&lt;/str&gt;<br />
&lt;/doc&gt;</p>
<p>&lt;doc&gt;<br />
&lt;str name=&#8221;name&#8221;&gt;總統府&lt;/str&gt;<br />
&lt;str name=&#8221;subbranch&#8221;/&gt;<br />
&lt;str name=&#8221;tel&#8221;&gt;23xxxxxx1&lt;/str&gt;<br />
&lt;/doc&gt;<br />
&lt;/result&gt;</p>
<p>3. 查詢 name 或 subbranch:直接輸入查詢詞, 如: 7-eleven 忠孝店<br />
送出的內容即為:<br />
name:7-eleven AND subbrahch:忠孝店</p>
<p>4. 若要搜尋聯集結果,請在詞與詞間空格或加上大寫 &#8220;OR&#8221; (不包含&#8221;號).<br />
例如: text:總統府 OR text:郵局<br />
text:總統府 OR 郵局<br />
或<br />
總統府 郵局<br />
或<br />
name:總統府 OR tel:23xxxxxx3<br />
或<br />
name:總統府 tel:23xxxxxx3</p>
<p>5. 若要搜尋交集結果,請在詞與詞間加上大寫 &#8220;AND&#8221; 或 &#8220;+&#8221; (不包含&#8221;號).<br />
例如: text:總統府 AND text:郵局<br />
或<br />
+text:總統府 +text:郵局<br />
或<br />
name:總統府 AND tel:23xxxxxx3<br />
或<br />
name: ( +總統府 +郵局)</p>
<p>6. 排除查詢<br />
在要排除的詞前加上 &#8220;-&#8221; (不包含&#8221;號) 號<br />
例如: 總統府 -郵局<br />
搜尋結果不會有包含郵局的詞的結果在內</p>
<p>7. Group 搜尋<br />
使用 &#8220;()&#8221; 來包含一個group<br />
如希望搜尋在店名欄位內同時有 &#8220;台北&#8221;(不包含&#8221;號) 及 &#8220;火車站&#8221;(不包含&#8221;號)</p>
<p>8. 增加權重: 如要搜尋 &#8220;中華 加油站&#8221;(不包含&#8221;號) 但因為回傳太多筆資料內有 &#8220;中華&#8221;(不包含&#8221;號) 或 &#8220;加油站&#8221;(不包含&#8221;號) 的結果,<br />
所以想要把有包含 &#8220;加油站&#8221;(不包含&#8221;號)的資料往前排,可使用 &#8220;^&#8221;(不包含&#8221;號)符號在後面加上愈增加的權重數,<br />
像是 &#8220;2&#8243;,則可以這樣做:</p>
<p>中華 加油站^2</p>
<p>會同時搜尋含有中華或加油站的結果,並把加油站這個詞加權所以搜尋時會先判斷加油站這一個詞在<br />
搜尋結果中的比重,甚至假設一筆資料內加油站出現過兩次以上的就更加會有優先權.</p>
<p>查詢時在查詢詞後加上 &#8220;^&#8221; (不包含&#8221;號) 再加上權重分數<br />
例如: 總統府 AND &#8220;郵局&#8221;^2<br />
或<br />
總統府^2 OR 郵局</p>
<p>9. Wildcard 搜尋使用 &#8220;*&#8221; 符號; 如果輸入 &#8220;中國*銀&#8221; (不包含&#8221;號), 結果會有中國信託商業銀行, 中國輸出入銀行圖書閱覽室, 中國商銀證券<br />
中國及銀之間可夾任何長短字詞.</p>
<p>10. 當然還有一些更深入的用法,這裡只是初級的解說,若有興趣可以看看 lucene 或 solr的 document.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uyun.com/2008/04/solr-and-use-lucene-primary-explanation-of-the-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
