Crudler
Crudler

Reputation: 2286

C# nhibernate global search

I have a system which will have about 6 different entities in the domain. This is a C# winforms app with using Nhibernate. MSSql server. +- 5-10 users.

One of the feature requests is to have a single search bar whereby the user can type and search all of these entities with "Google like" flexibility (i.e. unstructured). The best method i can think of implementing is to include a clob field on every domain object that also holds text of every field the object represents. my global search just does a like search on the clob field.

This just seems like 1. a mission to maintain (i.e. every object fields needs to be stored inside the clob field and updated with every change) 2. may scale terribly. as the system grows I am sure a LIKE search will get slower and slower causing system strain.

The system isnt going to be massive. I would be surprised if a single table stores more than 10,000 records but I dont like banking on that.

I have read about projects like Lucene.NET which work by indexing a dataset, but then the search will never be "live" but rather a search on the last index.

How have others managed to tackle this one?

Thanks!!

Upvotes: 1

Views: 336

Answers (1)

Jeroen
Jeroen

Reputation: 63699

You're looking for a full-text search solution. Like I mentioned in my comment, what seems to fit the bill for your situation is NHibernate Search, see also Ayende @ Rahien's post on the subject.

Upvotes: 2

Related Questions