You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Benson Margulies <be...@basistech.com> on 2012/08/29 16:29:52 UTC

Using a char filter in solr createComponents

I'm close to the bottom of my list here.

I've got an Analyzer that, in 3.1, set up a CharFilter in the tokenStream
method. So now I have to migrate that to createComponents. Can someone give
me a shove in the right direction?

Re: Using a char filter in solr createComponents

Posted by Robert Muir <rc...@gmail.com>.
http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/analysis/package.html?r1=1378591&r2=1378590&pathrev=1378591

On Wed, Aug 29, 2012 at 10:35 AM, Robert Muir <rc...@gmail.com> wrote:
> sure. you need to wrap the reader in Analyzer.initReader() to do this:
>
>   /**
>    * Override this if you want to add a CharFilter chain.
>    */
>   protected Reader initReader(String fieldName, Reader reader) {
>     return reader;
>   }
>
> by default it returns the original Reader unchanged.
>
> There are examples in the analysis package javadocs
> (https://builds.apache.org/job/Lucene-Artifacts-4.x/javadoc/core/org/apache/lucene/analysis/package-summary.html#package_description),
> but we don't yet have one that uses a CharFilter. I'll see if i can
> add one.
>
> On Wed, Aug 29, 2012 at 10:29 AM, Benson Margulies <be...@basistech.com> wrote:
>> I'm close to the bottom of my list here.
>>
>> I've got an Analyzer that, in 3.1, set up a CharFilter in the tokenStream
>> method. So now I have to migrate that to createComponents. Can someone give
>> me a shove in the right direction?
>
>
>
> --
> lucidworks.com



-- 
lucidworks.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Using a char filter in solr createComponents

Posted by Robert Muir <rc...@gmail.com>.
sure. you need to wrap the reader in Analyzer.initReader() to do this:

  /**
   * Override this if you want to add a CharFilter chain.
   */
  protected Reader initReader(String fieldName, Reader reader) {
    return reader;
  }

by default it returns the original Reader unchanged.

There are examples in the analysis package javadocs
(https://builds.apache.org/job/Lucene-Artifacts-4.x/javadoc/core/org/apache/lucene/analysis/package-summary.html#package_description),
but we don't yet have one that uses a CharFilter. I'll see if i can
add one.

On Wed, Aug 29, 2012 at 10:29 AM, Benson Margulies <be...@basistech.com> wrote:
> I'm close to the bottom of my list here.
>
> I've got an Analyzer that, in 3.1, set up a CharFilter in the tokenStream
> method. So now I have to migrate that to createComponents. Can someone give
> me a shove in the right direction?



-- 
lucidworks.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org