-
Notifications
You must be signed in to change notification settings - Fork 3
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
Smart autocomplete #1047
Comments
Might be related to or synergize with #41. |
re: the stanford geocoding service, @mapninja says:
|
Evidently the ArcGIS Online (cloud) version of this API does have a /world endpoint, and because the APIs are the same, we could develop against/use that while the stanford-local one is being set up. More info at: https://developers.arcgis.com/documentation/mapping-apis-and-services/geocoding/tutorials/search-for-an-address/ |
@dnoneill had a great suggestion of looking at Blacklight 8. Some references that might be useful to look at that: https://github.com/projectblacklight/blacklight/blob/main/app/components/blacklight/search_bar_component.html.erb#L24 The autocomplete path will default to the suggest handler in Solr. In looking at that, I am wondering if we need to do something separately on the Solr end to build the suggest index (that's separate from the regular Solr index). We should be able to call the suggest endpoint independently with a query and see which values we will get back. Apart from the Solr stuff, some questions I have are:
|
Also, how do we integrate lobsters? :) |
Another question is - when we understand what and how we want place names to display: do we need to create a new suggest endpoint/dictionary to support this lookup? |
I'll try to answer the questions I think I can answer. It seems there's a mix of UX and technical in those questions, and we might want to have a discussion around some of these.
Not a UX question, correct?
First part of this block seems to be more technical, but there's a UX component to the second part. We could go either route - show only locations (or place names) that match our data or show all locations. Two scenarios come to mind. One - showing only locations that match our data allows users to find datasets matching the location their interested in. Two - showing all locations supports a different use case. I'll use India and Rajasthan (a state in India). Let's imagine we have datasets matching Rajasthan, but we don't have any matching India. If someone knows they're looking for a state in India, but can't remember the exact name or maybe they're interested in a couple different states, etc., they might start by searching for India. In this case, they'd get zero matches. So I lean toward the latter scenario. User sees India as a location match, they click it, the map zooms to India and the search results show all datasets contained within that bounding box.
I believe I answered that above so I now I'm wondering if I misunderstood the question above?
That's a good question. I think the textual search is shown through the matches for datasets and maps, and the location search is just a location/map search. I hope this helps get a bigger conversation started around this. I'm open to other ideas. |
Technically speaking, this matches my understanding and seems like something we can do now, without regard to external calls or geocoding using a service. Maybe this is the MVP implementation for this ticket: just split up the autocomplete results depending on what type of thing they are.
This is correct. The way to get place names is via an external call to a geocoding service, as detailed in the initial description of the ticket. What we would do is merge solr's suggestion results with the external results and display them as a single list with different headings. This could be considered the more full-featured implementation of the ticket.
I think it would just be simpler to do the latter. It's entirely possible that the user enters "New Y...", gets a list of suggestions, and clicks on the one for "New York (city)", but then that search has zero results, because we don't hold any data that falls within the bounding box for NYC. Doing the former seems maybe possible, but hard?
Yeah, this is the idea. It would not do a textual search, because:
|
Thanks @dbranchini and @thatbudakguy for the responses! |
A few questions and comments based on discussion with @edsu:
|
For the Locations part of the results I'm wondering if we could do a query for what's in the input box, and facet by One concern I have about using a Gazetteer of place names is we will get a list of places, but a user who clicks on one of them could very likely end up on a screen with no results, unless we have documents that match the bounding box for the place. |
Summarizing some of the comments from the discussion we had at standup:
Steps: @hudajkhan is looking into these areas in roughly this order: Using search results (as they currently work with Solr /select) in the autocomplete drop down (instead of suggest). How to get Solr highlights/snippets (and if those will work for us). What it takes to do left anchored search and whether that requires an entirely new request endpoint. @thatbudakguy @edsu @dbranchini please feel free to add any comments if I got any of the above wrong. |
@dbranchini , we still have a few questions for you. I think another meeting later will help, and I will update the ticket with some more implementation options/examples. Here is a screenshot right now of a (un-styled) view of autocomplete results we are getting if we use the regular search endpoint (not the suggest endpoint). In general, this looks ok, although it does take longer than a regular autosuggest. How this works currently is that a regular search is done against Solr with "New" which returns a list of Solr documents. The code then organizes the results into datasets and maps based on the resource class, and then looks at the dct_spatial_sm (i.e. place) facet to get the most frequent place values from the results of the "New" query. Here are some of the issues with using search instead of suggest:
|
In the meantime, here are a few possibilities to examine:
|
In standup today we discussed whether we might want to get smart-suggestions for things other than locations and titles, such as publishers, creators, etc. It seemed like the consensus was to hold off for now and only add indexes that we know we need for the current design. We will need to reindex to get the new suggest indexes into place, and should be able to repeat that process if there's a need to suggest publishers, subjects, creators, etc. |
@edsu I have added my work done so far to this branch: This hasn't been rebased to the latest from bl8, but it should have the pieces necessary to test out the configuration. I updated the schema.xml and solrconfig.xml files for the solr configuration. The other important updates are to the blacklight suggest response model and to the suggest.html.erb file. |
I've put an alternative approach to using the https://github.com/sul-dlss/earthworks/tree/bl8-auto-search The advantage to using search is that we get back solr documents which we can use the |
We want to schedule a group session on this. 2 questions: 1. functionality and 2. finesse of search context Marlo will schedule a huddle. |
Discussion was scheduled. Slides at More user feedback/review required. |
This is a brand-new feature to enhance the search experience, both from the homepage and search results page.
To try it out, visit the interactive prototype and click in the search bar to simulate typing.
The suggestions are grouped into categories:
For the latter, the most basic implementation would be to use values from the "Spatial coverage" field/facet. However, this won't result in a spatial search and won't move the map because those values are just metadata – they aren't tied to geospatial locations. We want to do more than this, if we can.
A more complete/featureful implementation would do geocoding, so that "New york (city)" and "New york (state)" could be matched to geospatial coordinates. When you selected each option, you would go to a search with the spatial facet active, as though you had already moved the map to the coordinates/bbox of the place you selected.
This deserves some thought re: implementation. We could query some kind of web service live during the autocomplete process, or we could pre-compute a list of known locations and their coordinates to make the process faster/simpler (but perhaps less complete).
Note that Stanford maintains its own geocoder service at https://sul-geocoding-web.stanford.edu/. It would be great to take advantage of this! There's more information on that page about how the service works; see in particular this page on the geocoding API. There is also a suggestion service that might be worth investigating.
Whatever we do, we probably want to take advantage of solr's built-in functionality for search suggestions.
The text was updated successfully, but these errors were encountered: