Gptext create_index command fails with the following error:
db_name=# select gptext.create_index('web', 'insight_reportdatagptext', 'recordid', 'r_value');
WARNING: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://PLVSDWGPD102:18987/solr: Error CREATEing SolrCore 'nisp_db.web.insight_reportdatagptext_shard34_replica1': Unable to create core [nisp_db.web.insight_reportdatagptext_shard34_replica1] Caused by: no segments* file found in LockValidatingDirectoryWrapper(NIOFSDirectory@/data2/primary/solr0/data/nisp_db.web.insight_reportdatagptext_shard34_replica1/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@5160a841): files: [write.lock]. (AdminUDF.cpp:347)
CONTEXT: SQL statement "SELECT gptext.__create_index_impl( $1 , $2 , $3 , $4 , $5 )"
PL/pgSQL function "__create_index" line 185 at SQL statement
WARNING: Could not find collection : nisp_db.web.insight_reportdatagptext. (AdminUDF.cpp:371)
CONTEXT: SQL statement "SELECT gptext.__drop_index_impl( $1 , $2 )"
PL/pgSQL function "__create_index" line 227 at SQL statement
WARNING: Drop index failed. Maybe manually drop later is required.
ERROR: Create index operation failed.
db_name=#
db_name=# \d web.insight_reportdatagptext
Table "web.insight_reportdatagptext"
Column | Type | Modifiers
------------------+-------------------+-----------
recordid | bigint |
reportid | character varying |
r_type | character varying |
r_value | character varying |
score_multiplier | integer |
Distributed randomly
db_name=# select count(1) from web.insight_reportdatagptext;
count
-------
1609
(1 row)
The issue was caused by either file corruption or abnormal operations taking place.
The fix would be to recreate the data directory under each solr* directory, followed by gptext restart.