[ 
https://issues.apache.org/jira/browse/LUCENE-6177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uwe Schindler updated LUCENE-6177:
----------------------------------
    Description: 
I prepared some "generic Analyzer class {{CustomAnalyzer}}, that makes it easy 
to build analyzers like in Solr or Elasticsearch. Under the hood it uses the 
factory classes. The class is made like a builder:

{code:java}
Analyzer ana = CustomAnalyzer.builder(Path.get("/path/to/config/dir"))
  .withTokenizer("standard")
  .addTokenFilter("standard")
  .addTokenFilter("lowercase")
  .addTokenFilter("stop", "ignoreCase", "false", "words", "stopwords.txt", 
"format", "wordset")
  .build();
{code}

It is possible to give the resource loader (used by stopwords and similar). By 
default it tries to load stuff from context classloader (without any class as 
reference so paths must be absolute - this is the behaviour 
ClasspathResourseLoader defaults to).

In addition you can give a Lucene MatchVersion, by default it would use 
Version.LATEST (once LUCENE-5900 is completely fixed).

  was:
I prepared some "generic Analyzer class {{CustomAnalyzer}}, that makes it easy 
to build analyzers like in Solr or Elasticsearch. Under the hood it uses the 
factory classes. The class is made like a builder:

{code:java}
Analyzer ana = CustomAnalyzer.builder(Path.get("/path/to/config/dir"))
  .withTokenizer("standard", key1, value1, key2, value2)
  .addTokenFilter("standard")
  .addTokenFilter("lowercase").
  .addTokenFilter("stop", "ignoreCase", "true", "words", "stopwords.txt", 
"format", "wordset")
  .build();
{code}

It is possible to give the resource loader (used by stopwords and similar). By 
default it tries to load stuff from context classloader (without any class as 
reference so paths must be absolute - this is the behaviour 
ClasspathResourseLoader defaults to).

In addition you can give a Lucene MatchVersion, by default it would use 
Version.LATEST (once LUCENE-5900 is completely fixed).


> Add CustomAnalyzer - a builder that creates Analyzers from the factory classes
> ------------------------------------------------------------------------------
>
>                 Key: LUCENE-6177
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6177
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: modules/analysis
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 5.0, Trunk
>
>
> I prepared some "generic Analyzer class {{CustomAnalyzer}}, that makes it 
> easy to build analyzers like in Solr or Elasticsearch. Under the hood it uses 
> the factory classes. The class is made like a builder:
> {code:java}
> Analyzer ana = CustomAnalyzer.builder(Path.get("/path/to/config/dir"))
>   .withTokenizer("standard")
>   .addTokenFilter("standard")
>   .addTokenFilter("lowercase")
>   .addTokenFilter("stop", "ignoreCase", "false", "words", "stopwords.txt", 
> "format", "wordset")
>   .build();
> {code}
> It is possible to give the resource loader (used by stopwords and similar). 
> By default it tries to load stuff from context classloader (without any class 
> as reference so paths must be absolute - this is the behaviour 
> ClasspathResourseLoader defaults to).
> In addition you can give a Lucene MatchVersion, by default it would use 
> Version.LATEST (once LUCENE-5900 is completely fixed).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to