OpenTreeOfLife/opentree — pull request #479 by jimallman (2014-10-07 01:57:45+00:00)
Title: Auto and on-demand option to infer search context.

This is done automatically each time a study loads, and again if the user clicks the **Infer search context from all OTUs** button under the OTU Mapping search-context menu. NOTE that this also sets the context for the focal-clade selection menu in the Metadata tab. See related discussion in #421 and #407.

@chinchliff: As we discussed, I'm using 5000 names as the maximum submitted via AJAX `POST`. This is easy to change, just set the variable `maxNamesToSubmit` accordingly. The logic here steps through the entire list of OTUs, culling each *n*-th item as needed to stay under the limit. This should give us a representative sampling of taxon names without any huge gaps.