ElasticSearch Re-Index a single ticket

Infos:

  • Used Zammad version: 3.2.x
  • Used Zammad installation source: YUM,
  • Operating system: CentOS 7
  • Browser + version: 80.0.3987.132 (Official Build) (64-bit)

Being able to force the re-index of a single call would be sufficient and generallyuseful, can anyone assist in how to do this using the console etc.?

Expected behavior:

  • ElasticSearch should update its index when a ticket/customer/organization is updated.

Actual behavior:

  • My elastic search index does not appear to update successfully, specifically I have moved a customer from one organization to another (corrected) however the ticket still appears under the old organization when searching.

organization: () AND state:(open OR new)
organization: () AND state:(open OR new)

Steps to reproduce the behavior:

  • Create a ticket with a customer under one organization, update the customer organization, search for tickets under the new organization (none found), search for tickets under the old organization (same ticket found)

If I understand correctly, you’re basically having the issue that your elasticsearch index doesn’t seem to update fast enough or not update at all?

While indexing a specific ticket is no problem at all, this sounds rather sketchy and not of the problem solution you should aim for. Reason I’m saying this is: If you have the reindex issue now, it will stay sticky and appear again. Surely you can reindex the affected ticket by hand after every update, but that’s not how it should be.

Instead I suggest having a look at your Delayed-Job count (especially if it’s higher than 0 and living sticky at that point): zammad run rails r "p Delayed::Job.count".

If it’s at 0 and your affected Ticket is not updated, you can run the following spoilered command. It doesn’t break anything, but shouldn’t be run if not needed. :wink:

Not needed if Delayed-Job count higher than 0

Again, if your delayed job count is higher than 0, the below command most proberbly won’t address your issue at all.

zammad run rails r "p Ticket.find_by(number: 71001).search_index_update"

Replace 71001 with your affected Ticket number.


Now to the fun part.
If you happen to have searchindex issues please run this:
curl http://localhost:9200
To continue your searchindex version is absolutely mandatory to know - the above command provides it, please share it. Otherwise we cannot continue.

You may also want to run the following:
zammad run rails r "p Delayed::Job.where(\"attempts != 0\").pluck(:handler)

Your production log might also have usefull input.

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