Changes for page Lucene Search Query Help

Last modified by Djebloun Sidali on 2014/02/23 15:55

<
From version < 7.1 >
edited by Eduard Moraru
on 2011/04/20 16:44
To version < 14.2 >
edited by Mircea Staicu
on 2013/03/04 11:02
>
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.enygma
1 +xwiki:XWiki.mstaicu
Content
... ... @@ -107,7 +107,7 @@
107 107  To search for documents that contain "jakarta apache" but not "Apache Lucene" use the query:
108 108  
109 109  {{code}}
110 -"jakarta apache" &#45;"Apache Lucene"
110 +"jakarta apache" -"Apache Lucene"
111 111  {{/code}}
112 112  
113 113  == Grouping ==
... ... @@ -148,7 +148,7 @@
148 148  
149 149  = Searchable fields =
150 150  
151 -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.
152 152  
153 153  == wiki ==
154 154  
... ... @@ -188,20 +188,33 @@
188 188  
189 189  Type of a document: "attachment", "wikipage" or "objects", used to control presentation of searchresults.
190 190  
191 -Look for "test" in attachments :
191 +Look for "test" in attachments:
192 192  
193 193  {{code}}
194 194  test AND type:attachment
195 195  {{/code}}
196 196  
197 +Look for "test" in pages but exclude attachments containing the word test:
198 +
199 +{{code}}
200 +test AND -type:attachment
201 +{{/code}}
202 +
197 197  == filename ==
198 198  
199 -Look for attachments with a filename starting by "test":
205 +Look for attachments with a filename starting with "test":
200 200  
201 201  {{code}}
202 202  filename:test*
203 203  {{/code}}
204 204  
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 +
205 205  == object ==
206 206  
207 207  The "object:" prefix allow to search for pages containing objects from a specific class.
... ... @@ -247,3 +247,33 @@
247 247  {{code}}
248 248  creationdate:20090708*
249 249  {{/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}}
279 +
280 +Looking for documents by a value which is stored in a DatabaseTree property in an object. As a mention, the searched value can be wrapped inside round paranthesis or single / double quotes
281 +
282 +{{code}}
283 ++Space.Class.databaseTreeProperty:(searchedValue)
284 +{{/code}}
285 +
286 +If you would like to add a logical disjunction to the above use case, you can do it like this:
287 +
288 +{{code}}
289 ++Space.Class.databaseTreeProperty:(searchedValue OR anotherSearchedValue)
290 +{{/code}}
291 +
292 +This will return all documents which contain in the object's property value either searchedValue or anotherSearchedValue

Get Connected