Fix RadioReport Search Filter for Multiple Words
Two odd behaviors I think they are related
Example:
- Entering "Sternradio" into Thekno Search
- Results in the following link:
https://produktion.lohro.de/api/v1/recordings/?search=Sternradio&isAvailable=1&page=1
- One result is found, the one existing CC licensed episode. It has the title
"title": "Sternradio vom 24.01.2021"
this is what to expect (this week, usually there is one more but was cancelled this week)
- Results in the following link:
- Now expanding the search to more words of the title by searching for
Sternradio vom
using thekno search again- Results in
https://produktion.lohro.de/api/v1/recordings/?search=Sternradio+vom&isAvailable=1&page=1
- No results found for multiple words
- The words are splitted in the URL to the term "Sternradio+vom"
- Results in
- Now we do not use the first word, we just use "vom" an expert to find the Sternradio Report / Episode againg
- Results in the API URL
https://produktion.lohro.de/api/v1/recordings/?search=vom&isAvailable=1&page=1
- No results. So it seems that the Word has to be on the first place in title
- Results in the API URL
I have just tested the title. The relevant code part seems to be the CamelCaseFilterSet
, the inheritanced ReportFilter
.
I am also try to understand, why the CamelCaseFilterSet
exist? :) Why are we have this more complex filter definition, and not just the DRF default using search_fields
. They write:
By default, searches will use case-insensitive partial matches. The search parameter may contain multiple search terms, which should be whitespace and/or comma separated. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched.
And is the plus +
sign the default for multiple words search in API definition context?