-
Notifications
You must be signed in to change notification settings - Fork 5
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
v2: main page/search #249
Comments
This will be a simplified version of the current quick_search_query. All the potential fields for trying to match a search term in the where clause will be replaced by record_type = '{coarse_record_type}' |
@josh-chamberlain @mbodeantor So this will be replacing the quick search and associated API endpoint? Additionally, will users only be able to search for one coarse record type at a time, or multiple? |
@maxachis In order to maintain backwards compatibility, I would suggest a new endpoint with similar functionality |
@maxachis let's let them multi-select coarse record types, why not? Even if the UI doesn't support it. Agreed about keeping the quick search endpoint—we are likely still going to have that option |
@josh-chamberlain @mbodeantor PR has been created, incorporating both the API changes described here and #258 (which as I indicated there, is a very trivial add and is quick to reverse if nonfunctional). Next questions:
|
|
@maxachis Any code you merge into the dev branch will get deployed in the dev instance of the API on DigitalOcean. It uses the same database, but is otherwise separate from the live prod app |
@mbodeantor Once I get further along in setting up the dev database, it may be prudent to switch the dev instance to point to the dev database. That probably also encourages us to copy the data as well as the schema to the dev database, to better emulate it. |
Hey @josh-chamberlain I'm pretty close to starting on the updated UI here. A couple questions:
For instance, if we hit |
@joshuagraber nice!
|
Ah, gotcha @josh-chamberlain, that all makes sense to me.
I think we will have edge cases here. I just did a basic filtering of all data source records and it shows that we have duplicate municipality names in different states. But I suppose as long as we're okay with that, it's nbd. As far as flexibility of API and sharability of links, the easiest path forward here, to me, is to use query params. So that way |
@joshuagraber yes, the duplicate muni names are why you would need the /state/county as a disambiguation. To be clear: The goal of the typeahead is to treat That said, you quickly get into trouble if you let someone search for multiple record types (or, more accurate to the wireframe, record type categories). So far, I think the cleanest way is still /state/county/muni?category={record_type_category}. |
@joshuagraber @josh-chamberlain From the backend perspective, creating a typeahead endpoint will be fun! But it will be fun in the same way running the Pittsburgh Half Marathon was fun. I've never developed a typeahead endpoint, which automatically adds to the fun. Additional points of fun:
|
@josh-chamberlain gotcha, that makes sense. Sorry, I think the design is a bit misleading to me in this respect, because it appears that the user can select state / county / municipality, then search.
Hmm, I think I also misread the design here. So rather than checkboxes, these will need to be radio buttons with only one selectable, no? I'll need to make another update to
@maxachis would this library be potentially helpful? I know this is more or less Google's strategy as well, although their algorithm is almost certainly proprietary.
Yes, debouncing is a best practice in client engineering for this type of work. I won't bother implementing it though, because we use lodash utils, and their debounce function is well tested and consistently maintained.
I think we should just wait for the debounced function to fire a request, rather than set a hardcoded number of characters.
Unless this endpoint will be available publicly, we shouldn't strictly need rate limiting if we're debouncing properly on the client. But if you feel like doing it, I suppose it's a good performance guardrail anyways. |
Yes—the design has not yet been updated to reflect that we want to do a typeahead. Sorry about that. Vikram has responded and will be back online starting ~Monday to make edits
Sorry again for the confusion! I think the design is correct, and I was just thinking out loud—we should allow multi-select. Current favorite answer is a url path for
IMO, typeahead helps here—if someone gets a "no locations found" message, that's a clue that they mistyped. We can get better at this over time. I think Joshua covered the rest. Thanks for helping think it through, y'all |
@josh-chamberlain Ah, gotcha, that makes more sense now, thank you for explaining.
I like that. We could just pass an array of record type values:
True enough, and if we collect a db of search queries by session, it could be an interesting problem to throw at ML. |
Putting together potentially useful articles on the matter: |
@josh-chamberlain Regarding pulling locality from the |
@joshuagraber @josh-chamberlain Just to confirm -- debouncing is done on the frontend through the |
@maxachis @josh-chamberlain Yes, we'll debounce client-side, but IMO it might not hurt to add some rate limiting on the API side as well (for all endpoints, really) if it's not too big of a lift, just as a protective measure against a surprise hosting bill. |
rate limiting: #353 |
part of #248
see wireframe
Front end
places
as objects people can predictably search, not strings we have to try to match.states
andcounties
table, withlocality
from the agencies table.contains
(if the endpoint supports that)Al
yieldsAlabama
beforeTopal County
No results found. Search for "string"?
and load quick search resultsAPI changes
The text was updated successfully, but these errors were encountered: