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

Investigate Generating ExpressSearchConfig #6292

Open
acwhite211 opened this issue Mar 3, 2025 · 0 comments
Open

Investigate Generating ExpressSearchConfig #6292

acwhite211 opened this issue Mar 3, 2025 · 0 comments

Comments

@acwhite211
Copy link
Member

acwhite211 commented Mar 3, 2025

Investigate generating the ExpressSearchConfig file dynamically when the /context/available_related_searches.json API is called. This is to restore behavior prior to v7.10. Replace the use of using a default ExpressSearchConfig.xml in the static files.

Described in detail from this comment #6290 (review).

Approving this, but with three important notes:

1. The testing checklist here does not verify that behavior has not been modified between 7.9.6.2 and 7.10, which may leave us open to issues if we inadvertently break this behavior.

2. Someone in @specify/developers  should open a new issue to fix the fact that this (`available_related_searches.json`) file is not being automatically generated.
   https://github.com/specify/specify7/blob/production/specifyweb/frontend/js_src/lib/tests/ajax/static/context/available_related_searches.json
   My understanding is that before 7.10, Specify would automatically create this file based on the list of available express search options. See below:
   https://github.com/specify/specify7/blob/56bebce77488a13783e9d43782330d348a7f5896/specifyweb/context/views.py#L412-L425
   
   These 'related searches' are defined in this file:
   https://github.com/specify/specify7/blob/56bebce77488a13783e9d43782330d348a7f5896/specifyweb/express_search/related_searches.py#L25-L37
   
   This means it would be theoretically quite simple to extend the default simple search behavior using the old approach, but with this patch (does not fix the underlying issue, simply provides a default static file), it adds another level to the complication.

3. Before merging, can you explain how was this default `expresssearchconfig.xml` sourced? I'm concerned it may change the default searching behavior in the app.
   Upon removing all `ExpressSearchConfig` app resources in a database and logging in through Specify 6, I get this which seems to be as "default" as it comes:
   [DefaultExpressSearchConfig.txt](https://github.com/user-attachments/files/19054962/DefaultExpressSearchConfig.txt)
   The file in this PR is nearly [twice the size and is structured differently](https://raw.githubusercontent.com/specify/specify7/issue-5470/config/common/expresssearchconfig.xml).
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

No branches or pull requests

1 participant