Skip to content

Commit

Permalink
Update documentation to reflect new highlighter features and result s…
Browse files Browse the repository at this point in the history
…et changes
  • Loading branch information
nesteffe committed Apr 25, 2012
1 parent 664709b commit 8194a9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions THANKS.md
Expand Up @@ -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.
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8194a9a

Please sign in to comment.