Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# tuantmyb 10/30/2010 3:16 AM
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?
# goolz 10/30/2010 1:15 PM
check StaticHtmlModule on Cuyahoga.Modules project :

OnContentUpdated(new IndexEventArgs(StaticHtmlContentToSearchContent(content)));
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);
			}
		}
# Constructor 10/30/2010 3:00 PM (edited 10/30/2010 8:34 PM)
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();