How to make my new feature searchable using Lucene.Net

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
2/29/2012 1:36:47 AM
Gravatar
Total Posts 11

How to make my new feature searchable using Lucene.Net

Hai

I am using mojoportal internal search(lucene.net),When i am searching my newly added features also wants to be display.

For that i just click the Rebuildsearch index button.Before Clicking this button It display some search results from html.But After clicking this button that result also not displayed.It just shows Result Not Found.

 

What can i do for this??

How to use rebuild index button?

2/29/2012 6:20:47 AM
Gravatar
Total Posts 18439

Re: How to make my new feature searchable using Lucene.Net

Hi,

Please don't post duplicate questions.

Rebuildiung the search index is not something that needs to be done frequently. It only needs to be done if there is some problem in the search index that would be corrected by rebuilding it. 

To implement search in your custom features you should read the article Making Custom Features Searchable, and you should study the source code for existing features that support search to further understand how it works and how to do it.

Basically you implement an IndexBuilder for your feature and you wire up a ContentChangedEventHandler in your feature edit page that invokes your custom index builder when your custom content is edited. Then finally you call:

SiteUtils.QueueIndexing();

after saving your content.

Your index builder serializes index items into the mp_IndexingQueue table, and the call to SiteUtils.QueueIndexing(); starts a background thread with a task that processes the rows from the mp_IndexingQueue table into the actual file based search index.

So in this way the index is maintained as content is changed and it should not require rebuilding the whole index again unless there is a problem to solve, so the Rebuild Index button is not relevant to implementing search in your feature, it is only used for rebuilding the index for all content that is searchable.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.