Skip to content
Browse files

update docs.

  • Loading branch information...
1 parent f463634 commit d90560d84efd650f49ea0f3a06f53f75682be6f7 Robert Newson committed Oct 9, 2009
View
2 README.md
@@ -9,7 +9,7 @@ This branch (master) contains the development version of the next release (0.5).
<table>
<tr><th>CouchDB</th><th>couchdb-lucene</th></tr>
<tr><td>0.9.1, 0.10</td><td>0.4</td></tr>
-<tr><td>0.11 (not yet released)<td><td>0.4-maint (0.4 with patch for trunk compatibility)</td></tr>
+<tr><td>0.11 (not yet released)</td><td>0.4-maint (0.4 with patch for trunk compatibility)</td></tr>
<tr><td>0.9.1, 0.10, 0.11 (not yet released)</td><td>0.5 (not yet released)</td></tr>
</table>
View
2 src/main/java/com/github/rnewson/couchdb/lucene/Constants.java
@@ -12,6 +12,4 @@
static final String DEFAULT_FIELD = "default";
- static final int SEQ_PRECISION = 10;
-
}
View
13 src/main/java/com/github/rnewson/couchdb/lucene/RhinoDocument.java
@@ -161,17 +161,16 @@ private void addField(final RhinoField field, final RhinoContext context, final
final Field.Store storeObj = Store.get(store);
if ("int".equals(type)) {
- out.add(new NumericField(fieldName, storeObj, true).setIntValue(Conversion.convert(field.value, Integer.class)));
+ out.add(new NumericField(fieldName, 4, storeObj, true).setIntValue(Conversion.convert(field.value, Integer.class)));
} else if ("float".equals(type)) {
- out.add(new NumericField(fieldName, storeObj, true).setFloatValue(Conversion.convert(field.value, Float.class)));
+ out.add(new NumericField(fieldName, 4, storeObj, true).setFloatValue(Conversion.convert(field.value, Float.class)));
} else if ("double".equals(type)) {
- out.add(new NumericField(fieldName, storeObj, true).setDoubleValue(Conversion.convert(field.value, Double.class)));
+ out.add(new NumericField(fieldName, 8, storeObj, true).setDoubleValue(Conversion.convert(field.value, Double.class)));
} else if ("long".equals(type)) {
- out.add(new NumericField(fieldName, storeObj, true).setLongValue(Conversion.convert(field.value, Long.class)));
+ out.add(new NumericField(fieldName, 8, storeObj, true).setLongValue(Conversion.convert(field.value, Long.class)));
} else if ("date".equals(type)) {
- out
- .add(new NumericField(fieldName, storeObj, true).setLongValue(Conversion.convert(field.value, Date.class)
- .getTime()));
+ final Date date = Conversion.convert(field.value, Date.class);
+ out.add(new NumericField(fieldName, 8, storeObj, true).setLongValue(date.getTime()));
} else if ("string".equals(type)) {
out.add(new Field(fieldName, Conversion.convert(field.value).toString(), storeObj, Index.get(index)));
}
View
7 src/main/java/com/github/rnewson/couchdb/lucene/SearchServlet.java
@@ -37,6 +37,7 @@
import org.apache.lucene.search.TermRangeQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.TopFieldDocs;
+import org.apache.lucene.search.WildcardQuery;
import com.github.rnewson.couchdb.lucene.LuceneGateway.SearcherCallback;
import com.github.rnewson.couchdb.lucene.util.Analyzers;
@@ -348,10 +349,16 @@ private void toPlan(final StringBuilder builder, final Query query) {
planTermRangeQuery(builder, (TermRangeQuery) query);
} else if (query instanceof PrefixQuery) {
planPrefixQuery(builder, (PrefixQuery) query);
+ } else if (query instanceof WildcardQuery) {
+ planWildcardQuery(builder, (WildcardQuery) query);
}
builder.append(",boost=" + query.getBoost() + ")");
}
+ private void planWildcardQuery(final StringBuilder builder, final WildcardQuery query) {
+ builder.append(query.getTerm());
+ }
+
private void planPrefixQuery(final StringBuilder builder, final PrefixQuery query) {
builder.append(query.getPrefix());
}
View
8 src/main/java/com/github/rnewson/couchdb/lucene/ViewSignature.java
@@ -16,6 +16,12 @@
*/
public final class ViewSignature {
+ /**
+ * Increment this to invalidate all existing indexes and force a rebuild.
+ * Only do this if the indexing strategy changes in an incompatible fashion!
+ */
+ private static final byte VERSION = 0;
+
private final String dbname;
private final String view;
@@ -31,7 +37,7 @@ public ViewSignature(final String dbname, final String viewFunction) {
try {
final MessageDigest md = MessageDigest.getInstance("MD5");
md.update(dbname.getBytes("UTF-8"));
- md.update((byte) 0);
+ md.update(VERSION);
md.update(viewFunction.replaceAll("\\s+", "").getBytes("UTF-8"));
final byte[] digest = md.digest();
this.dbname = dbname;

0 comments on commit d90560d

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