Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Search action #127

Open
ArthurSmid opened this issue Nov 1, 2020 · 2 comments
Open

Search action #127

ArthurSmid opened this issue Nov 1, 2020 · 2 comments

Comments

@ArthurSmid
Copy link
Contributor

The recent work that Colin did to create a JSON of the Airtable data might be useful for the search function: https://github.com/OpenEugene/little-help-book-web/blob/develop/table-of-contents-style-homepage/src/cachedInlineTables.js

It'd be great if any queries entered could search through fields for Name, Description, Address, City, and Hours. Possibly the most essential fields would be the name and provider descriptions, for example, "pregnant" a potential search query, and that word is in the short description for First Way of Eugene:

Provides pregnancy tests, ultrasound, baby and toddler clothes, baby wipes, diapers, all without charge. Pregnant women can be signed up for insurance and receive referrals for health services.

If there happened to be only one provider description with the word "pregnant" then it seems like the result could go directly to the provider's page, for example, the First Way of Eugene provider page: https://little-help-book.netlify.app/table-of-contents-style-homepage/provider.html?place=rec5Spty79kdK1x0P

But in the event that more than one provider includes the word "pregnant" in their description, then results would be displayed like the contents of the subcategory page, with all the relevant providers listed: https://little-help-book.netlify.app/table-of-contents-style-homepage/subcategory.html?category=recYtWC2H01X9ZQeZ&subcategory=recUaACoGqNcegY54&city=NA

It might be simpler to just return all results structured like the contents on the subcategory page, even if only one entry matches the search query. And so, it's fine to have all search results returned in the manner of the contents on a subcategory page.

For example, this subcategory page for "Clothing" (https://little-help-book.netlify.app/table-of-contents-style-homepage/subcategory.html?category=recYtWC2H01X9ZQeZ&subcategory=recHpBkQDFLBUagtg&city=NA) but imagine someone had typed in "free shoes" and then the provider tiles for any that matched would appear.

Hmm. If someone typed "shoes" and all results that included the words clothing or clothes would appear, that seems like a more evolved kind of search feature because it's associative rather than just a direct word match. I don't know what's possible with the resources we have, but given the powerful search engines people are used to on the internet, I think they might expect more from our search feature than would be possible for us. For that reason, when someone clicks the search icon, there's a bit of text to help clarify: "Type keywords and press Search" and hopefully, by mentioning "keywords" they will try typing specific words that might land on it. Say they want "shoes" and they type shoes and nothing returns if the word shoes isn't in the data, but then they type "clothes" and some results are there.

It'd be great if the search results returned with the search query terms they entered displayed at top where the page name is, bold text up top, in the case of the Clothing page, for example, if someone typed in free shoes the words free shoes (without quotes) would be up top in the same style as the Clothing page name, followed by the search results.

@colindavey
Copy link
Contributor

I would think search should access the tables through the data access layer (dal). Whether the cache is used or not depends on the setting of the dal's useCache variable, with the search function unaware of whether the cache is used or not.

@markdav-is
Copy link
Member

If you are looking for JS to filter the list, I'd suggest a search results page using Map() Reduce() and Filter() to limit the results. Here's an example: https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d

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

No branches or pull requests

3 participants