@@ -993,12 +993,25 @@ private void prepareLuceneIndex(Logger log) throws PipelineJobException
993993 return ;
994994 }
995995
996+ File indexDir = getExpectedLocationOfLuceneIndex (false );
997+ if (indexDir != null && indexDir .exists ())
998+ {
999+ try
1000+ {
1001+ FileUtils .deleteDirectory (getExpectedLocationOfLuceneIndex (false ));
1002+ }
1003+ catch (IOException e )
1004+ {
1005+ throw new PipelineJobException (e );
1006+ }
1007+ }
1008+
9961009 List <String > args = runner .getBaseArgs ("VcfToLuceneIndexer" );
9971010 args .add ("-V" );
9981011 args .add (getExpData ().getFile ().getPath ());
9991012
10001013 args .add ("-O" );
1001- args .add (getExpectedLocationOfLuceneIndex ( false ) .getPath ());
1014+ args .add (indexDir .getPath ());
10021015
10031016 List <String > infoFieldsForFullTextSearch = getInfoFieldsToIndex ();
10041017 for (String field : infoFieldsForFullTextSearch )
@@ -1009,6 +1022,9 @@ private void prepareLuceneIndex(Logger log) throws PipelineJobException
10091022
10101023 args .add ("--allow-missing-fields" );
10111024
1025+ args .add ("--index-stats" );
1026+ args .add (getExpectedLocationOfLuceneIndexStats (false ).getPath ());
1027+
10121028 JSONObject config = getExtraTrackConfig ();
10131029 if (config != null && !config .isNull ("lenientLuceneProcessing" ) && config .getBoolean ("lenientLuceneProcessing" ))
10141030 {
@@ -1351,6 +1367,11 @@ public boolean shouldHaveFreeTextSearch()
13511367 return json != null && json .optBoolean ("createFullTextIndex" , false );
13521368 }
13531369
1370+ public File getExpectedLocationOfLuceneIndexStats (boolean throwIfNotFound )
1371+ {
1372+ return new File (getExpectedLocationOfLuceneIndexStats (throwIfNotFound ).getPath () + ".stats.txt" );
1373+ }
1374+
13541375 public File getExpectedLocationOfLuceneIndex (boolean throwIfNotFound )
13551376 {
13561377 File basedir = getLocationOfProcessedTrack (false );
0 commit comments