Indexing issues: some items/clients/invoices etc are not appearing or do not appear correctly or are out of sync

This could be an indexing issue. You can re-index those items to make sure that that what exists in the database is the same as what is in the search server.

Concepts

Main database

This stores all the data for the app. This is the ‘source of truth’.

Search server

The search server holds duplicates of every item in the main database, in a format that is easier and quicker to search and manipulate. Values in the search server are updated whenever anything changes in the main database. However sometimes like during an update, or if there are server errors, the database values don’t get copied to the main database. This can cause the search server to be out of sync with the database. Re-indexing the items (duplicating certain values from the main database to the search server again) can bring them back in sync.

Steps

  1. Open your browser, go to any page within the company in question

  2. Get the company id, if you don’t know it, you can look in the address bar for something like this, where the XXXX is the company id:

    costcertified.cc/XXXX-CompanyName/current_page
  3. Open the Javascript Console on your browser command + option + J for chrome on mac, shift + ctrl + j for chrome on windows

  4. Use the company id you have and type this in the bottom of the javascript console, replacing XXXX with the company ID you found, and ENTITYTYPE with the item type you need to fix (see list of entity types below)

    c.ajax('search/indexScopeEntity/company/XXXX/ENTITYTYPE')

Here is a list of entity types (to replace ENTITYTYPE) that you can re-index:

  • cost_types (items)

  • assembly

  • quote

  • change_order

  • pipeline

  • invoice

  • labor_type

  • vendor

  • transaction

  • client

  • lead_source

  • bid

  • tax

  • template

  • lead_rotation

  • file

  • user

Congratulations you are now a hacker! slightly smiling face