While many relational databases provide some mechanism for full-text searches, these databases are optimized for Online Transaction Processing (OLTP) type workloads. Full-text search engines, on the other hand, are designed specifically for text queries, and excel at them. In this recipe, we'll show you how to use NHibernate search and Lucene.Net
to provide full-text search capabilities to your applications.
Complete the Eg.Core
model and mappings from Chapter 1, The Configuration and Schema.
Install the NHibernate Search package the to
Eg.Core
project using NuGet Package Manager Console by running the following command:Install-Package NHibernate.Search
In the
Entity
base class, decorate theId
property with the[DocumentId]
attribute fromNHibernate.Search.Attributes
.Add the following attributes to the
Product
class:[Indexed] public class Product : Entity { [Field] public virtual string Name { get; set; } [Field] public virtual...