title: How to implement an Enterprise Search
body: <p>We are searching disparate data sources in our company.  We have information in multiple databases that need to be searched from our Intranet.  Initial experiments with Full Text Search (FTS) proved disappointing.  We've implemented a custom search engine that <em>works very well</em> for our purposes.  However, we want to make sure we are doing "the right thing" and aren't missing any great tools that would make our job easier.</p>
  
  <h1>What we need:</h1>
  
  <ol>
  <li>Column search
  
  <ul>
  <li>ability to search by column</li>
  <li>we flag which columns in a table are searchable</li>
  </ul></li>
  <li>Keep some relation between db column and data
  
  <ul>
  <li>we provide advanced filtering on the results</li>
  <li>facilitates (amazon style) filtering</li>
  <li>filter provided by grouping of results and allowing user to filter them via a checkbox</li>
  <li>this is a great feature, users like it very much</li>
  </ul></li>
  <li>Partial Word Match
  
  <ul>
  <li>we have a lot of unique identifiers (product id, etc).  </li>
  <li>the unique id's can have sub parts with meaning (location, etc)</li>
  <li>or only a portion may be available (when the user is searching)</li>
  <li>or (by a decidedly poor design decision) there may be white space in the id</li>
  <li>this is a major feature that we've implemented now via CHARINDEX (MSSQL) and INSTR (ORACLE)</li>
  <li>using the char index functions turned out to be equivalent performance(+/-) on MSSQL compared to full text</li>
  <li>didn't test on Oracle</li>
  <li>however searches against both types of db are <em>very</em> fast</li>
  <li>We take advantage of Indexed (MSSQL) and Materialized (Oracle) views to increase speed
  
  <ul>
  <li>this is a huge win, Oracle Materialized views are better than MSSQL Indexed views</li>
  <li>both provide speedups in read-only join situations (like a search combing company and product)</li>
  </ul></li>
  <li>A search that matches user expectations of the paradigm CTRL-f -> enter text -> find matches</li>
  <li>Full Text Search is not the best in this area (slow and inconsistent matching)</li>
  <li>partial matching (see "Partial Word Match")</li>
  </ul></li>
  </ol>
  
  <h1>Nice to have:</h1>
  
  <ol>
  <li>Search database in real time
  
  <ul>
  <li>skip the indexing skip, this is not a hard requirement</li>
  </ul></li>
  <li>Spelling suggestion
  
  <ul>
  <li>Xapian has this <a href="http://xapian.org/docs/spelling.html" rel="nofollow noreferrer">http://xapian.org/docs/spelling.html</a></li>
  <li>Similar to google's "Did you mean:"</li>
  </ul></li>
  </ol>
  
  <h1>What we don't need:</h1>
  
  <ol>
  <li>We don't need to index <em>documents</em>
  
  <ul>
  <li>at this point searching our data sources are the most important thing</li>
  <li>even when we do search documents, we will be looking for partial word matching, etc</li>
  </ul></li>
  <li>Ranking
  
  <ul>
  <li>Our own simple ranking algorithm has proven much better than an FTS equivalent.</li>
  <li>Users understand it, we understand it, it's almost always relevant.</li>
  </ul></li>
  <li>Stemming
  
  <ul>
  <li>Just don't need to get [run|ran|running]</li>
  </ul></li>
  <li>Advanced search operators
  
  <ul>
  <li>phrase matching, or/and, etc</li>
  <li>according to Jakob Nielsen <a href="http://www.useit.com/alertbox/20010513.html" rel="nofollow noreferrer">http://www.useit.com/alertbox/20010513.html</a> 
  
  <ul>
  <li>most users are using simple search phrases</li>
  <li>very few use advanced searches (when it's available)</li>
  <li>also in Information Architecture 3rd edition Page 185</li>
  <li>"few users take advantage of them [advanced search functions]"</li>
  <li><a href="http://oreilly.com/catalog/9780596000356" rel="nofollow noreferrer">http://oreilly.com/catalog/9780596000356</a></li>
  <li>our Amazon like filtering allows better filtering anyway (via user testing)</li>
  </ul></li>
  </ul></li>
  <li>Full Text Search
  
  <ul>
  <li>We've found that results don't always "make sense" to the user</li>
  <li>Searching with FTS is hard to tune (which set of operators match the users expectations)</li>
  <li>Advanced search operators are a no go</li>
  <li>we don't need them because</li>
  <li>users don't understand them</li>
  <li>Performance has been very close (+/1) to the char index functions</li>
  <li>but the results are sometimes just "weird"</li>
  </ul></li>
  </ol>
  
  <p>The question:
  <strong>Is there a solution that allows us to keep the key value pair "filtering feature", offers the column specific matching, partial word matching and the rest of the features, without the pain of full text search?</strong></p>
  
  <p>I'm open to any suggestion.  I've wondered if a document/hash table nosql data store (MongoDB, et al) might be of use? ( <a href="http://www.mongodb.org/display/DOCS/Full+Text+Search+in+Mongo" rel="nofollow noreferrer">http://www.mongodb.org/display/DOCS/Full+Text+Search+in+Mongo</a> ).  Any experience with these is appreciated.</p>
  
  <p>Again, just making sure we aren't missing something with our in-house customized version.  If there is something "off the shelf" I would be interested in it.  Or if you've built something from some components, what components (search engines, data stores, etc) did you use and why?</p>
  
  <p><em>You can also make your point for FTS.  Just make sure it meets the requirements above before you say "just use Full Text Search because that's the only tool we have."</em></p>