What's the best way to recreate Lucene index for HAPI JPA?

640 views
Skip to first unread message

al...@tyde.com

unread,
Nov 14, 2016, 7:06:10 PM11/14/16
to HAPI FHIR
Hi all

Just wondering how to recreate the Lucene index for HAPI? It appears that after maven clean, the index is wiped since it is stored in the target/ folder.

Cheers
Alvin

James Agnew

unread,
Nov 14, 2016, 10:24:48 PM11/14/16
to Alvin Leonard, HAPI FHIR
Hi Alvin,

Ah I've made this mistake before too. Always fun. :)

You can trigger a manual reindex of the entire database (resources and terminology server) by calling the following operation: 
http://[server_base]/$mark-all-resources-for-reindexing

This kicks off a process that might take a while depending on how big your database is. It's designed to reindex in small chunks in order to avoid hogging the server, so it goes for a while. Watch your server logs to see when it's done.

Cheers,
James



--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/729a23c4-314d-4e8e-aafc-86063e34757c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alvin Leonard

unread,
Nov 14, 2016, 10:25:56 PM11/14/16
to James Agnew, HAPI FHIR
Ah Sweet James! I knew there must be something you guys use to do this. I have been trying to recreate it manually using the MassIndexer. Will give that URL a go. 


Alvin Leonard
Lead Engineer


al...@tyde.com

unread,
Nov 14, 2016, 10:34:12 PM11/14/16
to HAPI FHIR, al...@tyde.com
Actually, is this reindexing the resources for look up or the full text search? I'm trying to rebuild the Full Text Search index.


On Tuesday, November 15, 2016 at 2:24:48 PM UTC+11, James Agnew wrote:
Hi Alvin,

Ah I've made this mistake before too. Always fun. :)

You can trigger a manual reindex of the entire database (resources and terminology server) by calling the following operation: 
http://[server_base]/$mark-all-resources-for-reindexing

This kicks off a process that might take a while depending on how big your database is. It's designed to reindex in small chunks in order to avoid hogging the server, so it goes for a while. Watch your server logs to see when it's done.

Cheers,
James


On Mon, Nov 14, 2016 at 7:06 PM, <al...@tyde.com> wrote:
Hi all

Just wondering how to recreate the Lucene index for HAPI? It appears that after maven clean, the index is wiped since it is stored in the target/ folder.

Cheers
Alvin

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.

James Agnew

unread,
Nov 14, 2016, 10:46:10 PM11/14/16
to Alvin Leonard, HAPI FHIR
Yeah, it should be. It also reindexes the database search tables and the terminology database so it's more than you need, but it should be regenerating Lucene indexes in the process.

Cheers,
James

To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.

To post to this group, send email to hapi...@googlegroups.com.

al...@tyde.com

unread,
Nov 14, 2016, 10:48:17 PM11/14/16
to HAPI FHIR, al...@tyde.com
Ah right! So basically it recreates the entity indexes in the database which in turn triggers the recreation of the Lucene indexes as it listens to Inserts and Updates. Sweet. Just what I need. 

Cheers
Alvin
Reply all
Reply to author
Forward
0 new messages