Skip to content

Instantly share code, notes, and snippets.

@elben
Created November 9, 2011 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elben/1352769 to your computer and use it in GitHub Desktop.
Save elben/1352769 to your computer and use it in GitHub Desktop.
diff --git a/src/lucandra/IndexReader.java b/src/lucandra/IndexReader.java
index e88e789..5596b87 100644
--- a/src/lucandra/IndexReader.java
+++ b/src/lucandra/IndexReader.java
@@ -34,6 +34,7 @@ import com.google.common.collect.MapMaker;
import org.apache.cassandra.db.*;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
import org.apache.log4j.Logger;
import org.apache.lucene.analysis.SimpleAnalyzer;
import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
@@ -344,7 +345,7 @@ public class IndexReader extends org.apache.lucene.index.IndexReader
else if(term.isSetIs_binary())
{
if(term.is_binary)
- f = new Field(term.getField(), term.getText());
+ f = new Field(term.getField(), FBUtilities.bytesToHex(term.getText()), Store.YES, Index.NOT_ANALYZED);
else
f = new Field(term.getField(), new String(term.getText(),"UTF-8"), Store.YES, Index.ANALYZED);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment