Skip to content

Instantly share code, notes, and snippets.

@eevee
Created September 14, 2013 06:26
Show Gist options
  • Save eevee/6559320 to your computer and use it in GitHub Desktop.
Save eevee/6559320 to your computer and use it in GitHub Desktop.
veekun8 lookup

lookup

some issues with lookup

  • still has sort of a weird english bias
  • disambiguation sucks
  • completely divorced from search
  • syntax is arcane and awful
  • no neat shortcuts for anything but the five or six primary loci

grandiose plan for round 2

all the special syntax goes away. instead, lookup is just a sequence of words, which may be any kind of search criteria.

criteria include:

  • loci names (pokemon, move, type)
  • names (eevee, scratch)
  • language names (english)
  • language codes (en)
  • colors (blue)
  • egg groups (whatever these are)

and, of course, all of these things will be accepted in any language.

as now, if there's only one result, use that. otherwise, redirect to the search page. which is slightly more complex than it sounds:

  • if there's only one possible locus, use that one. e.g., specifying pokemon obviously means to use the pokemon search. but there are other cases: specifying purple is a color, and those only exist for pokemon, so we could still use the pokemon search.
  • if it's ambiguous, or there are multiple loci, or the chosen locus doesn't have a dedicated search, then use a special lookup-results page that lists the criteria and big detailed tiles for each of the results. should have links directly to the move/pokemon searches too.

making it work

we'll have to do some clever preprocessing before consulting whoosh, since any given word might be intended as an instruction or as part of a name. it might be enough to look for instructions and simply tell whoosh that they're optional. (we'd then have to check whether whoosh actually matched on any of them before deciding to use them as instructions, too.)

questions

  • if i search for normal, do i mean i want to see the page for normal-type, or i want to find things that are normal-type? should we require pokemon normal for the latter case?

  • how do egg group instructions work, since they have spaces in them?

future extensions

  • dead-simple way to search by numbers. since we're doing word-splitting this will probably need to use parentheses or some other delimiter, unless we want to guess. something like (height < 4 feet).

  • we should probably be logging queries somewhere to get an idea of just what people are expecting to be able to find

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment