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

Search "frontend" refactor #1756

Merged
merged 45 commits into from
Apr 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e1d88b3
Add basic implementation of SearchQueryProcessor
ffont Feb 16, 2024
a4a2363
Fix "search in" option parsing
ffont Feb 16, 2024
513ff85
WIP generate query_params dict from SearchQueryProcessor
ffont Feb 16, 2024
b41c446
Further work in query processor
ffont Feb 16, 2024
e0fa707
Implement more search query options, add comprehensive tests
ffont Feb 19, 2024
f8a0e01
Add method to make URLs and tests for it
ffont Feb 19, 2024
b003670
Add method to test for active advanced search options
ffont Feb 19, 2024
0a0576a
Add test for contains_active_advanced_search_options
ffont Feb 20, 2024
3d1c865
Fix for boolean options in filters
ffont Feb 20, 2024
0e0de1d
Make visible select elements follow disabled status
ffont Feb 20, 2024
6f50adb
WIP re-implementing search view with sqp
ffont Feb 20, 2024
9b06b2e
WIP re-implementing search view with sqp, results list section
ffont Feb 21, 2024
3719876
Working facets with SearchQueryProcessor
ffont Feb 21, 2024
0de8774
Working SearchQueryProcessor-based search page
ffont Feb 21, 2024
ff180cc
Fix failing tests
ffont Feb 21, 2024
cf8172f
Make custering work with python 10
ffont Feb 22, 2024
11a4c54
WIP make clustering work with SearchQueryProcessor and similarity vec…
ffont Feb 22, 2024
c4c7c4d
Make clustering work in new UI
ffont Feb 23, 2024
096504b
Tidy up methods to get clusters graph data
ffont Feb 23, 2024
a0ed755
Show/hide beta search options with django perm
ffont Feb 23, 2024
5b58b6d
User random numbers for cluster IDs
ffont Feb 23, 2024
621fbc6
Fix issue with grouping pack when no packs
ffont Feb 23, 2024
8d7abfc
Fix bug in facet filter quotation
ffont Feb 23, 2024
ddf2db7
Update networkx version in web image
ffont Feb 26, 2024
6a62309
Make clustering task run on web_worker image
ffont Feb 26, 2024
5ef76c8
Cancel clustering task if timeout
ffont Feb 26, 2024
7851d8b
Makes tests pass again
ffont Feb 26, 2024
f6d6566
Move some tests around and add some extra
ffont Feb 29, 2024
9d6be4a
Remove print
ffont Feb 29, 2024
8af3d74
Add comment
ffont Feb 29, 2024
3172bdc
Remove no longer neede files
ffont Feb 29, 2024
c5512c7
Properly document SearchQueryProcessor class
ffont Mar 1, 2024
cfeaa88
Move SearchOption base classes to new file
ffont Mar 1, 2024
e0fde6d
WIP properly documenting and refactoring SearchOption(s)
ffont Mar 4, 2024
efc6785
More WIP refactoring SearchOption
ffont Mar 4, 2024
645be9c
Refactor SearchOption class and the way it is handled in SearchQueryP…
ffont Mar 5, 2024
9a5901f
Add some property shortcuts to SearchQueryProcessor
ffont Mar 5, 2024
4c835d3
Make "advanced" parameter True by default
ffont Mar 5, 2024
4b45c95
Display clusters in a nicer way
ffont Mar 5, 2024
388a186
Add some documentation about adding new search options
ffont Mar 5, 2024
ae4d40b
Fix bug with empty clusters
ffont Mar 5, 2024
e6fbc2a
Use templatetag to help displaying search options in template
ffont Mar 5, 2024
e26fcc7
Trigger cluster selection submit from search.js
ffont Mar 5, 2024
caf1d8f
Merge branch 'master' into search-refactor2
ffont Apr 10, 2024
83e6fbc
Fix failing tickets tests
ffont Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix "search in" option parsing
ffont committed Feb 16, 2024
commit a4a236385f427862e7389b12654703c98a294d8d
7 changes: 4 additions & 3 deletions search/search_query_processor.py
Original file line number Diff line number Diff line change
@@ -192,22 +192,23 @@ class SearchOptionMapMode(SearchOptionBool):


class SearchOptionSearchIn(SearchOption):
name='search_in'
value_default = []
options = [
('a_tag', 'Tags'),
('a_filename', 'Sound name'),
('a_description', 'Description'),
('a_packname', 'Pack name'),
('a_packname', 'Sound ID'),
('a_soundid', 'Sound ID'),
('a_username', 'username')
]

def value_from_request(self, request, f_parsed_iterable):
value = []
for option in self.options:
if option[0] in request.GET:
if request.GET.get(option[0]) == '1':
value.append(option[0])
value.append(option[0])
return value

def should_be_disabled(self):
return self.search_query_processor.get_option_value('tags_mode') or self.search_query_processor.get_option_value('similar_to')
2 changes: 1 addition & 1 deletion search/tests.py
Original file line number Diff line number Diff line change
@@ -304,4 +304,4 @@ def test_search_query_processor_query_parsing(self):
user.profile.use_compact_mode=True
self.run_fake_search_query_processor(url='/search/?advanced=&g=1&only_p=&q=&f=license%3A%28%22attribution%22OR%22creative+commons+0%22%29%20tag:%22percussion%22&s=Date%20added%20(newest%20first)&w=', user=user)


self.run_fake_search_query_processor(url='/search/?q=&f=license%3A%28%22attribution%22OR%22creative+commons+0%22%29+tag%3A%22percussion%22+duration%3A%5B0+TO+*%5D&w=&tm=0&s=Date+added+%28newest+first%29&advanced=1&a_tag=on&a_description=on&a_soundid=on&g=1&only_p=&cm=1&mm=0#')