英文:
Is it possible to make search engine with Lucene only using database column of which datatype is BLOB(byte array)?
问题
Is it possible to develop searching function with Lucene without storing data as a file? 我的意思是,我想知道如何从RDB(PostgreSQL 12)获取字节数组(=文本文件,BLOB)数据,并使用Lucene创建搜索功能。索引文件可以存储为文件,但我希望有一些不这样做的方法。
英文:
Is it possible to develop searching function with Lucene without storing data as a file?
I mean, I want to know the way how to make getting data which is byte array(=text file, BLOB) from RDB(PostgreSQL 12) and make searching function with Lucene.
It is okay that index files stored as a file but I hope there are some ways to not that way.
答案1
得分: 1
你不需要实际文件才能使用Lucene索引数据。如果你将一个TextField添加到Lucene文档中,你可以使用带有Reader参数的构造函数,并通过它传递文本数据。
链接:https://lucene.apache.org/core/8_6_0/core/org/apache/lucene/document/TextField.html
英文:
You don't need to have actual files to be able to index data with Lucene. If you add a TextField to a Lucene document you can use the constructor that takes a Reader and pass the text data through it.
https://lucene.apache.org/core/8_6_0/core/org/apache/lucene/document/TextField.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论