Sorting Search Results

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.
6/8/2011 4:47:04 AM
Gravatar
Total Posts 5

Sorting Search Results

Hi there

Is there any way to sort search results?

For example, display search results from module A before module B.

Is it possible to use SortOrder in ModuleDefinitions to sort the search results?

6/8/2011 1:35:34 PM
Gravatar
Total Posts 2253

Re: Sorting Search Results

Hi,

There currently isn't any way to sort Search Results. The user can filter them and you can restrict which features are searched by following the instructions here. See the section towards the bottom where the document discusses the SearchableFeatureGuidsToExclude web.config key.

Sorting isn't a bad idea but I am not sure how difficult it would be to implement. You may want to request it in the Feature Requests forum.

HTH,
Joe D.

6/9/2011 6:56:10 AM
Gravatar
Total Posts 5

Re: Sorting Search Results

The Searcher from Lucene.Net.Search provides option for sorting.

For example 

IndexSearcher searcher = new IndexSearcher(indexPath);
// a 0 based colection
Sort sort = new Sort("FeatureId");
Hits hits = searcher.Search(mainQuery, sort);

But I could not find any way to sort the results based on SortOrder of ModuleDefinitions as we are not storing that information in search index files.

6/9/2011 7:31:30 AM
Gravatar
Total Posts 2253

Re: Sorting Search Results

Hi,

The SortOrder properties in the ModuleDefinition file aren't for Search Sorting.

The one on the FeatureDefinition section is for the order in which to display the module on the "Edit This Page" page.

The sortOrder property on the featureSetting section is for the order to display the setting on the module's Settings page.

Being able to sort search results sounds like a nice idea, but it is currently not implemented in mojoPortal. If you submit a Feature Request, it may get added to the core.

HTH,
Joe D.

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