Full Text Indexing: Difference between revisions

From GO Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
=DEPRECATED=
Please see [[GOlr]] instead.
=Overview=
=Overview=


This document looks at the reasons for using FTI, as well as some of
This document looks at the reasons for using FTI, as well as some of
the software choices that have been made.
the high-level software choices that have been made.


To see the current status, please try [[Full Text Indexing Progress]].
To see the current status, please try [[Full Text Indexing Progress]].
Line 8: Line 12:
=Rational=
=Rational=


* Existing database text searches on GO are slow and plagued by false positives and false negatives. There are many cross-cutting areas where fast ontology or annotation searching and/or autocomplete would be beneficial.
* 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 previously impossible services possible. Things like autocomplete and certain types of search were not practical in out infrastructure.
* Make user interfaces as fast and responsive as possible.


* Decrease needless workload and save effort for cases where a relational database make sense.
* Remove needless work and save resources for cases where a relational database makes sense.


==Other Uses==
==Other Uses==
Line 39: Line 45:


Solr also provides different facets to the same underlying data,
Solr also provides different facets to the same underlying data,
giving the ability to have an API specialized for different thing
giving the ability to have an API specialized for different things
(e.g. search, spellcheck, autocomplete).
(e.g. search, spellcheck, autocomplete).


Line 61: Line 67:
==Fast Indexing==
==Fast Indexing==


Since Solr can connect directly to a MySQL database, it is much
Since Solr can connect directly to a relational database, it is much
quicker to update and less error-prone than previous hand-rolled
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
methods. In the last check, it took under a minute for a terms index
Line 69: Line 75:


==Better Results==
==Better Results==
Anecdotally, people have gotten better search results using Solr over
the old system. This may be due to the improved default engines
defined in Solr.
=== Install Solr on Labs ===
We have an installation on labs at
* http://accordion.lbl.gov:8080/solr
Update from 2010-08-06
<pre>
As a note for interested parties, I've got a test installation of Solr
for GO up on accordion (http://accordion.lbl.gov:8080/solr, but not
terribly useful unless you're sending it the right commands). I probably
won't play with it for a while, at least until this release of AmiGO is
out and I try and switch the search backend over for 1.9, but I wanted
to get down what I've seen so far.


The general search results are better now that we have direct control
The general search results are better now that we have direct control
over the boosting of different fields. There also seems to be
over the boosting of different fields. There also seems to be
improvements in the text analyzers that come with it. The next version
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,
of Solr should have the term completion we want built in, but right
with a little munging on the client, we can get better results than what
now, with a little munging on the client, we can get better results
we are getting out of the current setup. There is also the option to dig
than what we are getting out of the current setup. There is also the
into the Java code and get exactly what we want, but that would take a
option to dig into the Java code and get exactly what we want, but
bit more effort (maybe later on).
that would take a bit more effort (maybe later on).
</pre>
 
=== GO Solr Indexing Engine ===
 
Current implementation uses solr xml to query GO database to build indexes. This approach is quite brittle.
 
In future we may do this via a java parser of GAFs + OBO Files
 
=== Solr Indexing Engine Optimizations ===
 
=== Integrate ===
 
==== Queries ====
 
==== Autocomplete ====
 
==== Advanced ====


=Caveats=
=Caveats=

Latest revision as of 18:40, 7 April 2014

DEPRECATED

Please see GOlr instead.

Overview

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.

Rational

  • 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.

Other Uses

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.

Useful API

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).

Platform Agnosticism

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.

Fast Search

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.

Fast Indexing

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.

Better Results

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).

Caveats

Scaling

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.

Security

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.