You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a fulltext search for INCOMPLETE I want to find tickets which have INCOMPLETE in their title.
Actual behavior
When running a fulltext search for INCOMPLETE tickets which have INCOMPLETE in their title are not reported.
How to reproduce
Steps to reproduce the behavior:
Create a new ticket manually with INCOMPLETE as part of the ticket title. Make sure not to have INCOMPLETE as a word in an article in this ticket. We only want to work with the ticket title here and not with the article_search_index.
Do a full text search via the textfield on the dashboard for INCOMPLETE
lc is applied and as a result, the sql query will search for ArticleFulltext.article_value LIKE '%incomplete%' OR st.title LIKE '%incomplete%'.
The issue is that PostgreSQL behaves differently in terms of case sensitivity than mysql. By default, LIKE in PostgreSQL is case-sensitive. So LIKE '%incomplete%' will only match exactly incomplete not INCOMPLETE or Incomplete.
The describes scenario works well in mysql but not in PostgreSQL.
If lc is applied to the value provided for fulltextsearch (INCOMPLETE in our case), this has to be reflected in the sql query as well. Since the query uses st.title LIKE '%incomplete%' in the WHERE clause, but st.title contains ... INCOMPLETE ... in uppercase letters, no match will be reported for this ticket by PostgreSQL.
The text was updated successfully, but these errors were encountered:
When you search explicitly for Title via the extended search form, this issues does not occur because there lower is applied to both sides of the LIKE:
LOWER(ArticleFulltext.article_value) LIKE LOWER('%incomplete%') OR LOWER(st.title) LIKE LOWER('%incomplete%')
This causes additional load for ArticleFulltext.article_value which is not needed (because the index already stores lower case only), but we get the tickets with the requested ticket title using this approach.
Environment
Expected behavior
When running a fulltext search for
INCOMPLETE
I want to find tickets which haveINCOMPLETE
in their title.Actual behavior
When running a fulltext search for
INCOMPLETE
tickets which haveINCOMPLETE
in their title are not reported.How to reproduce
Steps to reproduce the behavior:
INCOMPLETE
as part of the ticket title. Make sure not to haveINCOMPLETE
as a word in an article in this ticket. We only want to work with the ticket title here and not with the article_search_index.INCOMPLETE
Additional information
In this line
Znuny/Kernel/System/Ticket/ArticleSearchIndex/DB.pm
Line 316 in 7f7219e
lc
is applied and as a result, the sql query will search forArticleFulltext.article_value LIKE '%incomplete%' OR st.title LIKE '%incomplete%'
.The issue is that PostgreSQL behaves differently in terms of case sensitivity than mysql. By default,
LIKE
in PostgreSQL is case-sensitive. SoLIKE '%incomplete%'
will only match exactlyincomplete
notINCOMPLETE
orIncomplete
.The describes scenario works well in mysql but not in PostgreSQL.
If
lc
is applied to the value provided for fulltextsearch (INCOMPLETE in our case), this has to be reflected in the sql query as well. Since the query usesst.title LIKE '%incomplete%'
in the WHERE clause, butst.title
contains... INCOMPLETE ...
in uppercase letters, no match will be reported for this ticket by PostgreSQL.The text was updated successfully, but these errors were encountered: