Cannot search for terms containing forward slash

Hello.
I can’t tell if it’s a bug of ElasticSearch or Zammad. But when i try to search something containing ’ / ’ it returns no results, but i know it is present in my tickets. For example: 123/2. When i search for 123 it finds it, but the complete term 123/2 returns nothing.
I have tried rebuilding indexes.
I have switched from having an Elasticsearch installed on the same machine to a dedicated one, but this issue is still present.

Hi @RTechSn. Could you please use our template for such requests and provide all information? Thanks a lot. :slight_smile:

PS: I guess you have to escape the / to \/ and it should work…

Sorry, i haven’t reslized that is important in this context.

  • Used Zammad version: Zammad 6.0.0-1691946056.47e1e571.focal
  • Used Zammad installation type: Deb package
  • Operating system: Ubuntu 20.04.6 LTS
  • Browser + version: all

As i’ve found out, adding quotes to the query works also.
But this is such a hickup for the work process, shouldn’t it be considered as a bug?

Well, after some digging in the source code, i have fixed the problem all by myself.
In the this file /opt/zammad/app/services/service/search.rb
i’ve added

replacements = {
'/' => '\/'
}

term = term.gsub(Regexp.union(replacements.keys), replacements)

after this code

  def execute(term:, objects:, options: { limit: 10 })
    options[:limit] = 10 if options[:limit].blank?
1 Like

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.