“喜欢”的最佳部署是什么?在 MVC/Azure 中搜索
我在 Azure 上使用 MVC3,我喜欢进行“喜欢”类型的搜索, 例如 http://msdn.microsoft.com/en-us/library/ms179859。 aspx
第一个问题:Lucene是否支持“like”搜索,我尝试在Google上问这个问题,但是很难搜索“like”这个词而不得到如下结果:我喜欢使用 Lucene :)
第二:使用 SQL Azure 进行“类似”搜索可以获得什么样的性能,仅使用 id(int) 作为键,使用 text(string(100)) 进行搜索“喜欢”搜索,行数在 1000 万左右。我试过了,好像不行,总是超时。或者您可以这样回答这个问题:我知道有一种方法可以改进 SQL Azure 中的“like”搜索。
第三个问题:是否有任何其他与 Azure 平台配合良好的产品可以支持“like”搜索具有合理的性能(上述示例数据库不到 2 秒)
谢谢。
I use MVC3 on Azure, I like to have a "like" kind of search,
e.g. http://msdn.microsoft.com/en-us/library/ms179859.aspx
First question: Does Lucene support "like" search, I tried ask this question on Google, but it's very difficult to search the word "like" without get result like: I like to use Lucene :)
Second: What kind of performance can I get for use SQL Azure for "like" search, with only id(int) as key, and text(string(100)) for "like" search, and rows around 10 million. I tried seems cannot work out, always timeout. Or you can answer the question as: I know theres a way to improve "like" search in SQL Azure.
3rd question: Is there any other product thats works well with Azure Platform can support "like" search with reasonable performance(less than 2 seconds for above sample database)
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
SQL Azure 不支持全文索引,因此“LIKE”仅限于 ANSI SQL 运算符。这对于一般搜索来说是完全不够的。一般来说,在云 (Azure) 上,您无论如何都希望避免使用 SQL 进行搜索 - 从可扩展性的角度来看,这是错误的地方。
正如您所建议的,基于 lucene 的搜索引擎是最佳选择,但我建议使用 Solr(Apache/Java lucene 服务器)。 Solr 仍然可以托管在 Azure 中,您会发现更多社区支持、文档和帮助。
SQL Azure doesn't support full text indexing so 'LIKE' is limited to the ANSI SQL operator. This is wholly inadequate for general searching. In general, on the cloud (Azure) you want to avoid using SQL for searching anyway - is is the wrong place for it from a scalability point of view.
As you suggest, a lucene-based search engine is the way to go, but I would recommend using Solr (the Apache/Java lucene server). Solr can still be hosted in Azure and you will find a lot more community support, documentation and help for it.
Lucene 确实支持 LIKE 搜索,并且有一个特定于 Lucene.NET 的库,它利用 Azure 存储作为 Lucene 索引。这使您能够提供可在云中良好扩展的容错 Lucene 索引。
http://code.msdn.microsoft.com/windowsazure/Azure-Library -for-83562538
Solr 是一个不错的选择,但您必须自己管理索引的存储,除非您将 Solr 扩展为自己在 Azure 存储上运行。
Lucene does support LIKE search and there is a library specific for Lucene.NET that leverages Azure Storage for the Lucene index. This allows you to provide a fault tolerant Lucene index that will scale well in the cloud.
http://code.msdn.microsoft.com/windowsazure/Azure-Library-for-83562538
Solr is a good option, but you will have to manage the storage of the index yourself unless you extend Solr to run on Azure storage yourself.
您可能想考虑在 Azure 上实施 Solr。这里有一篇很好的演示和教程:
http://wiki.apache.org/solr/SolrOnWindowsAzure< /a>
You may want to look into implementing Solr on Azure. There's a good write up with demo's and tutorials here:
http://wiki.apache.org/solr/SolrOnWindowsAzure