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 blazingwolf7 <bl...@gmail.com> on 2009/12/03 03:32:27 UTC

Storing image with Lucene

Hi,

As per title...is it possible to store image using Lucene? And if its
possible...how can I do that?

Thanks
-- 
View this message in context: http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26620107.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Storing image with Lucene

Posted by blazingwolf7 <bl...@gmail.com>.
Thanks for the reply...yes i am trying to create an Image Search. And I did
create something similar to your
suggestion on only storing the links. But due to some limitations being set
on me...I have to find a way to 
store the image..

Maybe I could try the transform idea. 

Anshum-2 wrote:
> 
> Hi,
> Lucene supports string/int literals for indexing and searching. In other
> words, anything that can be transformed into a string/int can be consumed
> by
> the lucene api. Moreover, so are you trying to implement an image search?
> In
> that case perhaps you'd have to either figure out a transform else try
> something else.
> If it is mere storage of an image in lucene (for a particular doc, to be
> fetched) you may as well do what is done by other similar engines behind
> the
> scenes e.g. for blob objects. Just store a path/link to the actual image
> instead of image in the index and fetch it at runtime (in the wrapper
> code).
> 
> --
> Anshum Gupta
> Naukri Labs!
> http://ai-cafe.blogspot.com
> 
> The facts expressed here belong to everybody, the opinions to me. The
> distinction is yours to draw............
> 
> 
> On Thu, Dec 3, 2009 at 8:02 AM, blazingwolf7 <bl...@gmail.com>
> wrote:
> 
>>
>> Hi,
>>
>> As per title...is it possible to store image using Lucene? And if its
>> possible...how can I do that?
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26620107.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26620344.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Storing image with Lucene

Posted by Anshum <an...@gmail.com>.
Hi,
Lucene supports string/int literals for indexing and searching. In other
words, anything that can be transformed into a string/int can be consumed by
the lucene api. Moreover, so are you trying to implement an image search? In
that case perhaps you'd have to either figure out a transform else try
something else.
If it is mere storage of an image in lucene (for a particular doc, to be
fetched) you may as well do what is done by other similar engines behind the
scenes e.g. for blob objects. Just store a path/link to the actual image
instead of image in the index and fetch it at runtime (in the wrapper code).

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Thu, Dec 3, 2009 at 8:02 AM, blazingwolf7 <bl...@gmail.com> wrote:

>
> Hi,
>
> As per title...is it possible to store image using Lucene? And if its
> possible...how can I do that?
>
> Thanks
> --
> View this message in context:
> http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26620107.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

RE: Storing image with Lucene

Posted by "Rao, Vaijanath" <va...@corp.aol.com>.
Hi,

Yes you can, create a binary field which you can use to store the image
in.
Field(String name, Reader reader)  Use this to store your image and use
binaryValue() to get the image back.

You can also look at storing the features of the image into the index in
similar way.

--Thanks and Regards
Vaijanath N. Rao

-----Original Message-----
From: blazingwolf7 [mailto:blazingwolf7@gmail.com] 
Sent: Thursday, December 03, 2009 8:02 AM
To: java-user@lucene.apache.org
Subject: Storing image with Lucene


Hi,

As per title...is it possible to store image using Lucene? And if its
possible...how can I do that?

Thanks
--
View this message in context:
http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26620107.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


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


Re: Storing image with Lucene

Posted by blazingwolf7 <bl...@gmail.com>.
I found a solution already.

That is to convert the image from byte array of the image >> string
Then the string will be stored in the index. But beware, the byte will have
to be encoded to Base64
or the image retrieved will be mess up(meaning the pic is totally ruin)



blazingwolf7 wrote:
> 
> oh...thanks for the suggestion. I will try using the idea.If it works I
> will let u all know..
> 
> 
> Anshum-2 wrote:
>> 
>> Hi Vaijanath,
>> Just wanted to know if you can perform a search on the binary field (as I
>> haven't tried this ever) ?
>> ------Original Message------
>> From: Rao, Vaijanath
>> To: java-user@lucene.apache.org
>> ReplyTo: java-user@lucene.apache.org
>> Subject: RE: Storing image with Lucene
>> Sent: Dec 3, 2009 08:27
>> 
>> Hi,
>> 
>> Yes you can, create a binary field which you can use to store the image
>> in.
>> Field(String name, Reader reader)  Use this to store your image and use
>> binaryValue() to get the image back.
>> 
>> You can also look at storing the features of the image into the index in
>> similar way.
>> 
>> --Thanks and Regards
>> Vaijanath N. Rao
>> 
>> -----Original Message-----
>> From: blazingwolf7 [mailto:blazingwolf7@gmail.com] 
>> Sent: Thursday, December 03, 2009 8:02 AM
>> To: java-user@lucene.apache.org
>> Subject: Storing image with Lucene
>> 
>> 
>> Hi,
>> 
>> As per title...is it possible to store image using Lucene? And if its
>> possible...how can I do that?
>> 
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26620107.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>> 
>> 
>> 
>> Sent from BlackBerry® on Airtel
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26621710.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Storing image with Lucene

Posted by blazingwolf7 <bl...@gmail.com>.
oh...thanks for the suggestion. I will try using the idea.If it works I will
let u all know..


Anshum-2 wrote:
> 
> Hi Vaijanath,
> Just wanted to know if you can perform a search on the binary field (as I
> haven't tried this ever) ?
> ------Original Message------
> From: Rao, Vaijanath
> To: java-user@lucene.apache.org
> ReplyTo: java-user@lucene.apache.org
> Subject: RE: Storing image with Lucene
> Sent: Dec 3, 2009 08:27
> 
> Hi,
> 
> Yes you can, create a binary field which you can use to store the image
> in.
> Field(String name, Reader reader)  Use this to store your image and use
> binaryValue() to get the image back.
> 
> You can also look at storing the features of the image into the index in
> similar way.
> 
> --Thanks and Regards
> Vaijanath N. Rao
> 
> -----Original Message-----
> From: blazingwolf7 [mailto:blazingwolf7@gmail.com] 
> Sent: Thursday, December 03, 2009 8:02 AM
> To: java-user@lucene.apache.org
> Subject: Storing image with Lucene
> 
> 
> Hi,
> 
> As per title...is it possible to store image using Lucene? And if its
> possible...how can I do that?
> 
> Thanks
> --
> View this message in context:
> http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26620107.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 
> Sent from BlackBerry® on Airtel
> 

-- 
View this message in context: http://old.nabble.com/Storing-image-with-Lucene-tp26620107p26621546.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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