Hi Folks,

I have a custom filter which does everything I need it to but it has reduced my 
indexing speed to a crawl. Are there any methods I need to call to clear / 
clean things up once my script (details below) has done it's work?

Thanks,

Luke

  public LCCNormalizeFilter(TokenStream input)
    {
        super(input);
        this.charTermAttr = addAttribute(CharTermAttribute.class);
    }
  
    public boolean incrementToken() throws IOException {
        
        if (!input.incrementToken()) {
            return false;
        }

        char[] buffer = charTermAttr.buffer();
        String rawLCcallnum = new String(buffer);
        String normalizedLCcallnum = getLCShelfkey(rawLCcallnum);
        char[] newBuffer = normalizedLCcallnum.toCharArray();
        charTermAttr.setEmpty();
        charTermAttr.copyBuffer(newBuffer, 0, newBuffer.length);
        return true;
    }

Reply via email to