Login

Username

Password





Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

How to Seach title, content in my module in Cuyahoga 2 Options
tuantmyb
Posted: Friday, October 29, 2010 6:16:39 PM
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?
goolz
Posted: Saturday, October 30, 2010 4:15:24 AM
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);
            }
        }
Constructor
Posted: Saturday, October 30, 2010 6:00:32 AM
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();
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.