230 likes | 339 Views
Matt Honeycutt @matthoneycutt Adding powerful search capabilities to your application with Lucene.NET and NHibernate Search. What should we do? . Our application. Something completely revolutionary!. Solution Overview. NHibernate Primer. Object-relational mapper
E N D
Matt Honeycutt @matthoneycutt Adding powerful search capabilities to your application with Lucene.NET and NHibernate Search
Our application Something completely revolutionary!
NHibernate Primer • Object-relational mapper • “Use it whenever you need to access a relational database” – Oren “Ayende” Eini
NHibernate Primer • Object-relational mapper • “Use it whenever you need to access a relational database” – Oren “Ayende” Eini <hibernate-mapping package="org.hibernate.tutorial.domain"> <class name="Event" table="EVENTS"> <id name="id" column="EVENT_ID"> <generator class="native"/> </id> <property name="date" type="timestamp" column="EVENT_DATE"/> <property name="title"/> </class> </hibernate-mapping> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" > </hibernate-configuration> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> <class name="Cat" table="Cat"> <id name="Id"> <generator class="identity" /> </id> <property name="Name"> <column name="Name" length="16" not-null="true" /> </property> <property name="Sex" /> <many-to-one name="Mate" /> <bag name="Kittens"> <key column="mother_id" /> <one-to-many class="Cat" /> </bag> </class> <property name="connection.connection_string">Server=(local);Initial Catalog=dbname;User Id=user;Password=********</property> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
NHibernate Primer • Object-relational mapper • “Use it whenever you need to access a relational database” – Oren “Ayende” Eini Just say NO to XML configuration!
What’s the problem? “As a user, I want to be able to find interesting blog posts by specifying one or more keywords I’m interested in. The blog should display a list of blog posts sorted by relevance.”
Lucene Overview ? Searching Indexing Query Parser Document Index Searcher Analyzer Index Reader Index Writer Directory (Index)
NHibernate.Search - Indexing SQL Database NHibernate Entity Add Update Delete Post-Insert Post-Update Post-Delete NHibernate.Search Lucene.NET Directory
NHibernate.Search - Querying IFullTextSession ISession ISession NHibernate Lucene.NET SQL Database Directory
For more information… • Custom Mapping for NHibernate.Search: http://tiny.cc/kmmkg • NHibernate.Search using Lucene.NET Full Text Index - http://tiny.cc/dvb4d • Hibernate Search In Action
Thanks! Follow me: Blog: http://trycatchfail.com Twitter: matthoneycutt