Permalink
Browse files

use 'default' consistently.

  • Loading branch information...
1 parent 690dbc5 commit 86569b1a89c09eb87b61657c80e32b534489ecbc Robert Newson committed Jan 8, 2010
Showing with 4 additions and 4 deletions.
  1. +2 −2 README.md
  2. +2 −2 src/main/java/com/github/rnewson/couchdb/lucene/util/Analyzers.java
View
@@ -172,10 +172,10 @@ The "perfield" option lets you use a different analyzer for different fields and
perfield:{field_name:"analyzer_name"}
</pre>
-Unless overridden, any field name not specified will be handled by the standard analyzer. To change the default, use the special _default field name;
+Unless overridden, any field name not specified will be handled by the standard analyzer. To change the default, use the special default field name;
<pre>
-perfield:{_default:"keyword"}
+perfield:{default:"keyword"}
</pre>
<h3>The Document class</h3>
@@ -83,11 +83,11 @@ public Analyzer newAnalyzer(final String args) {
@Override
public Analyzer newAnalyzer(final String args) {
final JSONObject json = JSONObject.fromObject(args == null ? "{}" : args);
- final Analyzer defaultAnalyzer = Analyzers.getAnalyzer(json.optString("_default", "standard"));
+ final Analyzer defaultAnalyzer = Analyzers.getAnalyzer(json.optString(Constants.DEFAULT_FIELD, "standard"));
final PerFieldAnalyzerWrapper result = new PerFieldAnalyzerWrapper(defaultAnalyzer);
for (final Object obj : json.keySet()) {
final String key = obj.toString();
- if ("_default".equals(key))
+ if (Constants.DEFAULT_FIELD.equals(key))
continue;
result.addAnalyzer(key, Analyzers.getAnalyzer(json.getString(key)));
}

0 comments on commit 86569b1

Please sign in to comment.