Giter VIP home page Giter VIP logo

ik-analyzer-solr6's Introduction

Introduction

Realize the dynamic load of thesaurus and don't need to restart the service can achieve dynamic update thesaurus immediate effect, the project home is https://github.com/liang68/solr-repositories.git

Feature

  • based on IK Analyer 2012-FF Hotfix 1
  • added support for Lucene 6.3.0 API

#Installation #

  • JDK8

mvn clean install

Configuration

solrconfig.xml

Add ik-analyzer-solr-6.3.0.jar   
<lib dir="/home/solr/solr/dist/" regex="ik-analyzer-solr-\d.*\.jar" />

schema.xml

Add custom extensions class IKTokenizerFactory and use it(contains extended thesaurus dynamic loading)
<fieldType name="text_ik" class="solr.TextField">   
  <analyzer type="index">
    <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="false" conf="ik.conf" />
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  </analyzer>
  <analyzer type="query">
    <tokenizer class="org.wltea.analyzer.lucene.IKTokenizerFactory" useSmart="true" conf="ik.conf" />
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
  </analyzer>
</fieldType>

or

The default load IK thesaurus
<fieldType name="text_ik" class="solr.TextField">   
  <analyzer type="index" useSmart="false" class="org.wltea.analyzer.lucene.IKAnalyzer"/>   
  <analyzer type="query" useSmart="true" class="org.wltea.analyzer.lucene.IKAnalyzer"/>   
</fieldType>

Compilation Error

  1. Question: The following error happened while running "mvn clean install"

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project ik-analyzer-solr5: Fatal error compiling: invalid target release: 1.8 -> [Help 1]

Answer: Please check your JAVA_HOME setting. If JAVA_HOME setting exists, it may not be JAVA8.

Resources

  1. Build IKAnalyzer With Solr 6.3.0
  2. New way of remote calls automatically update thesaurus interval

Summary

Two kinds of method for automatic dynamic loading dictionary

    1. Configure the local external thesaurus update by a scalar
    1. By configuring the remote file to update thesaurus (All the back of the class with the suffix Remote is corresponding to the realization of the way)

更加详尽解释请查我的博客:http://www.cnblogs.com/liang1101/articles/6395016.html

ik-analyzer-solr6's People

Watchers

James Cloos avatar chen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.