Skip to Content
0
Former Member
Mar 31, 2015 at 02:41 PM

index get removed after running full index operation

406 Views

Hello, I am currently working on migrating 4.8 to 5.5. In 5.5, when we do solr indexing, if we run Full Indexer Operation then indexes get deleted at the end of process. I can see in the logs that indexing is correctly happening but in the end when I check solr console, document count seems to be 0. Instead of Full, if I run Update Indexer configuration then it seems to work fine & index get persisted in solr. When I digged into code, I found that below lines from FullDirectIndexOperationStrategy are the culprit:-

public void afterIndex(final IndexerContext context) throws IndexerException

 {  

     final String removeQuery = "-indexOperationId_long:[" + context.getIndexOperationId() + " TO *]";  

     this.indexer.removeItemsByQuery(context.getFacetSearchConfig(), context.getIndexedType(), context.getIndex(), removeQuery);  


i extended FullDirectIndexOperationStrategy & overrode afterIndex method by commenting above 2 lines, then Full operation works fine. So can any one help me to understand significance of above 2 lines in FullDirectIndexOperationStrategy?

Thanks