Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search for Text in a BLOB

 
Rohit Kedia
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using a this Query to search a Text from a BLOB field. I am getting results for .doc ,.xls, .ppt, .txt files. But I am unable to find any help for searching in a .docx or any 2007 Office file formats and also for PDF files in a BLOB fields.

Please help me in this Issue.


 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The DB has no notion of searching inside of BLOBs in general, or of structured file formats specifically. You could extract the text from those documents and store it in an additional text field, which could then be searched by SQL. The Apache POI library can do this for Office file formats, and Apache PDFBox for PDFs.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rohit,
A BLOB doesn't store text. It stores binary data.

As Lester noted, the database has no way of knowing what is in your BLOB. It could be a Word document or it could be a bunch of random bytes.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4028
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some databases (Oracle for example) allow BLOB-like data types like CLOB/XML that do allow searching.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic