title: What is a strategy for a simple site site search in a SQL Server 2008 and ASP.NET MVC environment?
body: <p>I am trying to hash out a strategy for implementing a very simple site search in ASP.NET MVC and SQL Server 2008.</p>
  
  <p>Really, all I want to to do is to be able to rank search results based on the number of times a search word or phrase is found in the webpage. I attempted to do this using LINQtoSQL but I ran into a lot of issues where some LINQ commands don't have a SQL equivalent. This was a few months ago so I don't remember specific errors.</p>
  
  <p>So, I'm just trying to figure out an approach. What I'm thinking is this:</p>
  
  <p><strong>Approach 1:</strong>
  I should probably write a program to spider the site and somehow index the site's text - I'm thinking I should save information in a table like:</p>
  
  <ul>
  <li>ID</li>
  <li>Word</li>
  <li>URL</li>
  </ul>
  
  <p>I could then query that and rank based on how many time that word is associated with a certain URL. But then I realized that this technique would completely breakdown if a user was searching for a phrase.</p>
  
  <p><strong>Approach 2:</strong>
  Then I was toying with the idea of using SPROCs to create a temporary table with a record for each URL that would somehow parse the text and determine how many times the phrase or word appeared in each individual URL. and then we would return the results from the temp table. I am thinking the temporary table would look something like this:</p>
  
  <ul>
  <li>ID</li>
  <li>SearchText</li>
  <li>URL</li>
  <li>Frequency</li>
  </ul>
  
  <p>And then <code>select * from temptable order by Frequency asc</code> or something like that.</p>
  
  <p>However, I'm not sure if SPROCs are capable of parsing text like that, or if simultanious searching would be possible.</p>
  
  <p>I am looking for something very lightweight. I'm not really interested in using Lucene or Solr or anything like that because the learning curve seems very steep and those applications' features are far away more than what I need.</p>
  
  <p>Any thoughts on how I should approach this problem? Is there a different approach that I should consider?</p>