Skip to content

Commit

Permalink
Add the missing classic, simple, and stop analyzers from the Lu…
Browse files Browse the repository at this point in the history
…cene fulltext analyzer suite, to the list of available analyzers.
  • Loading branch information
chrisvest committed Dec 21, 2018
1 parent a578e93 commit 37510e6
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2002-2018 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.api.impl.fulltext.analyzer.providers;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.ClassicAnalyzer;

import org.neo4j.graphdb.index.fulltext.AnalyzerProvider;
import org.neo4j.helpers.Service;

@Service.Implementation( AnalyzerProvider.class )
public class Classic extends AnalyzerProvider
{
public Classic()
{
super( "classic" );
}

@Override
public Analyzer createAnalyzer()
{
return new ClassicAnalyzer();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2002-2018 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.api.impl.fulltext.analyzer.providers;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.core.SimpleAnalyzer;

import org.neo4j.graphdb.index.fulltext.AnalyzerProvider;
import org.neo4j.helpers.Service;

@Service.Implementation( AnalyzerProvider.class )
public class Simple extends AnalyzerProvider
{
public Simple()
{
super( "simple" );
}

@Override
public Analyzer createAnalyzer()
{
return new SimpleAnalyzer();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2002-2018 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.api.impl.fulltext.analyzer.providers;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.core.StopAnalyzer;

import org.neo4j.graphdb.index.fulltext.AnalyzerProvider;
import org.neo4j.helpers.Service;

@Service.Implementation( AnalyzerProvider.class )
public class Stop extends AnalyzerProvider
{
public Stop()
{
super( "stop" );
}

@Override
public Analyzer createAnalyzer()
{
return new StopAnalyzer();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ org.neo4j.kernel.api.impl.fulltext.analyzer.providers.Thai
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.Turkish
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.UnicodeWhitespace
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.UrlOrEmail
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.Whitespace
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.Whitespace
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.Classic
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.Simple
org.neo4j.kernel.api.impl.fulltext.analyzer.providers.Stop

0 comments on commit 37510e6

Please sign in to comment.