简体   繁体   English

如何在Rails应用程序的附件中实现搜索文本数据

[英]How to implement the search text data in attached files in rails application

I have a requirement to search the text data in an attached file. 我需要搜索附件文件中的文本数据。 I am currently using carrierwave for attachment and ransack for searching. 我目前正在使用carrierwave做附件,并使用ransack进行搜索。

Is this feature available with what I am using? 我正在使用的功能可以使用此功能吗? Or is there another way to satisfy my requirement? 还是有其他方法可以满足我的要求?

If you're looking for a way to search data in attached files, such as pdfs, docs etc., I'd suggest using solr in conjunction with the sunspot and sunspot-cell gem. 如果您正在寻找一种搜索附件文件(例如pdf,docs等)中的数据的方法,建议您将solr与黑子和黑子细胞宝石配合使用。 More details on implementation in this blog post: 此博客文章中有关实现的更多详细信息:

http://www.chebyte.com/2011/08/13/how-to-index-file-contents-like-pdf-doc-etc-with-solr-sunspot-paperclip-s3-and-rails-3/ http://www.chebyte.com/2011/08/13/how-to-index-file-contents-like-pdf-doc-etc-with-solr-sunspot-paperclip-s3-and-rails-3/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM