1.16.3.2.3. Creating the search index

Now, we have the analyzer, we have to write the SearchIndex, which will use the analyzer. Your have to extends org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex. You have to write the constructor, to set the right analyzer, and the method

public Analyzer getAnalyzer() {

    return MyAnalyzer;
  }

to return your analyzer. You can see the attached SearchIndex.

Note

Since 1.12 version, we can set Analyzer directly in configuration. So, creation new SearchIndex only for new Analyzer is redundant.

Copyright ©2012. All rights reserved. eXo Platform SAS