简体   繁体   English

现有的Postgres数据库与Solr

[英]Existing Postgres Database vs Solr

We have an app that uses postgres database, that has about 50 tables. 我们有一个使用postgres数据库的应用程序,它有大约50个表。 Each table contains about 3 Million records (on average). 每个表包含大约300万条记录(平均而言)。 The tables get updated with new data every now and than. 表格现在每次都会更新新数据。 Now, we want to implement search feature in our app. 现在,我们想在我们的应用程序中实现搜索功能。 The search needs to be performed on one table at a time (no joins needed). 搜索需要一次在一个表上执行(不需要连接)。

I've read about postgres full text support and that looks promising. 我已经阅读了关于postgres全文支持的内容,看起来很有希望。 But it seems that Solr is Super fast in comparison to it. 但似乎Solr与之相比速度超快。 Can I use my existing postgres database with Solr? 我可以在Solr中使用现有的postgres数据库吗? If tables get updated would I need to re-index everything again? 如果表更新,我需要重新索引所有内容吗?

It is definitely worth giving Solr a try. 绝对值得Solr一试。 We moved many MySQL queries involving JOINs on multiple tables with sorting on different fields to Solr. 我们在多个表上移动了许多涉及JOIN的MySQL查询,并在不同的字段上对Solr进行了排序。 We are very happy with Solr's search speed, sort speed, faceting capabilities and highly configurable text analysis/tokenization options. 我们对Solr的搜索速度,排序速度,分面功能和高度可配置的文本分析/标记化选项非常满意。

If tables get updated would I need to re-index everything again?

No, you can run delta imports to only re-index your new and updated documents. 不,您可以运行增量导入,仅重新索引新的和更新的文档。 See https://wiki.apache.org/solr/DataImportHandler . 请参阅https://wiki.apache.org/solr/DataImportHandler

Get started with https://lucene.apache.org/solr/4_1_0/tutorial.html and all the links in there. 开始使用https://lucene.apache.org/solr/4_1_0/tutorial.html以及其中的所有链接。

Since nobody has leapt in, I'll answer. 由于没有人进入,我会回答。

I'm afraid it all depends. 我担心一切都取决于。 It depends on (at least) 这取决于(至少)

  • how big the text is in each "document" 每个“文档”中的文本有多大
  • how flexible you want your searching to be 您希望自己的搜索有多灵活
  • how much integration you need between database and text-search 数据库和文本搜索之间需要多少集成
  • how fast is fast enough 速度有多快
  • how much experience you have with both 你有多少经验

When I've had a database that needs some text searching, I've just used PG's built-in options. 当我有一个需要文本搜索的数据库时,我刚刚使用了PG的内置选项。 If I didn't have superuser access to the db, or was already running a big Java setup then Solr might well have appealed. 如果我没有超级用户访问数据库,或者已经运行了大型Java设置,那么Solr可能会提出上诉。

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

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