Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make it easier to find a growing guide for a 'parent' or related crop #842

Open
CloCkWeRX opened this issue Oct 5, 2016 · 2 comments
Open

Comments

@CloCkWeRX
Copy link
Contributor

All of these:
https://openfarm.cc/en/en/crop_search?q=Cucurbita+pepo

can probably be grown following the general directions tied to https://openfarm.cc/en/crops/pumpkin (Cucurbita).

EOL for example does this with a heirachy control (http://eol.org/pages/38266/overview); however a poor man's version of this might be to simply search for crops with a bionomial name contained entirely in the current crops' binomial name.

in psuedocode, something like:

def find_parent_crops(binomial_name)
  return if binomial_name.empty?
  search_criteria = binomial_name.split(' ')[0...-1].join(' ')
  parent_crop_candidates = Crops.where(name: search_criteria)
  return find_parent_crops(search_criteria) unless parent_crop_candidates.any?
end

Most commonly, it's going to end up being no more than 2-3 queries, unless there is anything horrible like 'foo var bar x bar var foo'.

Alternatively, giving shorter binomial name crops or crops with photos a higher ranking in search results may help in situations like this:

image

@CloCkWeRX CloCkWeRX changed the title Make it easier to find a growing guide for a 'parent' crop Make it easier to find a growing guide for a 'parent' or related crop Oct 5, 2016
@CloCkWeRX
Copy link
Contributor Author

Not sure if I've really captured the essence of this properly; basically if you search for 'pumpkin' you get no guides; but 'cucurbita pepo' (named squash in this instance) actually has a guide.

@simonv3
Copy link
Member

simonv3 commented Oct 5, 2016

Yeah, figuring out that search is definitely a necessary thing to do.

One thing to note is that the Crop model has a knowledge of "varieties" and "parent". I don't think any of that data is filled in at the moment, but it's probably relevant. Going through the most popular crops and linking those is probably a necessary todo task as well. There is no interface for this at the moment except for the admin panel.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants