Bug 37066

Summary: Elasticsearch not reindexing biblios when add or modify record
Product: Koha Reporter: Daniel <ulmerdan>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P5 - low CC: dcook, magnus
Version: 22.11   
Hardware: All   
OS: Linux   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Daniel 2024-06-10 19:23:18 UTC
Elasticsearch is not automatically reindexed when adding or modifying a record. The new or modified record is not showing up in search results.  However, deleting a record removes it from elasticsearch index.  And adding an authority is automatically reindexed in real time.  Running rebuild_elasticsearch.pl reindexes the new or modified records.  But the biblios index is not being updated automatically for new or modified biblio records.  

Running elasticsearch 22.11.14
Comment 1 David Cook 2024-06-11 04:33:32 UTC
Do you have the ES indexer worker running?

I think deletes are sent directly to ES from the web app, so that would be why the deletes are working. I'm not sure about the authorities...

We (the company I work at) have had issues with Elasticsearch on one server as well, although our issue appears to relate to timeouts. I'm still investigating that one...
Comment 2 Magnus Enger 2024-06-11 06:26:12 UTC
Dp you see background jobs related to Elasticsearch on /cgi-bin/koha/admin/background_jobs.pl, and are they marked as done/finished?
Comment 3 Daniel 2024-06-11 16:54:56 UTC
Thanks for your responses.  I see now the background_jobs "Update Elasticsearch index" are all staged and not executing. Status = "new", progress = "null/1", and started/ended fields are blank.  Is there a setting or another method to have these run in real time?  

Note, I'm not familiar with the ES indexer worker.  Is this applicable if my ES nodes are on a different server?
Comment 4 David Cook 2024-06-11 23:36:15 UTC
(In reply to Daniel from comment #3)
> Thanks for your responses.  I see now the background_jobs "Update
> Elasticsearch index" are all staged and not executing. Status = "new",
> progress = "null/1", and started/ended fields are blank.  Is there a setting
> or another method to have these run in real time?  
> 
> Note, I'm not familiar with the ES indexer worker.  Is this applicable if my
> ES nodes are on a different server?

There's just the background queue. Currently, no way to do it in real time from the web app (although sometimes I think we should add such a setting for single record modifications). 

How have you installed Koha? If you're using the Debian packages, you can run a command like "koha-es-indexer --start --quiet $(koha-list --enabled --elasticsearch)" 

This command is automatically run when the "koha-common" service is started. In your /var/log/koha/<instance>/ directory there should be files like es-indexer-error.log and es-indexer-output.log
Comment 5 David Cook 2024-06-19 00:32:05 UTC
Overall, I think that this is probably a support query rather than a bug report.

I'd suggest you explore the support options: https://koha-community.org/support/