You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Mark Hanfland <ma...@yahoo.com.INVALID> on 2015/09/01 16:07:11 UTC

Re: Indexing a binary field

You are correct that Lucene only works with text (no binary or primitives), Base64 would be the way I would suggest. 


     On Monday, August 31, 2015 11:19 AM, Dan Smith <ds...@pivotal.io> wrote:
   

 What's the best way to index binary data in Lucene? I'm adding a Lucene
index to a key value store, and I want to be able to delete documents based
on a binary key.

As far as I can tell the Lucene API does not support indexing binary data,
and I was looking into Base64 encoding the key. Is there a better way?

-Dan


   

Re: Indexing a binary field

Posted by Michael McCandless <lu...@mikemccandless.com>.
Actually Lucene terms can be arbitrary/fully binary tokens in the
low-level postings APIs.

It's just that our analysis APIs are geared towards analyzing text,
but using StringField you can easily index an arbitrary single-token
byte[].

Mike McCandless

http://blog.mikemccandless.com


On Tue, Sep 1, 2015 at 10:07 AM, Mark Hanfland
<ma...@yahoo.com.invalid> wrote:
> You are correct that Lucene only works with text (no binary or primitives), Base64 would be the way I would suggest.
>
>
>      On Monday, August 31, 2015 11:19 AM, Dan Smith <ds...@pivotal.io> wrote:
>
>
>  What's the best way to index binary data in Lucene? I'm adding a Lucene
> index to a key value store, and I want to be able to delete documents based
> on a binary key.
>
> As far as I can tell the Lucene API does not support indexing binary data,
> and I was looking into Base64 encoding the key. Is there a better way?
>
> -Dan
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org