I am trying to build a web application in ASP.NET MVC and need build a pretty complex search feature. When a user enters a search term I want to search a variety of data sources which include documents, tables in the database, webpage urls and some APIs like facebook. Any tips, tutorials and hints would be greatly appreciated.
To create a new Programmable Search Engine, all you have to do is choose which sites to search and give your search engine a name. From the Programmable Search Engine homepage, click Create a custom search engine or New search engine.
Thanks! Yes, you can use C++ to program a server-side web application. Most HTTP servers support the FastCGI protocol, so if your application provides the appropriate interface, it can be used to generate web pages to be served by HTTP. That doesn't make it a scripting language though.
Your question suggests that you're probably not planing to implement the whole feature from scratch, so here are some links that you may find useful.
One (the easiest) option would be to use a third-party search engine (e.g. Google Custom Search, but Bing probably has a similar API). This allows you to search (only) your page using Google and display the results in a customized way. The limiation is that it searches only data displayed on some (linked) pages.
A more sophisticated approach is to use some .NET library that implements indexing for you (based on the data you give it). A popular library is for example Lucene.Net. In this case, you give it the data you want to search explicitly (relevant content from web pages, database content, etc.), so you have more control of what is being searched (but it is a bit more work).
Building the actual search index structures and algorithms is no trivial feat. That's why people use Lucene, Sphinx, Solr, etc. Using google.com, as recommended in the comments, will give you no control and poor matching compared to what you'll get from one of these free search engines, when properly configured and used.
I recomend taking a look at Solr, it gives you the power of Lucene but it's much easier to use, plus it adds several convenience features like caching, sharding, faceting, etc.
SolrNet is a Solr client for .Net, it has a sample ASP.NET MVC app that you can use to see how it works and as a base to your project.
Disclaimer: I'm the author of SolrNet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With