GitHub user dosubot[bot] added a comment to the discussion: Modify Automatic 
“IN” Filter to Support “LIKE” Search for Categorical Filters

<!-- Greeting -->
Hey @chrisdukeLlama! I'm here to help you with any bugs, questions, or 
contributions you have for Apache Superset. Let me know how I can assist you!

<!-- Answer -->
The logic for automatically applying filters to categorical searches in 
Superset is located in the 
`superset-frontend/src/filters/components/Select/buildQuery.ts` file. The code 
applies an `ILIKE` filter for string types, which is similar to `LIKE` but 
case-insensitive. If you want to use `LIKE` instead of `ILIKE`, you would need 
to modify the code to change the `op` value from `'ILIKE'` to `'LIKE'` 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/filters/components/Select/buildQuery.ts)</sup>.

Additionally, the backend logic in `superset/models/helpers.py` handles 
different filter operators, including `LIKE` and `ILIKE`, in the SQLAlchemy 
query construction. This suggests that the backend already supports both 
operators, and you might be able to leverage this by adjusting the frontend 
logic to specify the desired operator 
<sup>[[2]](https://github.com/apache/superset/blob/master/superset/models/helpers.py)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/c45027da-b509-4956-8887-657e845c1daa?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/c45027da-b509-4956-8887-657e845c1daa?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/c45027da-b509-4956-8887-657e845c1daa?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/c45027da-b509-4956-8887-657e845c1daa?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/c45027da-b509-4956-8887-657e845c1daa?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/c45027da-b509-4956-8887-657e845c1daa?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/c45027da-b509-4956-8887-657e845c1daa?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/33625#discussioncomment-13315738

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to