-
Notifications
You must be signed in to change notification settings - Fork 16
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
Improve search form autocompletion #341
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First in a series of commits centered on replacing the `typeahead` library with the `autocomplete`. The latter provides more functionalities while being visually equivalent to the former.
`getRanked` has been replaced by `getAll`
Now provides the ability to retrieve labels whose name matches a certain pattern, as well as the previous retrieval of most popular.
Metamodel classes are not generated for inner-class entities. In the meantime, we work around this by manually writing the definitions. Although this completely mitigates any advantages that the automatic generation provides, I refuse to separate so many things into their own micro-classes.
The script started out just for "language", but will further evolve for all autocompletion configuration.
This is so that they are consistent in name with the other views.
Creating a materialized view here is unnecessary in my opinion, since the queried column is indexed. If we were to materialize, then more new triggers would need to be created.
The view will not be enough unfortunately, the join performance seems to be quite poor without a foreign key. For this reason I changed `license_statistics` from a view to a regular table, akin to the `label` and `topic` counterparts.
The reason this "does not work" before was because Spring Data JPA can not infer the count queries for these. Once I wrote them myself it was business as usual.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What initially started as a simple library replacement quickly ballooned into a massive refactoring. In essence, endpoints that expose information regarding:
label
topic
license
language
Can now be fully searched. The server endpoints are programmed in such a way that they return pages of matches in the following order:
Within each match group results are further sorted according to their prevalence across projects. Items with comparable popularity are finally sorted alphabetically. On the other hand, if no search string is provided the endpoints will return the most popular terms. This allowed us to change the search form autocomplete suggestions: The user clicks on the input and receives an initial set of suggestions according to the most popular items. They then type out what they want to search for, receiving suggestions following a quarter-second debounce. At the same time, a loading spinner is rendered to indicate that the items are being fetched. Once the server response is received, the spinner is hidden revealing a list of the 10 top-most matching results. Each result also contains a highlighted portion of text, indicating why this result is included. The user can then click or keyboard-navigate and select one of the options, setting the value of the search form field.