New search feature

Sep 11, 2007

The last couple of days I’ve been working on improving the in-site search on this website. The old search was quite good, but it returned a list of full posts as a search result. It was difficult to get a good and quick overview of the results that way. When you included comments in the search it didn’t display the comments so you didn’t know whether or not the result was from a post or a comment. Last but not least, it didn’t search in pages. It wasn’t that big an issue for me because I only have one page, but in the future I plan to add more.

Enter the new search

I tried to keep as close to the major search engines' way of displaying results, but added some information relevant for blogs such as tags and categories. Try a search for code or Mads.

As you’ll see from the search results it displays posts, pages and comments in the same result page. It also tells you the type of each result so you can decide whether or not it is relevant to you.

Comment search

It has been possible to include comments in search results ever since BlogEngine.NET 1.0, but with this new search it gets more transparent. You can for instance search for your own name to see all the comments you’ve written yourself. That way I can see that Phil Haack has commented 6 times on my blog and Scott Hanselman has written one comment.

This new search feature will of course be included in the upcoming version of BlogEngine.NET due in a few weeks.

* Only $4.95/month ASP.NET & Windows 2008 + IIS 7 Hosting! FREE SQL Included

Comments (10) -

Dan Atkinson
Dan Atkinson United Kingdom
9/12/2007 8:12:47 AM #

I like the sound of this, Mads! I downloaded the latest build last night, which included this, but I haven't given it a thorough testing on my end yet.

I also made a few suggestions on the forums on pages if you're interested:
www.codeplex.com/.../View.aspx?ThreadId=15022

Karls
Karls United States
9/12/2007 11:29:28 AM #

Good stuff Mads!

Car driver
Car driver India
11/1/2007 3:48:23 AM #

That was a good stuff adding to the blog mads. I really appreciate for finding this kind of stuff. This will certainly help peoples in findings or searching. Thank you.

praveen
praveen India
7/9/2008 7:04:16 PM #

Hi,
great blogengine.
i am happy, but small information.
in search feature, can i search by category? can i search by job post dates? i.e, posts between these date ranges....
please help me out.

thanks

Mads Kristensen
Mads Kristensen Denmark
7/9/2008 7:07:04 PM #

You can only search in the entire data set and not a limited one like only a certain category or date range. However, you can search for certain categories since they are also indexed by the search engine.

praveen
praveen India
7/9/2008 7:17:09 PM #

wow what a fast reply.
You are right. But i need that filter. Search by category.
My blog contains lots of data, so, it's a must.
Hope any idea from you how to do that.

Mads Kristensen
Mads Kristensen Denmark
7/9/2008 7:18:55 PM #

You can do it by changing the search.aspx and its code-behind. You can add a URL parameter called category and then just do a manual search in the code-behind where you loop through all posts.

praveen
praveen India
7/9/2008 7:22:17 PM #

And a small doubt regarding the _Catalog. All the results are populating into _Catalog, even if we don't want all of them. For example, if i have 5000+ entries, then what abt that situation. Still it's getting whole 5000 posts into the _Catalog object and then filter applies, So is that efficient?

Any way we have option to use Sql server, why you guys are not implemented or wrote a SPROC to search for some thing. Is the one you implemented efficient than SPROC's?

thanks

praveen
praveen India
7/9/2008 7:24:16 PM #

Can i write SPROC to get the data? or after getting all the results into _Catalog object, then i need to apply some regex? which one is better?

please help me out.

praveen
praveen India
7/9/2008 9:48:55 PM #

I found that the categories section in the admin side, there is a drop down named Parent. It means we can add categories under a parent category. But surprised, that field is not storing in the data base, it is showing correctly after i added the categories [i.e. it is showing the parent category]. But the problem starts here, when i did IISRESET then all parent columns are null. Because, it is coming from memory previously. So, when i did iisreset all processes will dead in memory, so no parents for all categories. I solved this problem, by adding an extra field called Parent to the DB table be_categories. While adding a category, i am selecting some value from the drop down and storing it in DB. While populating the values, i am getting the Parent filed and showing on the UI.
thanks

Comments are closed

About the author

Mads Kristensen

Mads Kristensen
Program Manager at the Microsoft Web Platform team and founder of BlogEngine.NET.

More...

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.