简体   繁体   English

用asp.net编写的具有多面搜索功能的网站

[英]website written in asp.net with faceted search

I'm writing a website (using Entity Framework, MySQL, .net 4, C#) which have a lot of categories with subcategories down to 3 levels deep once the user find what he was looking for, each "product" can have different attributes for example: 我正在写一个网站(使用Entity Framework,MySQL,.net 4,C#),其中包含很多类别,一旦用户找到了所要查找的内容,子类别就可以深入到3级,每个“产品”可以具有不同的属性例如:

"Restaurants" can have: average dish price, kids menu available and "Gym" can have: swimming pool available, personal trainer available “餐厅”可以具有:平均菜价,可以提供儿童菜单,“健身房”可以具有:提供游泳池,可以使用私人教练

I'm new to C# and cant figure out how to implement at least simliar to faceted search solution without using library Lucene.NET and search engine Solr, especially that I'll be using probably shared hosting environment. 我是C#的新手,无法弄清楚如何在不使用库Lucene.NET和搜索引擎Solr的情况下至少实现与面类似的搜索解决方案,尤其是我将使用共享宿主环境。

Wonder if anyone tried to implement similar functionality without using those technologies and have some ideas about db structure and code samples... 想知道是否有人试图在不使用那些技术的情况下实现类似功能并且对数据库结构和代码示例有一些想法...

Also should I have to use Lucene and Solr does anyone know some cheap VPS hosting which allow installation and usage of Solr, and also might throw some tutorial how to create such faceted search as I couldn't found any. 另外,我是否必须使用Lucene,Solr会不会有人知道一些便宜的VPS主机,允许安装和使用Solr,并且还可能会提供一些教程,介绍如何创建找不到的多面搜索。

Thanks 谢谢

As explained in this question , relational databases cannot implement faceting efficiently. 本问题所述 ,关系数据库无法有效实现构面。 Lucene.NET runs in-process so it shouldn't be a problem for a shared hosting environment. Lucene.NET在进程内运行,因此对于共享主机环境来说应该不是问题。 Or you could look into some hosted search solutions . 或者,您可以研究一些托管搜索解决方案

Subcategories can be implemented to any depth efficiently. 子类别可以有效地实现到任何深度。 Implementing a faceted search for Books , Books>Non-Fiction and Books>Non-Fiction>Diet is straightforward: see my question on hierarchical faceting: Ways to do hierarchial faceting in Solr? 对“ Books ,“ Books>Non-Fiction和“ Books>Non-Fiction>Diet实施多面搜索非常简单:请参见我关于层次刻面的问题: 在Solr中进行层次刻面的方法? .


Dynamic fields are your friend for adding attributes to your entities. 动态字段是您为实体添加属性的朋友。 Modify schema.xml 修改schema.xml

<dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
<dynamicField name="*_s"  type="string"  indexed="true"  stored="true"/>
<dynamicField name="*_t"  type="text"    indexed="true"  stored="true"/>
//you may need a multi-valued string type if you want faceting

So you can simply add a document: 因此,您只需添加一个文档即可:

restaurant_average_dish_price_i: 123
restaurant_kids_menu_available_s:"yes"

The first field will be an int , ready for comparison operations, the second becomes a string, ready for faceting. 第一个字段为int ,准备进行比较操作,第二个字段为一个字符串,准备进行分面。

http://www.tnrglobal.com/blog/2010/07/dynamic-fields-in-apache-solr/ http://www.tnrglobal.com/blog/2010/07/dynamic-fields-in-apache-solr/

http://wiki.apache.org/solr/SchemaXml#Dynamic_fields http://wiki.apache.org/solr/SchemaXml#Dynamic_fields


As for deployment options, please follow Mauricio Scheffer's answer. 至于部署选项,请遵循Mauricio Scheffer的回答。

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

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