I forget: To also index those fields, add it a second time with only index enabled and same name:
String value = "Some large text ...... "; byte[] valuesbyte = CompressionTools.compress(value.getBytes()); Field f = new Field(key, valuesbyte, Field.Store.YES); Document.add(field); // the stored one, so need for norms/TF suppress F = new Field(key, value, Field.Store.NO, Field.Index.ANALYZED); f.setOmitTermFreqAndPositions(true); f.setOmitNorms(true); document.add(f); ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Uwe Schindler [mailto:u...@thetaphi.de] > Sent: Monday, February 01, 2010 12:46 PM > To: java-user@lucene.apache.org > Subject: RE: Searching compressed text using CompressionTools > > Compression is only used for *stored* fields. For indexing there is no > compression available (how should that work). You must clearly > differentiate between stored and indexed fields! > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: u...@thetaphi.de > > > -----Original Message----- > > From: Suraj Parida [mailto:parida.su...@gmail.com] > > Sent: Monday, February 01, 2010 12:44 PM > > To: java-user@lucene.apache.org > > Subject: Searching compressed text using CompressionTools > > > > > > Hi, > > > > I want to compress a text field (due to its large size and spaces), > > during > > indexing. > > > > I am unable to get the same also want to search. > > > > > > My code during compressing is as follows: > > String value = "Some large text > ...... > > "; > > byte[] valuesbyte = > > CompressionTools.compress(value.getBytes()); > > final Field f = new Field(key, valuesbyte, > > Field.Store.YES); > > f.setOmitTermFreqAndPositions(true); > > f.setOmitNorms(true); > > document.add(f); > > > > Please tell me how to search and display this value. > > > > Regards > > Suraj > > -- > > View this message in context: http://old.nabble.com/Searching- > > compressed-text-using-CompressionTools-tp27402945p27402945.html > > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > > For additional commands, e-mail: java-user-h...@lucene.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org