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

SearchResults model #1162

Closed
lukavdplas opened this issue Jun 19, 2023 · 1 comment · Fixed by #1307
Closed

SearchResults model #1162

lukavdplas opened this issue Jun 19, 2023 · 1 comment · Fixed by #1307
Assignees
Labels
code quality code & performance improvements that do not affect user functionality frontend changes to the angular frontend

Comments

@lukavdplas
Copy link
Contributor

lukavdplas commented Jun 19, 2023

This describes a continuation of #1139. It continues on some of the same ideas, and addresses a certain bloatedness of the QueryModel.

Implement a SearchResults model. SearchResults more or less represents the state of the search results page. It should contain the following data:

  • a QueryModel
  • settings for sorting, pagination, and highlighting. Could be grouped into a SearchResultsSettings model?
  • retrieved documents based on the above
  • the total number of documents matching the search
  • a focused document, which can be undefined. This represents the document shown in the popup, if any.

It should handle the following functions:

  • Formulate an elasticsearch query by merging queryModel.toEsQuery() with settings for sorting, pagination, and highlight.
  • When the QueryModel or sort/pagination/highlighting settings are updated, the model should fetch new results. It should have access to the SearchService to do this.
  • Focus and unfocus a document from the results

The SearchResultsComponent basically contains:

  • controllers for sorting, pagination, and highlighting
  • a view for the documents

Note that sorting and highlighting are currently properties of the QueryModel, but they do not belong there, since they are only relevant within the results tab, so they should be moved here.

@lukavdplas lukavdplas added code quality code & performance improvements that do not affect user functionality frontend changes to the angular frontend labels Jun 19, 2023
@lukavdplas
Copy link
Contributor Author

#1307 would more or less close this. What's left is that the results model should be responsible for sorting and highlighting. This is currently handled by the query model, which is not appropriate. I'll make a new issue for that after merging.

@lukavdplas lukavdplas self-assigned this Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality code & performance improvements that do not affect user functionality frontend changes to the angular frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant