Can I modify analysis setting of an exist index?


(昕玫) #1

I want to edit analyzer setting of an exist index to add a lowercase filter, should I rebuild the index? or there is someway easier.

thx~


(Nik Everett) #2

For now there is nothing easier. You do a scroll query that hits all the documents and then re-add them to another index with the analysis setup the way you want so you don't have to rebuild from your source application - but only do that if your source application is slower.

If you don't have a source application - like if you are doing logging data or something, the normal practice is to add the change in analysis to the template for creating the next day/week/month's index and just live with the difference until your data retention period has you deleting the old indexes.


(Janusz Lembicz) #3

While I understand why modifying existing analyzers doesn't make sense, I'm curious why adding new ones requires closing and opening the index. I've skimmed through the code and couldn't find the answer. I suspected that maybe Lucene requires all analyzers to be defined when the IndexWriter is being instantiated but it's not the case. I'd appreciate any help with this :slight_smile:


(Ivan Brusic) #4

It might have to do with the way analyzers are registered:

Ivan


(system) #5