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

Add an advanced search option to "display results in a map" #1754

Merged
merged 29 commits into from
Feb 9, 2024
Merged

Conversation

ffont
Copy link
Member

@ffont ffont commented Feb 2, 2024

Issue(s)
#1736

Description
This PR adds an option in the advanced search section to display search results in a map. That option will use a map instead of the paginated list of results to show the results. There is a maximum number of sounds to be shown, as loading time can become slow for high number of results. We should investigate the reason for that. One reason is that we perform 2 Solr queries, one initial query to get the number of results and faceting information, and a second repeated query to get a bytearray for the map. We could cache the results of the first query and use it for the second query. Maybe Solr is already doing that for us, we should check. But I think there might be other reasons that make the loading time slow. We should investigate :)

EDIT: I optimised the code so that when we do the first Solr query we save geotags data (returned by Solr) in the cache, and then use this data when creating the geotags bytearray to show points in the map. This means that we actually need to make no DB queries at all when map mode is enabled which makes page loads really fast.

TODO:

  • Add support for solr-based queries in normal search map (without query modification tools)
  • Add link to "open this in a bigger map" below the map in search results page. This redirects to the usual map with the query pre-configured.
  • Make sure the embed options in the "query map page" work just like others
  • Remove tag filtering option from geotags pages, but add a note about making queries with the search page and then opening them on a map (the note with a link to "see results in list")
  • Make user/tag/pack geotag endpoints use Solr queries instead of DB queries for efficiency

Must be merged after #1753

ffont added 29 commits January 23, 2024 12:30
This means that now documents can be partially updated instead of always being completely replaced. This features is not used yet anywhere, but it will be useful when including similarity data to the search engine.

#1714
…bled

We used to store similarity_state field in the sound model, but this is no longer needed when using the search engine based similarity.
This mode complements get_child mode, and will match parent documents instead of child documents
Also fixed an issue with grouping by pack in similarity search
Now we save geotags data returned from solr in the cache, and load it when computing the bytearray. In this way we only make one solr query (and no DB queries) for showing results in the map, which makes page load quite fast.
This will be useful in map embeds
* Add support for solr-based queries in map
* Add navigation links from search page to map page and vice versa
 * Improvements in map embeds code
* Remove old unneeded geotags box code
* Use solr backend in tag/user/pack map pages
@ffont ffont merged commit 755456c into master Feb 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant