diff --git a/README.md b/README.md index 86b612a2..a8798061 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ The following indexing options can be defaulted; type the type of the field date, double, float, int, long, string, text - string + text store @@ -176,6 +176,10 @@ The following indexing options can be defaulted; +

String vs Text

+ +There are two supported types that sound equivalent, string and text, but they are very different. A text field will be tokenized into words and is usually what you expect from a full-text index. A string field is not tokenized, only exact matching will work. The advantage to string fields is that they have a meaningful sort order. +

The Analyzer Option

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; diff --git a/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/ViewSettings.java b/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/ViewSettings.java index e36ffdc7..3b134a6e 100644 --- a/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/ViewSettings.java +++ b/src/main/java/com/github/rnewson/couchdb/lucene/couchdb/ViewSettings.java @@ -24,7 +24,7 @@ public final class ViewSettings { public static ViewSettings getDefaultSettings() { - return new ViewSettings(Constants.DEFAULT_FIELD, "no", "string", "1.0", null); + return new ViewSettings(Constants.DEFAULT_FIELD, "no", "text", "1.0", null); } private final Store store;