This project is read-only.

How does search work?

Topics: Developer Forum
Nov 24, 2008 at 9:44 PM

N2 looks interesting, but it seems the current release and the documentation is out of sync? Also, I can't get the source release working right.
The N2_TemplatesSite seems to work, so I have to work from there.

I'm wondering about the search feature. How do I define what's indexed, and how do I control the rendering of the results?
As of now it seems I only get hits on the page names in the TemplatesSite and only the page names is shown.
I can't find any documentation regarding searching.

Nov 25, 2008 at 12:34 PM
> it seems the current release and the documentation is out of sync?

Unfortunately N2 documentation is very poor. I have made some small contributions to the Wiki and encouraged my developers to do so also as they learn the system; however I have only had limited success in motivating them in this work :-).

I hope you and others will also be able to make contributions, even small ones, and that eventually we will have documentation as excellent as N2 its self.

Nov 25, 2008 at 1:46 PM
I have already registered at the wiki and I'm intending of documenting the answers I get here as a start. :)
Nov 25, 2008 at 7:15 PM
Hi, I appreciate that you point out (or even better, update) outdated documentation.
Nov 25, 2008 at 8:58 PM
The search included with N2 templates performs a database search against all text in the site. You could take a look at code and follow what's going on using the debugger.
Nov 26, 2008 at 8:09 AM
I have found it, but I couldn't get the source running unfortunately. I see that you have also answered that question so I will try that. Thanks!

If I want to use full text-search with sql server (we're only doing sql server, and preferably 100% stored procs), I do need to replace the search code right?
In an ideal world, there would be a view in the admin gui where searched properties for each page type is chosen, or maybe it could be defined using an attribute in code. [Searchable] or something like that.

From what I understand, properties named Title, Name and Detail is searched when DatabaseSearch is used. I cant however see any reference to it in the code. But it must be used right? It's the only concrete implementation of ICollection<ContentItem> Search(string query) as far as I can see.