|
Rank: Member Groups: Member
Joined: 3/6/2007 Posts: 24 Points: 69
|
I have 2 table: table A(Book): int id, string title, string author table B(BookDetail): int id, int bookid, string content
I don't know how to implement Search Module to search title or content in my module. Can you help me?
|
|
Rank: Advanced Member Groups: Member
Joined: 6/18/2007 Posts: 39 Points: 117
|
check StaticHtmlModule on Cuyahoga.Modules project : OnContentUpdated(new IndexEventArgs(StaticHtmlContentToSearchContent(content))); Code: public event Cuyahoga.Core.Search.IndexEventHandler ContentCreated;
protected void OnContentCreated(IndexEventArgs e) { if (ContentCreated != null) { ContentCreated(this, e); } }
public event Cuyahoga.Core.Search.IndexEventHandler ContentDeleted;
protected void OnContentDeleted(IndexEventArgs e) { if (ContentDeleted != null) { ContentDeleted(this, e); } }
public event Cuyahoga.Core.Search.IndexEventHandler ContentUpdated;
protected void OnContentUpdated(IndexEventArgs e) { if (ContentUpdated != null) { ContentUpdated(this, e); } }
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
If you use the ContentItem as the base for your content and implement the ISearchableContent interface the SearchDecorator will index your content on save and update. This is simple as there are only 2 members.
Look at the Article.cs file (public class Article : ContentItem, ISearchableContent).
string ToSearchContent(ITextExtractor textExtractor); IList [[CustomSearchField]] GetCustomSearchFields();
|
|
Guest |