<
From version < 6.2 >
edited by Vincent Massol
on 2010/12/13 08:17
To version < 13.1 >
edited by Xavier Richard
on 2013/01/18 22:26
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 - Lucene Search Query Help
1 +Lucene Search Query Help
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.VincentMassol
1 +xwiki:XWiki.xrichard
Content
... ... @@ -1,4 +1,6 @@
1 -{{box cssClass="floatinginfobox" title="**Contents**"}}{{toc/}}{{/box}}
1 +{{box cssClass="floatinginfobox" title="**Contents**"}}
2 +{{toc/}}
3 +{{/box}}
2 2  
3 3  {{info}}
4 4  Need more informations? See the [[lucene website>>http://lucene.apache.org/java/docs/index.html]]. More specifically look for the "Query Syntax" documentation entry for the Lucene Core version matching the version used in your XWiki installation (to find the version used by XWiki look for ##lucene-core-x.y.z.jar## in the XWiki's ##/WEB-INF/lib## folder. For example for XWiki Enterprise 2.6 uses Lucene Core 2.9.3 which means the Lucene Query Syntax can be found [[here>>http://lucene.apache.org/java/2_9_3/queryparsersyntax.html]].
... ... @@ -105,7 +105,7 @@
105 105  To search for documents that contain "jakarta apache" but not "Apache Lucene" use the query:
106 106  
107 107  {{code}}
108 -"jakarta apache" &#45;"Apache Lucene"
110 +"jakarta apache" -"Apache Lucene"
109 109  {{/code}}
110 110  
111 111  == Grouping ==
... ... @@ -138,7 +138,7 @@
138 138  + - && || ! ( ) { } [ ] ^ " ~ * ? : \
139 139  {{/code}}
140 140  
141 -To escape these character use the before the character. For example to search for (1+1):2 use the query:
143 +To escape these character use "\" (backslash) before the character. For example to search for (1+1):2 use the query:
142 142  
143 143  {{code}}
144 144  \(1\+1\)\:2
... ... @@ -146,7 +146,7 @@
146 146  
147 147  = Searchable fields =
148 148  
149 -XWiki documents contain wiki content and meta-information, lucene indexes such information in fields.
151 +XWiki documents contain wiki content and meta-information. Lucene indexes such information in fields.
150 150  
151 151  == wiki ==
152 152  
... ... @@ -186,20 +186,33 @@
186 186  
187 187  Type of a document: "attachment", "wikipage" or "objects", used to control presentation of searchresults.
188 188  
189 -Look for "test" in attachments :
191 +Look for "test" in attachments:
190 190  
191 191  {{code}}
192 192  test AND type:attachment
193 193  {{/code}}
194 194  
197 +Look for "test" in pages but exclude attachments containing the word test:
198 +
199 +{{code}}
200 +test AND -type:attachment
201 +{{/code}}
202 +
195 195  == filename ==
196 196  
197 -Look for attachments with a filename starting by "test":
205 +Look for attachments with a filename starting with "test":
198 198  
199 199  {{code}}
200 200  filename:test*
201 201  {{/code}}
202 202  
211 +== mimetype ==
212 +
213 +Look for attachments with a certain MIME type. Examples:
214 +
215 +* Search for PDFs only: {{code language="none"}}mimetype:application/pdf{{/code}}
216 +* Search for all attachments except images: {{code language="none"}}type:attachment -mimetype:image/*{{/code}}
217 +
203 203  == object ==
204 204  
205 205  The "object:" prefix allow to search for pages containing objects from a specific class.
... ... @@ -245,3 +245,19 @@
245 245  {{code}}
246 246  creationdate:20090708*
247 247  {{/code}}
263 +
264 +== Searching for fields in XWiki objects ==
265 +
266 +Beside Lucene's XWiki specific index fields, querying for documents based on the property values of contained XWiki objects is also possible.
267 +
268 +Look for the profile page of a user who's first name is 'Administrator'.
269 +
270 +{{code}}
271 +XWiki.XWikiUsers.first_name:'Administrator'
272 +{{/code}}
273 +
274 +Look for all users or groups, except the group template:
275 +
276 +{{code}}
277 ++(object:XWiki.XWikiUsers object:XWiki.XWikiGroups) -name:XWikiGroupTemplate
278 +{{/code}}

Get Connected