Is it possible to make search engine with Lucene only using database column of which datatype is BLOB(byte array)?

huangapple go评论77阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年8月10日 11:53:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/63333920.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定