Skip to content
This repository
Newer
Older
100644 525 lines (414 sloc) 17.572 kb
b9ba5b0d »
2009-08-31 warn against using 0.5 for now.
1 <h1>WARNING</h1>
90790ae3 »
2009-08-31 add recommendation for 0.4 for now.
2
eab21117 »
2009-10-07 typo
3 This branch (master) contains the development version of the next release (0.5). It is not yet stable or feature complete and should not be used for anything but testing. The documentation in this readme is also not yet accurate for 0.5, proceed with caution!
c10ef59e »
2009-10-07 add terrifying warning prior to merge down to master.
4
354d4ea6 »
2009-09-21 add note on unpacking the 0.4 release.
5 <b>I strongly recommend using the 0.4 release</b> (available at <a href="http://cloud.github.com/downloads/rnewson/couchdb-lucene/couchdb-lucene-0.4-jar-with-dependencies.jar.gz">GitHub</a>, please see the <a href="http://cloud.github.com/downloads/rnewson/couchdb-lucene/README">README</a> for unpacking details) as the 0.5 work will occur on trunk and will definitely have extended periods of instability and broken-ness.
90790ae3 »
2009-08-31 add recommendation for 0.4 for now.
6
6d1c0742 »
2009-09-15 add notes about version compatibility.
7 <h1>Version Compatibility</h1>
8
9 <table>
10 <tr><th>CouchDB</th><th>couchdb-lucene</th></tr>
11 <tr><td>0.9.1, 0.10</td><td>0.4</td></tr>
d90560d8 »
2009-10-09 update docs.
12 <tr><td>0.11 (not yet released)</td><td>0.4-maint (0.4 with patch for trunk compatibility)</td></tr>
b578e981 »
2009-10-08 document committment to support multiple couchdb versions.
13 <tr><td>0.9.1, 0.10, 0.11 (not yet released)</td><td>0.5 (not yet released)</td></tr>
6d1c0742 »
2009-09-15 add notes about version compatibility.
14 </table>
15
c6356fd5 »
2009-04-26 update README.md and TODO to reflect progress.
16 <h1>Issue Tracking</h1>
a785480d »
2009-05-09 lighthouse sucks at formatting anything, abandon ship.
17
7a0d1d38 »
2009-05-09 lighthouse sucks at formatting anything, abandon ship.
18 Issue tracking at <a href="http://github.com/rnewson/couchdb-lucene/issues">github</a>.
5d4e56ad »
2009-03-06 update readme.
19
7dc5bac3 »
2009-09-02 reorg begins.
20 <h1>Minimum System Requirements</h1>
ef3f787b »
2009-04-06 add sysreq for Sun JDK.
21
796a42b6 »
2009-10-08 jdk 5 compatibility for readme.
22 Java 1.5 (or above) is required; the Sun version is recommended as it's regularly tested against.
ef3f787b »
2009-04-06 add sysreq for Sun JDK.
23
5220b654 »
2009-02-14 tweak README.md
24 <h1>Build couchdb-lucene</h1>
b2079657 »
2009-02-14 improve README readability.
25
26 <ol>
27 <li>Install Maven 2.
28 <li>checkout repository
29 <li>type 'mvn'
30 <li>configure couchdb (see below)
31 </ol>
32
2d6180b9 »
2009-10-07 include properties file in zip. still not available to run script, th…
33 You will now have a zip file in the target/ directory. This contains all the couchdb-lucene code, dependencies, startup scripts and configuration files to run couchdb-lucene.
34
b2079657 »
2009-02-14 improve README readability.
35 <h1>Configure CouchDB</h1>
36
37 <pre>
05631204 »
2009-03-07 fixes.
38 [couchdb]
39 os_process_timeout=60000 ; increase the timeout from 5 seconds.
40
b2079657 »
2009-02-14 improve README readability.
41 [external]
d2d0caa2 »
2009-10-09 update readme
42 fti=/path/to/ruby /usr/lib/couchdb/couchdb-lucene/couchdb-external-hook.py --url="http://localhost:5985"
b2079657 »
2009-02-14 improve README readability.
43
44 [httpd_db_handlers]
45 _fti = {couch_httpd_external, handle_external_req, <<"fti">>}
46 </pre>
47
b047e4a2 »
2009-09-07 update README.md to reflect (future) start/stop and config changes.
48 <h1>Configure couchdb-lucene</h1>
49
2d6180b9 »
2009-10-07 include properties file in zip. still not available to run script, th…
50 From 0.5 onwards, couchdb-lucene runs in a single, standalone JVM. As such, you can choose to locate your couchdb-lucene server on a different machine to couchdb if you wish, or keep it on the same machine, it's your call.
b047e4a2 »
2009-09-07 update README.md to reflect (future) start/stop and config changes.
51
2d6180b9 »
2009-10-07 include properties file in zip. still not available to run script, th…
52 <ol>
53 <li>Unzip the couchdb-lucene zip file.
54 <li>Open the conf/couchdb-lucene.properties file.
55 <li>Edit the couchdb.url to point to your couchdb installation.
b047e4a2 »
2009-09-07 update README.md to reflect (future) start/stop and config changes.
56
57 <h1>Start couchdb-lucene</h1>
58
59 To start couchdb-lucene, run;
60 <pre>
2d6180b9 »
2009-10-07 include properties file in zip. still not available to run script, th…
61 bin/run
b047e4a2 »
2009-09-07 update README.md to reflect (future) start/stop and config changes.
62 </pre>
63
2d6180b9 »
2009-10-07 include properties file in zip. still not available to run script, th…
64 To stop couchdb-lucene, simply kill the Java process.
b047e4a2 »
2009-09-07 update README.md to reflect (future) start/stop and config changes.
65
b2079657 »
2009-02-14 improve README readability.
66 <h1>Indexing Strategy</h1>
67
4a600804 »
2009-02-18 use couchdb's content_type rather than auto-detect.
68 <h2>Document Indexing</h2>
69
4c21806e »
2009-07-15 mention that you can return Document[] from an index function.
70 You must supply a index function in order to enable couchdb-lucene as, by default, nothing will be indexed. To suppress a document from the index, return null. It's more typical to return a single Document object which contains everything you'd like to query and retrieve. You may also return an array of Document objects if you wish.
a2e9024b »
2009-03-06 wip
71
437eae90 »
2009-05-03 s/view/fulltext in README.md
72 You may add any number of index views in any number of design documents. All searches will be constrained to documents emitted by the index functions.
c207a604 »
2009-04-04 update README
73
50773667 »
2009-07-09 clarify design document and add matching query URL's.
74 Here's an complete example of a design document with couchdb-lucene features:
a2e9024b »
2009-03-06 wip
75
697884bd »
2009-04-21 documentation of future features.
76 <pre>
77 {
d1c9c80d »
2009-08-25 correct _id of first example.
78 "_id":"_design/a_design_document_with_any_name_you_like",
50773667 »
2009-07-09 clarify design document and add matching query URL's.
79 "fulltext": {
80 "by_subject": {
81 "index":"function(doc) { var ret=new Document(); ret.add(doc.subject); return ret }"
82 },
83 "by_content": {
84 "index":"function(doc) { var ret=new Document(); ret.add(doc.content); return ret }"
85 }
697884bd »
2009-04-21 documentation of future features.
86 }
87 }
88 </pre>
89
50773667 »
2009-07-09 clarify design document and add matching query URL's.
90 Here are some example URL's for the given design document;
91
92 <pre>
93 http://localhost:5984/database/_fti/lucene/by_subject?q=hello
94 http://localhost:5984/database/_fti/lucene/by_content?q=hello
95 </pre>
96
697884bd »
2009-04-21 documentation of future features.
97 A fulltext object contains multiple index view declarations. An index view consists of;
98
99 <dl>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
100 <dt>analyzer</dt><dd>(optional) The analyzer to use</dd>
101 <dt>defaults</dt><dd>(optional) The default for numerous indexing options can be overridden here. A full list of options follows.</dd>
697884bd »
2009-04-21 documentation of future features.
102 <dt>index</dt><dd>The indexing function itself, documented below.</dd>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
103 </dl>
697884bd »
2009-04-21 documentation of future features.
104
105 <h3>The Defaults Object</h3>
106
107 The following indexing options can be defaulted;
108
109 <table>
110 <tr>
111 <th>name</th>
112 <th>description</th>
113 <th>available options</th>
114 <th>default</th>
115 </tr>
116 <tr>
a40523d3 »
2009-04-21 documentation of future features.
117 <th>field</th>
118 <td>the field name to index under</td>
119 <td>user-defined</td>
120 <td>default</td>
d2e1e9ea »
2009-08-31 add notes about typing.
121 </tr>
122 <tr>
123 <th>type</th>
124 <td>the type of the field</td>
125 <td>date, double, float, integer, long, string</td>
126 <td>string</td>
127 </tr>
a40523d3 »
2009-04-21 documentation of future features.
128 <tr>
697884bd »
2009-04-21 documentation of future features.
129 <th>store</th>
f16fc9c8 »
2009-04-26 docs
130 <td>whether the data is stored. The value will be returned in the search result.</td>
697884bd »
2009-04-21 documentation of future features.
131 <td>yes, no</td>
132 <td>no</td>
d2e1e9ea »
2009-08-31 add notes about typing.
133 </tr>
697884bd »
2009-04-21 documentation of future features.
134 <tr>
135 <th>index</th>
136 <td>whether (and how) the data is indexed</td>
83283325 »
2009-04-21 typo
137 <td>analyzed, analyzed_no_norms, no, not_analyzed, not_analyzed_no_norms</td>
697884bd »
2009-04-21 documentation of future features.
138 <td>analyzed</td>
d2e1e9ea »
2009-08-31 add notes about typing.
139 </tr>
697884bd »
2009-04-21 documentation of future features.
140 </table>
087dcec0 »
2009-04-04 update documentation.
141
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
142 <h3>The Analyzer Option</h3>
143
144 Lucene has numerous ways of converting free-form text into tokens, these classes are called Analyzer's. By default, the StandardAnalyzer is used which lower-cases all text, drops common English words ("the", "and", and so on), among other things. This processing might not always suit you, so you can choose from several others by setting the "analyzer" field to one of the following values;
145
146 <ul>
147 <li>brazilian</li>
148 <li>chinese</li>
149 <li>cjk</li>
150 <li>czech</li>
151 <li>dutch</li>
152 <li>english</li>
153 <li>french</li>
154 <li>german</li>
155 <li>keyword</li>
156 <li>porter</li>
157 <li>russian</li>
158 <li>simple</li>
159 <li>standard</li>
160 <li>thai</li>
161 </ul>
162
163 Note: You must also supply analyzer=<analyzer_name> as a query parameter to ensure that queries are processed correctly.
164
087dcec0 »
2009-04-04 update documentation.
165 <h3>The Document class</h3>
166
167 You may construct a new Document instance with;
168
169 <pre>
170 var doc = new Document();
171 </pre>
172
a40523d3 »
2009-04-21 documentation of future features.
173 Data may be added to this document with the add method which takes an optional second object argument that can override any of the above default values.
087dcec0 »
2009-04-04 update documentation.
174
175 <pre>
a40523d3 »
2009-04-21 documentation of future features.
176 // Add with all the defaults.
177 doc.add("value");
178
d2e1e9ea »
2009-08-31 add notes about typing.
179 // Add a numeric field.
180 doc.add(35, {"type":"integer"});
181
46705824 »
2009-08-31 use NumericField. currently broken.
182 // Add a date field.
183 doc.add(new Date("2009-01-01"), {"type":"date"});
184
d2e1e9ea »
2009-08-31 add notes about typing.
185 // Add a date field (object must be a Date object
186
a40523d3 »
2009-04-21 documentation of future features.
187 // Add a subject field.
188 doc.add("this is the subject line.", {"field":"subject"});
9a715570 »
2009-04-05 formatting
189
a40523d3 »
2009-04-21 documentation of future features.
190 // Add but ensure it's stored.
191 doc.add("value", {"store":"yes"});
9a715570 »
2009-04-05 formatting
192
a40523d3 »
2009-04-21 documentation of future features.
193 // Add but don't analyze.
194 doc.add("don't analyze me", {"index":"not_analyzed"});
9a715570 »
2009-04-05 formatting
195
196 // Extract text from the named attachment and index it (but not store it).
a40523d3 »
2009-04-21 documentation of future features.
197 doc.attachment("attachment name", {"field":"attachments"});
087dcec0 »
2009-04-04 update documentation.
198 </pre>
199
ccb81a8a »
2009-03-20 add example transforms section.
200 <h3>Example Transforms</h3>
201
390858a2 »
2009-04-05 re-add Index Everything example.
202 <h4>Index Everything</h4>
203
204 <pre>
205 function(doc) {
7bad7dc9 »
2009-04-30 correct syntax error in JS fun.
206 var ret = new Document();
207
208 function idx(obj) {
209 for (var key in obj) {
210 switch (typeof obj[key]) {
211 case 'object':
212 idx(obj[key]);
213 break;
214 case 'function':
215 break;
216 default:
217 ret.add(obj[key]);
218 break;
219 }
220 }
221 };
222
223 idx(doc);
224
225 if (doc._attachments) {
226 for (var i in doc._attachments) {
227 ret.attachment("attachment", i);
228 }
390858a2 »
2009-04-05 re-add Index Everything example.
229 }
d2e1e9ea »
2009-08-31 add notes about typing.
230
7bad7dc9 »
2009-04-30 correct syntax error in JS fun.
231 return ret;
390858a2 »
2009-04-05 re-add Index Everything example.
232 }
233 </pre>
234
ccb81a8a »
2009-03-20 add example transforms section.
235 <h4>Index Nothing</h4>
236
237 <pre>
238 function(doc) {
239 return null;
240 }
241 </pre>
242
c207a604 »
2009-04-04 update README
243 <h4>Index Select Fields</h4>
ccb81a8a »
2009-03-20 add example transforms section.
244
245 <pre>
246 function(doc) {
c207a604 »
2009-04-04 update README
247 var result = new Document();
c6356fd5 »
2009-04-26 update README.md and TODO to reflect progress.
248 result.add(doc.subject, {"field":"subject", "store":"yes"});
249 result.add(doc.content, {"field":"subject"});
250 result.add({"field":"indexed_at"});
c207a604 »
2009-04-04 update README
251 return result;
ccb81a8a »
2009-03-20 add example transforms section.
252 }
253 </pre>
254
c207a604 »
2009-04-04 update README
255 <h4>Index Attachments</h4>
ccb81a8a »
2009-03-20 add example transforms section.
256
257 <pre>
258 function(doc) {
c207a604 »
2009-04-04 update README
259 var result = new Document();
260 for(var a in doc._attachments) {
244df305 »
2009-10-10 fix mistake in README
261 result.attachment(a, {"field":"attachment"});
ccb81a8a »
2009-03-20 add example transforms section.
262 }
c207a604 »
2009-04-04 update README
263 return result;
264 }
265 </pre>
266
267 <h4>A More Complex Example</h4>
268
269 <pre>
270 function(doc) {
271 var mk = function(name, value, group) {
c6356fd5 »
2009-04-26 update README.md and TODO to reflect progress.
272 var ret = new Document();
2946c9ae »
2009-05-06 fix example.
273 ret.add(value, {"field": group, "store":"yes"});
c6356fd5 »
2009-04-26 update README.md and TODO to reflect progress.
274 ret.add(group, {"field":"group", "store":"yes"});
c207a604 »
2009-04-04 update README
275 return ret;
276 };
277 var ret = [];
278 if(doc.type != "reference") return null;
279 for(var g in doc.groups) {
c6356fd5 »
2009-04-26 update README.md and TODO to reflect progress.
280 ret.add(mk("library", doc.groups[g].library, g));
281 ret.add(mk("method", doc.groups[g].method, g));
282 ret.add(mk("target", doc.groups[g].target, g));
c207a604 »
2009-04-04 update README
283 }
284 return ret;
285 }
286 </pre>
b2079657 »
2009-02-14 improve README readability.
287
4a600804 »
2009-02-18 use couchdb's content_type rather than auto-detect.
288 <h2>Attachment Indexing</h2>
289
8059ce07 »
2009-03-08 s/couchdb/couchdb-lucene
290 Couchdb-lucene uses <a href="http://lucene.apache.org/tika/">Apache Tika</a> to index attachments of the following types, assuming the correct content_type is set in couchdb;
4a600804 »
2009-02-18 use couchdb's content_type rather than auto-detect.
291
ec94e218 »
2009-02-18 updated README.md
292 <h3>Supported Formats</h3>
293
4a600804 »
2009-02-18 use couchdb's content_type rather than auto-detect.
294 <ul>
295 <li>Excel spreadsheets (application/vnd.ms-excel)
296 <li>HTML (text/html)
297 <li>Images (image/*)
298 <li>Java class files
299 <li>Java jar archives
300 <li>MP3 (audio/mp3)
301 <li>OpenDocument (application/vnd.oasis.opendocument.*)
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
302 <li>Outlook (application/vnd.ms-outlook)
4a600804 »
2009-02-18 use couchdb's content_type rather than auto-detect.
303 <li>PDF (application/pdf)
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
304 <li>Plain text (text/plain)
305 <li>Powerpoint presentations (application/vnd.ms-powerpoint)
4a600804 »
2009-02-18 use couchdb's content_type rather than auto-detect.
306 <li>RTF (application/rtf)
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
307 <li>Visio (application/vnd.visio)
308 <li>Word documents (application/msword)
309 <li>XML (application/xml)
4a600804 »
2009-02-18 use couchdb's content_type rather than auto-detect.
310 </ul>
311
b2079657 »
2009-02-14 improve README readability.
312 <h1>Searching with couchdb-lucene</h1>
313
39b22c82 »
2009-04-01 document that default search field is the _body field that attachment…
314 You can perform all types of queries using Lucene's default <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">query syntax</a>. The _body field is searched by default which will include the extracted text from all attachments. The following parameters can be passed for more sophisticated searches;
b2079657 »
2009-02-14 improve README readability.
315
316 <dl>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
317 <dt>analyzer</dt><dd>The analyzer used to convert the query string into a query object.
318 <dt>callback</dt><dd>Specify a JSONP callback wrapper. The full JSON result will be prepended with this parameter and also placed with parentheses."
71cbc0bf »
2009-08-02 correct description of debug setting.
319 <dt>debug</dt><dd>Setting this to true disables response caching (the query is executed every time) and indents the JSON response for readability.</dd>
ea19e554 »
2009-08-12 add force_json=true to force 'application/json' response type.
320 <dt>force_json<dt><dd>Usually couchdb-lucene determines the Content-Type of its response based on the presence of the Accept header. If Accept contains "application/json", you get "application/json" in the response, otherwise you get "text/plain;charset=utf8". Some tools, like JSONView for FireFox, do not send the Accept header but do render "application/json" responses if received. Setting force_json=true forces all response to "application/json" regardless of the Accept header.</dd>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
321 <dt>include_docs</dt><dd>whether to include the source docs</dd>
f9c61e32 »
2009-03-22 format README
322 <dt>limit</dt><dd>the maximum number of results to return</dd>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
323 <dt>q</dt><dd>the query to run (e.g, subject:hello). If not specified, the default field is searched.</dd>
324 <dt>rewrite</dt><dd>(EXPERT) if true, returns a json response with a rewritten query and term frequencies. This allows correct distributed scoring when combining the results from multiple nodes.</dd>
f9c61e32 »
2009-03-22 format README
325 <dt>skip</dt><dd>the number of results to skip</dd>
c2299c03 »
2009-10-10 a note on numeric type sorting.
326 <dt>sort</dt><dd>the comma-separated fields to sort on. Prefix with / for ascending order and \ for descending order (ascending is the default if not specified). Type-specific sorting is also available by appending a : and the sort type as normal (e.g, 'sort=amount:float').</dd>
637279a5 »
2009-07-11 fix grammar in readme.
327 <dt>stale=ok</dt><dd>If you set the <i>stale</i> option to <i>ok</i>, couchdb-lucene may not perform any refreshing on the index. Searches may be faster as Lucene caches important data (especially for sorting). A query without stale=ok will use the latest data committed to the index.</dd>
ad9096f2 »
2009-02-14 tweak README.md
328 </dl>
b2079657 »
2009-02-14 improve README readability.
329
330 <i>All parameters except 'q' are optional.</i>
331
ec94e218 »
2009-02-18 updated README.md
332 <h2>Special Fields</h2>
333
334 <dl>
f9c61e32 »
2009-03-22 format README
335 <dt>_db</dt><dd>The source database of the document.</dd>
087dcec0 »
2009-04-04 update documentation.
336 <dt>_id</dt><dd>The _id of the document.</dd>
46a3a371 »
2009-03-08 include all DC attributes, if present.
337 </dl>
338
339 <h2>Dublin Core</h2>
340
341 All Dublin Core attributes are indexed and stored if detected in the attachment. Descriptions of the fields come from the Tika javadocs.
342
343 <dl>
6e99faa7 »
2009-05-04 dc. to _dc.
344 <dt>_dc.contributor</dt><dd> An entity responsible for making contributions to the content of the resource.</dd>
345 <dt>_dc.coverage</dt><dd>The extent or scope of the content of the resource.</dd>
346 <dt>_dc.creator</dt><dd>An entity primarily responsible for making the content of the resource.</dd>
347 <dt>_dc.date</dt><dd>A date associated with an event in the life cycle of the resource.</dd>
348 <dt>_dc.description</dt><dd>An account of the content of the resource.</dd>
349 <dt>_dc.format</dt><dd>Typically, Format may include the media-type or dimensions of the resource.</dd>
350 <dt>_dc.identifier</dt><dd>Recommended best practice is to identify the resource by means of a string or number conforming to a formal identification system.</dd>
351 <dt>_dc.language</dt><dd>A language of the intellectual content of the resource.</dd>
352 <dt>_dc.modified</dt><dd>Date on which the resource was changed.</dd>
353 <dt>_dc.publisher</dt><dd>An entity responsible for making the resource available.</dd>
354 <dt>_dc.relation</dt><dd>A reference to a related resource.</dd>
355 <dt>_dc.rights</dt><dd>Information about rights held in and over the resource.</dd>
356 <dt>_dc.source</dt><dd>A reference to a resource from which the present resource is derived.</dd>
357 <dt>_dc.subject</dt><dd>The topic of the content of the resource.</dd>
358 <dt>_dc.title</dt><dd>A name given to the resource.</dd>
359 <dt>_dc.type</dt><dd>The nature or genre of the content of the resource.</dd>
ec94e218 »
2009-02-18 updated README.md
360 </dl>
361
b2079657 »
2009-02-14 improve README readability.
362 <h2>Examples</h2>
363
364 <pre>
405e3a37 »
2009-04-29 update query urls' to reflect new syntax
365 http://localhost:5984/dbname/_fti/design_doc/view_name?q=field_name:value
366 http://localhost:5984/dbname/_fti/design_doc/view_name?q=field_name:value&sort=other_field
367 http://localhost:5984/dbname/_fti/design_doc/view_name?debug=true&sort=billing_size&q=body:document AND customer:[A TO C]
b2079657 »
2009-02-14 improve README readability.
368 </pre>
369
370 <h2>Search Results Format</h2>
371
0fcf5787 »
2009-04-26 update docs.
372 The search result contains a number of fields at the top level, in addition to your search results.
373
374 <dl>
375 <dt>etag</dt><dd>An opaque token that reflects the current version of the index. This value is also returned in an ETag header to facilitate HTTP caching.</dd>
376 <dt>fetch_duration</dt><dd>The number of milliseconds spent retrieving the documents.</dd>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
377 <dt>limit</dt><dd>The maximum number of results that can appear.</dd>
378 <dt>q</dt><dd>The query that was executed.</dd>
24591d91 »
2009-04-26 docs
379 <dt>rows</dt><dd>The search results array, described below.</dd>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
380 <dt>search_duration</dt><dd>The number of milliseconds spent performing the search.</dd>
381 <dt>skip</dt><dd>The number of initial matches that was skipped.</dd>
382 <dt>total_rows</dt><dd>The total number of matches for this query.</dd>
0fcf5787 »
2009-04-26 update docs.
383 </dl>
384
24591d91 »
2009-04-26 docs
385 <h2>The search results array</h2>
386
387 The search results arrays consists of zero, one or more objects with the following fields;
0fcf5787 »
2009-04-26 update docs.
388
389 <dl>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
390 <dt>doc</dt><dd>The original document from couch, if requested with include_docs=true</dd>
391 <dt>fields</dt><dd>All the fields that were stored with this match</dd>
0fcf5787 »
2009-04-26 update docs.
392 <dt>id</dt><dd>The unique identifier for this match.</dd>
393 <dt>score</dt><dd>The normalized score (0.0-1.0, inclusive) for this match</dd>
394 </dl>
395
fd163159 »
2009-03-07 update README.md
396 Here's an example of a JSON response without sorting;
b2079657 »
2009-02-14 improve README readability.
397
118d28eb »
2009-02-17 JSON example output.
398 <pre>
399 {
c6356fd5 »
2009-04-26 update README.md and TODO to reflect progress.
400 "q": "+content:enron",
fd163159 »
2009-03-07 update README.md
401 "skip": 0,
402 "limit": 2,
403 "total_rows": 176852,
404 "search_duration": 518,
405 "fetch_duration": 4,
406 "rows": [
407 {
0fcf5787 »
2009-04-26 update docs.
408 "id": "hain-m-all_documents-257.",
fd163159 »
2009-03-07 update README.md
409 "score": 1.601625680923462
410 },
411 {
0fcf5787 »
2009-04-26 update docs.
412 "id": "hain-m-notes_inbox-257.",
fd163159 »
2009-03-07 update README.md
413 "score": 1.601625680923462
414 }
118d28eb »
2009-02-17 JSON example output.
415 ]
416 }
417 </pre>
418
fd163159 »
2009-03-07 update README.md
419 And the same with sorting;
420
118d28eb »
2009-02-17 JSON example output.
421 <pre>
422 {
0fcf5787 »
2009-04-26 update docs.
423 "q": "+content:enron",
fd163159 »
2009-03-07 update README.md
424 "skip": 0,
425 "limit": 3,
426 "total_rows": 176852,
427 "search_duration": 660,
428 "fetch_duration": 4,
429 "sort_order": [
430 {
431 "field": "source",
432 "reverse": false,
433 "type": "string"
434 },
435 {
436 "reverse": false,
437 "type": "doc"
438 }
118d28eb »
2009-02-17 JSON example output.
439 ],
fd163159 »
2009-03-07 update README.md
440 "rows": [
441 {
0fcf5787 »
2009-04-26 update docs.
442 "id": "shankman-j-inbox-105.",
fd163159 »
2009-03-07 update README.md
443 "score": 0.6131107211112976,
444 "sort_order": [
445 "enron",
446 6
447 ]
448 },
449 {
0fcf5787 »
2009-04-26 update docs.
450 "id": "shankman-j-inbox-8.",
fd163159 »
2009-03-07 update README.md
451 "score": 0.7492915391921997,
452 "sort_order": [
453 "enron",
454 7
455 ]
456 },
457 {
0fcf5787 »
2009-04-26 update docs.
458 "id": "shankman-j-inbox-30.",
fd163159 »
2009-03-07 update README.md
459 "score": 0.507369875907898,
460 "sort_order": [
461 "enron",
462 8
463 ]
464 }
118d28eb »
2009-02-17 JSON example output.
465 ]
466 }
467 </pre>
468
a4aa4e14 »
2009-08-02 document Content-Type response negotiation
469 <h3>Content-Type of response</h3>
470
d2e1e9ea »
2009-08-31 add notes about typing.
471 The Content-Type of the response is negotiated via the Accept request header like CouchDB itself. If the Accept header includes "application/json" then that is also the Content-Type of the response. If not, "text/plain;charset=utf-8" is used.
a4aa4e14 »
2009-08-02 document Content-Type response negotiation
472
139a78cc »
2009-03-09 add info retrieval.
473 <h1>Fetching information about the index</h1>
474
7a12058b »
2009-04-26 docs
475 Calling couchdb-lucene without arguments returns a JSON object with information about the <i>whole</i> index.
139a78cc »
2009-03-09 add info retrieval.
476
477 <pre>
478 http://127.0.0.1:5984/enron/_fti
479 </pre>
480
481 returns;
482
483 <pre>
484 {"doc_count":517350,"doc_del_count":1,"disk_size":318543045}
485 </pre>
486
b2079657 »
2009-02-14 improve README readability.
487 <h1>Working With The Source</h1>
488
489 To develop "live", type "mvn dependency:unpack-dependencies" and change the external line to something like this;
490
491 <pre>
0cb9bb7f »
2009-08-17 add -server to configuration lines to avoid OOM.
492 fti=/usr/bin/java -server -cp /path/to/couchdb-lucene/target/classes:\
5d5eb29a »
2009-03-18 move to com.github.rnewson package.
493 /path/to/couchdb-lucene/target/dependency com.github.rnewson.couchdb.lucene.Main
b2079657 »
2009-02-14 improve README readability.
494 </pre>
495
496 You will need to restart CouchDB if you change couchdb-lucene source code but this is very fast.
497
498 <h1>Configuration</h1>
499
7dc5bac3 »
2009-09-02 reorg begins.
500 couchdb-lucene is configured from the couchdb ini files
b2079657 »
2009-02-14 improve README readability.
501
7dc5bac3 »
2009-09-02 reorg begins.
502 <pre>
503 [lucene]
504 ; Send lucene indexes elsewhere, defaults to hidden subdir under database_dir
505 ;lucene_dir=
b2079657 »
2009-02-14 improve README readability.
506
7dc5bac3 »
2009-09-02 reorg begins.
507 ; Send logs elsewhere, defaults to same dir as couchdb log file.
508 ;log_dir=
b2079657 »
2009-02-14 improve README readability.
509
7dc5bac3 »
2009-09-02 reorg begins.
510 ; alter (soft) maximum ram for indexing.
511 ;max_ram=16
512
513 ; Specify the default operator for boolean queries. If not specified, or if the setting is not recognized, the defaul is "OR". The other choice is "AND".
514 ; default_boolean_operator="OR"
b2079657 »
2009-02-14 improve README readability.
515 </pre>
b2d01ccc »
2009-03-16 update README for basic auth.
516
517 <h2>Basic Authentication</h2>
518
519 If you put couchdb behind an authenticating proxy you can still configure couchdb-lucene to pull from it by specifying additional system properties. Currently only Basic authentication is supported.
520
521 <dl>
f9c61e32 »
2009-03-22 format README
522 <dt>couchdb.password</dt><dd>the password to authenticate with.</dd>
f420bf7b »
2009-08-02 support different Analyzer's at index and query time.
523 <dt>couchdb.user</dt><dd>the user to authenticate as.</dd>
b2d01ccc »
2009-03-16 update README for basic auth.
524 </dl>
Something went wrong with that request. Please try again.