Binary fields in index

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Binary fields in index

Fredrik Andersson-2-2
Hello Gang!

Is there any trick, or undocumented way, to store binary (unindexed,
untokenized) data in a Lucene Field? All the Field constructors just deal
with Strings. I'm currently using another database to store binary data, but
it would be very neat, and more efficient, to store it directly in Lucene.

Thanks in advance,
Fredrik
Reply | Threaded
Open this post in threaded view
|

RE: Binary fields in index

Koji Sekiguchi-4
You can encode (e.g. base64) the binary data to get a String
and store the String.

Koji

> -----Original Message-----
> From: Fredrik Andersson [mailto:[hidden email]]
> Sent: Monday, September 26, 2005 6:31 PM
> To: [hidden email]
> Subject: Binary fields in index
>
>
> Hello Gang!
>
> Is there any trick, or undocumented way, to store binary (unindexed,
> untokenized) data in a Lucene Field? All the Field
> constructors just deal
> with Strings. I'm currently using another database to store
> binary data, but
> it would be very neat, and more efficient, to store it
> directly in Lucene.
>
> Thanks in advance,
> Fredrik
>


Reply | Threaded
Open this post in threaded view
|

Re: Binary fields in index

Fredrik Andersson-2-2
I was hoping to avoid the overhead of encoding/decoding, but it looks like
I'll have to do that :(

While on the topic, I noticed in the Field class that we have a "isBinary"
boolean flag, however this always gets set to false in the constructors as
well as the default value, and I can't even see a usage of this flag at
write-time. What's the point of this flag, a feature for binary fields that
was never implemented? I'm talking about the latest sources now, by the way,
1.9.something.

Fredrik

On 9/26/05, Koji Sekiguchi <[hidden email]> wrote:

>
> You can encode (e.g. base64) the binary data to get a String
> and store the String.
>
> Koji
>
> > -----Original Message-----
> > From: Fredrik Andersson [mailto:[hidden email]]
> > Sent: Monday, September 26, 2005 6:31 PM
> > To: [hidden email]
> > Subject: Binary fields in index
> >
> >
> > Hello Gang!
> >
> > Is there any trick, or undocumented way, to store binary (unindexed,
> > untokenized) data in a Lucene Field? All the Field
> > constructors just deal
> > with Strings. I'm currently using another database to store
> > binary data, but
> > it would be very neat, and more efficient, to store it
> > directly in Lucene.
> >
> > Thanks in advance,
> > Fredrik
> >
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Binary fields in index

Yonik Seeley
Binary fields can be stored, but not indexed.

-Yonik
Now hiring -- http://tinyurl.com/7m67g

On 9/26/05, Fredrik Andersson <[hidden email]> wrote:

>
> I was hoping to avoid the overhead of encoding/decoding, but it looks like
> I'll have to do that :(
>
> While on the topic, I noticed in the Field class that we have a "isBinary"
> boolean flag, however this always gets set to false in the constructors as
> well as the default value, and I can't even see a usage of this flag at
> write-time. What's the point of this flag, a feature for binary fields
> that
> was never implemented? I'm talking about the latest sources now, by the
> way,
> 1.9.something.
>
> Fredrik
>
> On 9/26/05, Koji Sekiguchi <[hidden email]> wrote:
> >
> > You can encode (e.g. base64) the binary data to get a String
> > and store the String.
> >
> > Koji
> >
> > > -----Original Message-----
> > > From: Fredrik Andersson [mailto:[hidden email]]
> > > Sent: Monday, September 26, 2005 6:31 PM
> > > To: [hidden email]
> > > Subject: Binary fields in index
> > >
> > >
> > > Hello Gang!
> > >
> > > Is there any trick, or undocumented way, to store binary (unindexed,
> > > untokenized) data in a Lucene Field? All the Field
> > > constructors just deal
> > > with Strings. I'm currently using another database to store
> > > binary data, but
> > > it would be very neat, and more efficient, to store it
> > > directly in Lucene.
> > >
> > > Thanks in advance,
> > > Fredrik
> > >
> >
> >
> >
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Binary fields in index

Koji Sekiguchi-4
In reply to this post by Fredrik Andersson-2-2
Please see the following version of the constructor:

  public Field(String name, byte[] value, Store store) ;

isBinary flag is set to true.

Thank you,

Koji


> -----Original Message-----
> From: Fredrik Andersson [mailto:[hidden email]]
> Sent: Monday, September 26, 2005 8:38 PM
> To: Koji Sekiguchi
> Cc: [hidden email]
> Subject: Re: Binary fields in index
>
>
> I was hoping to avoid the overhead of encoding/decoding, but
> it looks like
> I'll have to do that :(
>
> While on the topic, I noticed in the Field class that we have
> a "isBinary"
> boolean flag, however this always gets set to false in the
> constructors as
> well as the default value, and I can't even see a usage of
> this flag at
> write-time. What's the point of this flag, a feature for
> binary fields that
> was never implemented? I'm talking about the latest sources
> now, by the way,
> 1.9.something.
>
> Fredrik
>
> On 9/26/05, Koji Sekiguchi <[hidden email]> wrote:
> >
> > You can encode (e.g. base64) the binary data to get a String
> > and store the String.
> >
> > Koji
> >
> > > -----Original Message-----
> > > From: Fredrik Andersson [mailto:[hidden email]]
> > > Sent: Monday, September 26, 2005 6:31 PM
> > > To: [hidden email]
> > > Subject: Binary fields in index
> > >
> > >
> > > Hello Gang!
> > >
> > > Is there any trick, or undocumented way, to store binary
> (unindexed,
> > > untokenized) data in a Lucene Field? All the Field
> > > constructors just deal
> > > with Strings. I'm currently using another database to store
> > > binary data, but
> > > it would be very neat, and more efficient, to store it
> > > directly in Lucene.
> > >
> > > Thanks in advance,
> > > Fredrik
> > >
> >
> >
> >
>


Reply | Threaded
Open this post in threaded view
|

RE: Binary fields in index

pgwillia
In reply to this post by Koji Sekiguchi-4
Which library can Base64 be found in?

Thanks,
Tricia

On Mon, 26 Sep 2005, Koji Sekiguchi wrote:

> You can encode (e.g. base64) the binary data to get a String
> and store the String.
>
> Koji
>
> > -----Original Message-----
> > From: Fredrik Andersson [mailto:[hidden email]]
> > Sent: Monday, September 26, 2005 6:31 PM
> > To: [hidden email]
> > Subject: Binary fields in index
> >
> >
> > Hello Gang!
> >
> > Is there any trick, or undocumented way, to store binary (unindexed,
> > untokenized) data in a Lucene Field? All the Field
> > constructors just deal
> > with Strings. I'm currently using another database to store
> > binary data, but
> > it would be very neat, and more efficient, to store it
> > directly in Lucene.
> >
> > Thanks in advance,
> > Fredrik
> >
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Binary fields in index

Otis Gospodnetic-2
One of the Jakarta Commons ones - jakarta.apache.org/commons/codec/

Otis

--- Tricia Williams <[hidden email]> wrote:

> Which library can Base64 be found in?
>
> Thanks,
> Tricia
>
> On Mon, 26 Sep 2005, Koji Sekiguchi wrote:
>
> > You can encode (e.g. base64) the binary data to get a String
> > and store the String.
> >
> > Koji
> >
> > > -----Original Message-----
> > > From: Fredrik Andersson [mailto:[hidden email]]
> > > Sent: Monday, September 26, 2005 6:31 PM
> > > To: [hidden email]
> > > Subject: Binary fields in index
> > >
> > >
> > > Hello Gang!
> > >
> > > Is there any trick, or undocumented way, to store binary
> (unindexed,
> > > untokenized) data in a Lucene Field? All the Field
> > > constructors just deal
> > > with Strings. I'm currently using another database to store
> > > binary data, but
> > > it would be very neat, and more efficient, to store it
> > > directly in Lucene.
> > >
> > > Thanks in advance,
> > > Fredrik
> > >
> >
> >
>