1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
2 |
<html><head> |
3 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
4 |
|
5 |
|
6 |
<title>Use a different Lucene Analyzer - Hippo</title> |
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
<meta id="confluence-context-path" name="confluence-context-path" content=""> |
16 |
<meta id="confluence-space-key" name="confluence-space-key" content="CMS7"> |
17 |
|
18 |
<script type="text/javascript"> |
19 |
// Deprecated global variables. To be removed in a future version of Confluence. |
20 |
var contextPath = ''; |
21 |
var i18n = []; |
22 |
</script> |
23 |
|
24 |
|
25 |
|
26 |
<!-- include system resources --> |
27 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/master.css" title="Confluence Master Stylesheet" media="all"> |
28 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/wiki-content.css" media="all"> |
29 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/tabs.css" media="all"> |
30 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/menu.css" media="all"> |
31 |
<!--[if IE]> |
32 |
<link type="text/css" rel="stylesheet" href="/s/1519/32/1.0/_/download/resources/confluence.web.resources%3Amaster-styles/menu-ie.css" media="all"/> |
33 |
<![endif]--> |
34 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/tables.css" media="all"> |
35 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/panels.css" media="all"> |
36 |
<!--[if IE]> |
37 |
<link type="text/css" rel="stylesheet" href="/s/1519/32/1.0/_/download/resources/confluence.web.resources%3Amaster-styles/master-ie.css" title="Master-IE" media="all"/> |
38 |
<![endif]--> |
39 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/renderer-macros.css" media="all"> |
40 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/content-types.css" media="all"> |
41 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/information-macros.css" media="all"> |
42 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/layout-macros.css" media="all"> |
43 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/jquery.js"></script> |
44 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/jquery-compatibility.js"></script> |
45 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/jquery_002.js"></script> |
46 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/atlassian.js"></script> |
47 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/breadcrumbs.js"></script> |
48 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/prototype.js"></script> |
49 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/effects.js"></script> |
50 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/dragdrop.js"></script> |
51 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/controls.js"></script> |
52 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/util.js"></script> |
53 |
<!-- Error loading resource "com.atlassian.confluence.themes.clickr:styles". Resource not found --> |
54 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/drop-down.js"></script> |
55 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/drop-down.css" media="all"> |
56 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/contentnamesearch.js"></script> |
57 |
<link type="text/css" rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/contentnamesearch.css" media="all"> |
58 |
<script type="text/javascript" src="Use+a+different+Lucene+Analyzer_files/atlassian-effects.js"></script> |
59 |
|
60 |
<!-- end system resources --> |
61 |
|
62 |
<link rel="stylesheet" href="Use+a+different+Lucene+Analyzer_files/combined.css" type="text/css"> |
63 |
|
64 |
<meta name="confluence-request-time" content="1263372735605"> |
65 |
|
66 |
<link rel="shortcut icon" href="http://wiki.onehippo.com/favicon.ico"> |
67 |
<link rel="icon" type="image/png" href="http://wiki.onehippo.com/images/logo/confluence_16.png"> |
68 |
|
69 |
<link rel="search" type="application/opensearchdescription+xml" href="http://wiki.onehippo.com/opensearch/osd.action" title="Hippo"> |
70 |
|
71 |
|
72 |
|
73 |
</head><body onload="placeFocus()" id="com-atlassian-confluence"> |
74 |
|
75 |
|
76 |
<div id="header"> |
77 |
|
78 |
|
79 |
<ol id="breadcrumbs"> |
80 |
|
81 |
<li class="first"><span> |
82 |
<a href="http://wiki.onehippo.com/dashboard.action">Dashboard</a> |
83 |
</span></li> |
84 |
|
85 |
<li><span> |
86 |
<a href="http://wiki.onehippo.com/display/CMS7">Hippo CMS 7</a> |
87 |
</span></li> |
88 |
<li id="ellipsis" title=" ��� |
89 |
Home |
90 |
> Hippo CMS 7 wiki documentation |
91 |
���"><span><strong>���</strong></span></li> |
92 |
|
93 |
<li class="hidden-crumb"><span> |
94 |
<a href="http://wiki.onehippo.com/display/CMS7/Home">Home</a> |
95 |
</span></li> |
96 |
|
97 |
<li class="hidden-crumb"><span> |
98 |
<a href="http://wiki.onehippo.com/display/CMS7/Hippo+CMS+7+wiki+documentation">Hippo CMS 7 wiki documentation</a> |
99 |
</span></li> |
100 |
|
101 |
<li><span> |
102 |
<a href="http://wiki.onehippo.com/pages/viewpage.action?pageId=11471825">How do I?</a> |
103 |
</span></li> |
104 |
|
105 |
<li><span> |
106 |
Use a different Lucene Analyzer |
107 |
</span></li> |
108 |
</ol> |
109 |
|
110 |
<form id="quick-search" method="get" action="/dosearchsite.action"> |
111 |
<fieldset> |
112 |
<legend>Quick Search</legend> |
113 |
<input id="quick-search-query" accesskey="q" autocomplete="off" name="queryString" size="25" type="text"> |
114 |
<input id="quick-search-submit" value="Search" type="submit"> |
115 |
</fieldset> |
116 |
<fieldset class="hidden parameters"> |
117 |
<input id="quickSearchPlaceholder" value="Search" type="hidden"> |
118 |
|
119 |
<input id="quickNavEnabled" value="true" type="hidden"> |
120 |
<!-- Quick nav disabled. SettingsManager could not be found --> </fieldset> |
121 |
</form> |
122 |
</div> |
123 |
<div id="main"> |
124 |
|
125 |
<p id="navigation"> |
126 |
|
127 |
<a id="viewPageLink" href="http://wiki.onehippo.com/display/CMS7/Use+a+different+Lucene+Analyzer" class="current" accesskey="v"><u>V</u>iew</a> |
128 |
<span style="color: rgb(204, 204, 204);">���</span> <a id="view-attachments-link" href="http://wiki.onehippo.com/pages/viewpageattachments.action?pageId=18088876" accesskey="a"><u>A</u>ttachments (0)</a> |
129 |
<span style="color: rgb(204, 204, 204);">���</span> <a id="view-page-info-link" href="http://wiki.onehippo.com/pages/viewinfo.action?pageId=18088876" accesskey="i"><u>I</u>nfo</a> |
130 |
|
131 |
</p> |
132 |
<h1><a href="http://wiki.onehippo.com/display/CMS7"><img class="logo global custom" src="Use+a+different+Lucene+Analyzer_files/global.gif" alt=""></a> <a href="http://wiki.onehippo.com/display/CMS7/Use+a+different+Lucene+Analyzer">Use a different Lucene Analyzer</a> |
133 |
</h1> |
134 |
|
135 |
|
136 |
<!-- |
137 |
Root decorator: this is a layer of abstraction that Confluence doesn't need. It will be removed eventually. |
138 |
--> |
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
<div class="wiki-content" style="margin-right: 10px;"> |
179 |
<!-- wiki content --> |
180 |
<h2><a name="UseadifferentLuceneAnalyzer-Introduction"></a>Introduction</h2> |
181 |
<p>Hippo Repository uses <a href="http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/analysis/standard/StandardAnalyzer.html" rel="nofollow">org.apache.lucene.analysis.standard.StandardAnalyzer</a> |
182 |
as default Lucene Analyzer for the stored content. It contains a list |
183 |
of common English stopwords like "the", "and" and "or" which it doesn't |
184 |
index. Some languages have their own Lucene analyzer like German, |
185 |
French and Dutch. </p> |
186 |
|
187 |
<p>For example the DutchAnalyzer treats "financi��n" (spelled correctly) |
188 |
and "financien" (without the accent on the e) as the same word. |
189 |
Visitors of your site don't have to think about whether to use accents |
190 |
on letters or not. The DutchAnalyzer also supports stemming (strip |
191 |
words to their root). The side effect is that it breaks wildcard |
192 |
searching.</p> |
193 |
|
194 |
<h2><a name="UseadifferentLuceneAnalyzer-ConfigureadifferentLuceneAnalyzer"></a>Configure a different Lucene Analyzer</h2> |
195 |
<h3><a name="UseadifferentLuceneAnalyzer-Adddependency"></a>Add dependency</h3> |
196 |
<p>To configure a diffferent Lucene Analyzer, first add the |
197 |
lucene-analyzers dependency to the pom.xml of each subproject that |
198 |
contains its own repository. This is mostly the "CMS" subproject. If |
199 |
your website and CMS use their own repositories, add it to the projects |
200 |
that need the different analyzers.</p> |
201 |
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
202 |
<pre class="code-xml"><span class="code-tag"><dependency></span> |
203 |
<span class="code-tag"><groupId></span>org.apache.lucene<span class="code-tag"></groupId></span> |
204 |
<span class="code-tag"><artifactId></span>lucene-analyzers<span class="code-tag"></artifactId></span> |
205 |
<span class="code-tag"><span class="code-comment"><!-- check the version for your current Hippo Repository --></span></span> |
206 |
<span class="code-tag"><version></span>2.3.2<span class="code-tag"></version></span> |
207 |
<span class="code-tag"></dependency></span> |
208 |
</pre> |
209 |
</div></div> |
210 |
|
211 |
<h3><a name="UseadifferentLuceneAnalyzer-ModifytheAnalyzerclass"></a>Modify the Analyzer class</h3> |
212 |
<p>The Analyzer class is configured in the repository.xml file. If you do not have one yet, you can copy it from <tt>cms/target/work/webapp/WEB-INF/classes/org/hippoecm/repository/repository.xml</tt> after you installed your CMS subproject. <br> |
213 |
In a running project it can be read from a filesystem location or from |
214 |
the application package. If you want to keep this file in your |
215 |
application package, copy it to <tt>src/main/resources/org/hippoecm/repository/repository.xml</tt> in your Maven project. <br> |
216 |
Change the value of </p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
217 |
<pre class="code-xml"><span class="code-tag"><param name=<span class="code-quote">"analyzer"</span> value=<span class="code-quote">"org.apache.lucene.analysis.standard.StandardAnalyzer"</span>/></span></pre> |
218 |
</div></div> to the classname of your analyzer. |
219 |
|
220 |
<h3><a name="UseadifferentLuceneAnalyzer-Optionallyconfigurethelocationofrepository.xml"></a>Optionally configure the location of repository.xml</h3> |
221 |
<p>If the repository.xml is not in the default location, also modify the web.xml:</p> |
222 |
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
223 |
<pre class="code-xml"><span class="code-tag"><span class="code-comment"><!-- Repository --></span></span> |
224 |
<span class="code-tag"><servlet></span> |
225 |
<span class="code-tag"><servlet-name></span>Repository<span class="code-tag"></servlet-name></span> |
226 |
<span class="code-tag"><servlet-class></span>org.hippoecm.repository.RepositoryServlet<span class="code-tag"></servlet-class></span> |
227 |
<span class="code-tag"><init-param></span> |
228 |
<span class="code-tag"><param-name></span>repository-config<span class="code-tag"></param-name></span> |
229 |
<span class="code-tag"><param-value></span>repository.xml<span class="code-tag"></param-value></span> |
230 |
<span class="code-tag"><description></span>The location of the repository configuration file. |
231 |
Unless the location starts with file://, the location is |
232 |
retrieved from within the application package as resource |
233 |
<span class="code-tag"></description></span> |
234 |
<span class="code-tag"></init-param></span> |
235 |
<span class="code-tag"><load-on-startup></span>4<span class="code-tag"></load-on-startup></span> |
236 |
<span class="code-tag"></servlet></span> |
237 |
</pre> |
238 |
</div></div> |
239 |
</div> |
240 |
|
241 |
<!-- |
242 |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
243 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
244 |
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> |
245 |
<rdf:Description |
246 |
rdf:about="http://wiki.onehippo.com/display/CMS7/Use+a+different+Lucene+Analyzer" |
247 |
dc:identifier="http://wiki.onehippo.com/display/CMS7/Use+a+different+Lucene+Analyzer" |
248 |
dc:title="Use a different Lucene Analyzer" |
249 |
trackback:ping="http://wiki.onehippo.com/rpc/trackback/18088876"/> |
250 |
</rdf:RDF> |
251 |
--> |
252 |
|
253 |
|
254 |
<!-- |
255 |
Root decorator: this is a layer of abstraction that Confluence doesn't need. It will be removed eventually. |
256 |
--> |
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
<div class="wiki-content" style="margin-right: 10px; clear: both;"> |
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
</div> |
274 |
</div> |
275 |
|
276 |
|
277 |
<br clear="all"> |
278 |
|
279 |
|
280 |
<div class="BottomStrip"> |
281 |
<table id="MegaFooter" align="center" width="760"> |
282 |
<tbody><tr valign="top"> |
283 |
<td width="20%"> |
284 |
<h2>Browse Space</h2> |
285 |
<p> |
286 |
|
287 |
- <a href="http://wiki.onehippo.com/pages/listpages.action?key=CMS7">Pages</a><br> |
288 |
- <a href="http://wiki.onehippo.com/pages/viewrecentblogposts.action?key=CMS7">News</a><br> |
289 |
- <a href="http://wiki.onehippo.com/labels/listlabels-heatmap.action?key=CMS7">Labels</a><br> |
290 |
- <a href="http://wiki.onehippo.com/spaces/listattachmentsforspace.action?key=CMS7">Attachments</a><br> |
291 |
- <a href="http://wiki.onehippo.com/spaces/space-bookmarks.action?spaceKey=CMS7">Bookmarks</a><br> |
292 |
- <a href="http://wiki.onehippo.com/spaces/viewmailarchive.action?key=CMS7">Mail</a><br> |
293 |
- <a href="http://wiki.onehippo.com/spaces/viewspacesummary.action?key=CMS7">Advanced</a><br> |
294 |
- <a href="http://wiki.onehippo.com/spaces/usage/report.action?key=CMS7">Activity</a><br> |
295 |
|
296 |
</p> |
297 |
</td> |
298 |
|
299 |
<td width="20%"> |
300 |
<h2>Explore Confluence</h2> |
301 |
<p> |
302 |
- <a href="http://wiki.onehippo.com/labels/listlabels-heatmap.action">Popular Labels</a><br> |
303 |
- <a href="http://wiki.onehippo.com/renderer/notationhelp.action">Notation Guide</a><br> |
304 |
</p> |
305 |
</td> |
306 |
<td width="20%"> |
307 |
<h2>Your Account</h2> |
308 |
<p> |
309 |
|
310 |
|
311 |
<a href="http://wiki.onehippo.com/login.action?os_destination=%2Fdisplay%2FCMS7%2FUse%2Ba%2Bdifferent%2BLucene%2BAnalyzer">Log In</a> <br> <br> |
312 |
|
313 |
or <a href="http://wiki.onehippo.com/signup.action">Sign Up</a> |
314 |
|
315 |
</p> |
316 |
</td> |
317 |
<td id="other-features" width="20%"> |
318 |
<h2>Other Features</h2> |
319 |
|
320 |
|
321 |
<ul id="page-view-panel"> |
322 |
<li> <a href="http://wiki.onehippo.com/pages/viewpage.action?spaceKey=CMS7&title=Use+a+different+Lucene+Analyzer&decorator=printable" rel="nofollow" title="View a printable version of the current page." class="print icon">View a printable version of the current page.</a> |
323 |
</li> |
324 |
<li> |
325 |
</li> |
326 |
<li> </li> |
327 |
</ul> |
328 |
|
329 |
</td> |
330 |
|
331 |
<td width="20%"> |
332 |
<h2>Add Content</h2> |
333 |
<p> |
334 |
|
335 |
|
336 |
- <a href="http://wiki.onehippo.com/display/CMS7/Use+a+different+Lucene+Analyzer?showComments=true&showCommentArea=true#addcomment">Add Comment</a><br> |
337 |
</p> |
338 |
</td> |
339 |
</tr> |
340 |
|
341 |
</tbody></table> |
342 |
</div> |
343 |
|
344 |
<br clear="all"> |
345 |
|
346 |
<p class="footer"> |
347 |
Powered by <a href="http://www.atlassian.com/software/confluence" class="smalltext">Atlassian Confluence</a> 2.10.3, the <a href="http://www.atlassian.com/software/confluence" class="smalltext">Enterprise Wiki</a>.<br> |
348 |
<a href="http://jira.atlassian.com/browse/CONF" class="smalltext">Bug/feature request</a> |
349 |
- |
350 |
<a href="http://wiki.onehippo.com/administrators.action">Contact administrators</a> |
351 |
</p> |
352 |
|
353 |
<!-- delay the loading of large javascript files to the end so that they don't interfere with the loading of page content --> |
354 |
<span style="display: none;"></span> |
355 |
|
356 |
|
357 |
</body></html> |