Skip to content
Browse files

Update documentation to reflect new highlighter features and result s…

…et changes
  • Loading branch information...
1 parent 664709b commit 8194a9a43ce98f9b679d6350cdb5ece3dac0210c @nesteffe committed Apr 25, 2012
Showing with 7 additions and 2 deletions.
  1. +4 −0 README.md
  2. +1 −0 THANKS.md
  3. +2 −2 src/main/java/com/github/rnewson/couchdb/lucene/DatabaseIndexer.java
View
4 README.md
@@ -423,6 +423,10 @@ The following parameters can be passed for more sophisticated searches;
<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>
<dt>include_docs</dt><dd>whether to include the source docs</dd>
<dt>include_fields</dt><dd>By default, <i>all</i> stored fields are returned with results. Use a comma-separate list of field names with this parameter to refine the response</dd>
+<dt>include_storedfields</dt><dd>Return stored fields with the results. Default is <i>false</i>. Please note that the addition of this parameter constitutes a change in the default behavior. Previously stored fields were always returned when they exist. To emulate this behavior you must set this option to true.</dd>
+<dt>include_termvectors</dt><dd>Return term vectors with the results. Default is <i>false</i>.</dd>
+<dt>highlights</dt><dd>Number of highlights to include with results. Default is <i>0</i>. This uses the <i>fast-vector-highlighter</i> plugin.</dd>
+<dt>highlight_length</dt><dd>Number of characters to include in a highlight row. Default and minimum is <i>18</i>.</dd>
<dt>limit</dt><dd>the maximum number of results to return</dd>
<dt>q</dt><dd>the query to run (e.g, subject:hello). If not specified, the default field is searched. Multiple queries can be supplied, separated by commas; the resulting JSON will be an array of responses.</dd>
<dt>skip</dt><dd>the number of results to skip</dd>
View
1 THANKS.md
@@ -2,3 +2,4 @@
* Thanks to Adam Lofts for the performance boosting JSONDocumentAdapter et al.
* Thanks to Santiago M. Mola for the termvector option.
* Thanks to Joe Hillenbrand for adding default result limit to config.
+* Thanks to Nate Steffen for adding highlighting.
View
4 src/main/java/com/github/rnewson/couchdb/lucene/DatabaseIndexer.java
@@ -533,7 +533,7 @@ public void search(final HttpServletRequest req,
final int highlights = getIntParameter(req, "highlights", 0);
final int highlight_length = max(getIntParameter(req, "highlight_length", 18), 18); // min for fast term vector highlighter is 18
final boolean include_termvectors = getBooleanParameter(req, "include_termvectors");
- final boolean include_fields = getBooleanParameter(req, "include_fields");
+ final boolean include_storedfields = getBooleanParameter(req, "include_storedfields");
final int limit = getIntParameter(req, "limit",
ini.getInt("lucene.limit", 25));
final Sort sort = CustomQueryParser.toSort(req
@@ -619,7 +619,7 @@ public void search(final HttpServletRequest req,
if (include_docs) {
fetch_ids[i - skip] = doc.get("_id");
}
- if (include_fields && fields.length() > 0) {
+ if (include_storedfields && fields.length() > 0) {
row.put("fields", fields);
}
if (highlight_rows.length() > 0) {

0 comments on commit 8194a9a

Please sign in to comment.
Something went wrong with that request. Please try again.