• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Searching a document contents stored in database

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a requirement where user will be uploading excel document from UI, I am planning to store that document in database as BLOB.

Now if user wants to perform search from UI based on contents of the documents, respective documents will be displayed as a search result.


I would appreciate any help in this matter as it's driving me crazy to implement the solution.

Regards
Shailendra
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Storing the document as a BLOB will be good if you need to extract the document, but it will be stored in its binary form. That means you can't search on it.

You should probably use Apache POI, JExcelAPI (a.k.a. jxl) or another library to read the document, then store its readable content in another field (type CLOB probably - a form of text-based BLOB; "text" is another often used name for it) on which you will then search.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alternatively, use a library like Lucene to build a search index whenever a document is stored in the DB. The Apache Tika library -a Lucene add-on- can index Excel files (amongst other formats).
 
shailendra Patil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rob & Ulf for your quick reply.


let me try the solution suggested by your guys with Sample program & I'll let you know the result soon.

Hopefully by implementing CLOB datatype it will solve my purpose.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also depending on size files you are storing, it is not advisable to store large files in the base for performance reasons.
Instead saving the files on the hard disk and storing the path of the saved file in the database could be another solution.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic