Full Text Indexing
From GO Public
Please see GOlr_Progress instead.
This document looks at the reasons for using FTI, as well as some of the high-level software choices that have been made.
To see the current status, please try Full Text Indexing Progress.
- Existing database text searches on GO are slow and plagued by false positives and false negatives.
- Make previously impossible services possible. Things like autocomplete and certain types of search were not practical in our infrastructure (e.g. gene products annotated to multiple terms).
- Make user interfaces as fast and responsive as possible.
- Remove needless work and save resources for cases where a relational database makes sense.
Given an in-memory ontology to work with, a cleverly designed schema could cover a lot of cases where SQL is currently used, but at potential much higher speed. See Full Text Indexing Progress.
A Solr-based system could also be used in a more general information caching sense; for example, it may have uses in page display and quick retrieval of commonly requested data.
Evaluation of Solr
Given the below information, the fact that Lucene has dominated the FTI landscape, and our experiments with other systems (see Full Text Indexing Progress), we are moving ahead with a Solr-based solution.
Perl/CLucene (the system our previous attempt was based on) lags far behind the official Lucene API and we cannot get the functionality we require. For example, solutions to the leading '*' problem and support for DisMax did not appear in the CLucene bindings.
Solr also provides different facets to the same underlying data, giving the ability to have an API specialized for different things (e.g. search, spellcheck, autocomplete).
While Lucene is written in Java, Solr has a native RESTful API which makes it language neutral for web consumers. There was some potential for the old CLucene library to be platform agnostic, but with age issues (see above) and poor support, these did not pan out.
Doing some simple benchmarking, Solr by itself seems to run somewhere between 2 and 10 times as fast the fastest iteration of the old system, and seemed to hold even under very heavy load. Putting it behind an Apache http proxy seems to more or less double the time, but makes some issues (security, load balancing) easier to deal with.
Also see go-dev source for some documentation.
Since Solr can connect directly to a relational database, it is much quicker to update and less error-prone than previous hand-rolled methods. In the last check, it took under a minute for a terms index and under twenty minutes for a combined term/gp index. Solr also allows for just updating new data as well as having full access while all of these things are happening.
The general search results are better now that we have direct control over the boosting of different fields. There also seems to be improvements in the text analyzers that come with it. The next version of Solr should have the term completion we want built in, but right now, with a little munging on the client, we can get better results than what we are getting out of the current setup. There is also the option to dig into the Java code and get exactly what we want, but that would take a bit more effort (maybe later on).
While there are impressive speed improvements with FTI, given the uses that we have in mind (e.g. text completion as a ubiquitous public and private service), there is the worry that we could be overwhelmed with requests or that our hardware would be insufficient.
Solr and Lucene should be designed with much heavier tasks in mind on larger datasets. We (currently) believe that there is no problem here, and our benchmarks seem to imply the same thing; but we likely won't know until we really have to deal with it.
The worst case scenario is that we restrict it to internal use and external applications that we've okayed.
Solr doesn't supply it's own security, which has to then be done either through the hosting server (Jetty in this case) or the proxy server (which causes a speed hit) if firewalled. I can't say I'm thrilled with the options, but I got something like I wanted through some rewrite rules on Jetty.