在 ASP.NET 电子商务站点中实现 Lucene 搜索的最佳实践
我的任务是在电子商务网站上设置搜索服务。 目前,它在 sql server 上使用全文索引,这并不理想,因为它很慢,而且不太灵活。
您建议我如何将其更改为 lucene? 我的意思是,我最初如何将所有数据加载到索引中,以及如何维护它? 在我的“插入产品”方法中,我是否也可以将其插入索引中?
任何信息都有很大帮助!
I've been tasked with seeting up a search service on an eCommerce site.
Currently, it uses full text indexing on sql server, which isn't ideal, as it's slow, and not all that flexible.
How would you suggest i approach changing this over to lucene?
By that, i mean, how would i initially load all the data into the indexes, and how would it be maintained? on my "insert product" methods, would i also have it insert it into the index?
any information is of great help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我目前正在使用 Solr,它构建在 Lucene 之上,作为我的一个电子商务项目的搜索引擎。 效果很好。
http://lucene.apache.org/solr/
另外还要保持产品同步在 DB 和 Solr 之间,您可以构建自己的“清理器”或在 Solr 中实现 DataImportHandler。
http://wiki.apache.org/solr/DataImportHandler
我们构建了自己的清理器,它读取以一定的时间间隔查看数据库并检查是否有新产品或任何产品数据已更新。 这是一种蛮力方法,我希望我之前就知道 DataImportHandler。
Facet 也是 Solr 的一个非常强大的部分。 我强烈推荐使用它们。
I'm currently using Solr, which is build on top of Lucene, as the search engine for one of my e-commerce projects. It works great.
http://lucene.apache.org/solr/
Also as far as keeping the products in sync between the DB and Solr, you can either build your own "sweeper" or implement the DataImportHandler in Solr.
http://wiki.apache.org/solr/DataImportHandler
We build our own sweeper that reads a DB view at some interval and checks to see if there are new products or any product data has been updated. It's a brute force method and I wish I knew about the DataImportHandler before.
Facets are also a really powerful part of Solr. I highly recommend using them.
如果您决定使用 Lucene.NET 进行搜索,您需要执行以下操作:
遍历你的所有记录
并写入你想要的数据
搜索到索引中,
这是一个很棒的平台。 我们最初尝试使用自由文本搜索,发现创建索引、更新和管理非常痛苦。 搜索并不比标准 SQL 搜索快多少。 它们确实在搜索查询中提供了一些灵活性...但即使如此,与 Lucene 的强大功能相比还是相形见绌!
If you do decide to use Lucene.NET for your search you need to do some of the following:
iterating through all your records
and writing the data that you want
searched into your index
This is a great platform. We initially tried to use the freetext search and found it to be a pain to create the indexes, update, and manage. The searches were not that much faster than a standard sql search. They did provide some flexibility in the search query...but even this pales in comparison to the power of Lucene!