CottageLabs/idfind — Issue #16: Do not return unknown identifiers from the cache
Author: emanuil-tolev
Created: 2012-02-14 18:30:22+00:00
State: open

If we try to identify an identifier and we fail, it gets indexed into ES as "type":"unknown". That's how it should be, because we could run a nightly script* on those which would then run any newly submitted tests**. However, when we try to look in the cache for an identifier in order to return that cache hit to the user, we need to NOT look at unknowns.

Otherwise we end up with a situation where an identifier is regarded as "unknown" only once, when it first enters the index - and from then on idfind will return "successful" for identification attempts, but all they would say is that the identifier is "type":"unknown". So, successfully identified, but we know nothing about it.

That'd be best achieved by still writing all unknowns to the index, but excluding the unknowns when we query the cache.

* a nightly script OR something similar, we've not actually decided on anything
** Note: we've got to record a timestamp on when an attempt was last made to identify the identifier. Otherwise we'd have to run all tests on all unknown identifiers, which might not be too bad in the beginning. However, it's not a good idea to have an external process that doesn't scale very well.