0
votes

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:

"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.

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.

Thanks

2
@Xodarap : no, the OP doesn't want to use Solr or LuceneMauricio Scheffer

2 Answers

1
votes

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. Or you could look into some hosted search solutions.

0
votes

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?.


Dynamic fields are your friend for adding attributes to your entities. Modify 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.

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

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


As for deployment options, please follow Mauricio Scheffer's answer.