This commit is contained in:
parent
664c9c2062
commit
91d000642f
Binary file not shown.
|
Before Width: | Height: | Size: 978 B |
|
|
@ -1,23 +0,0 @@
|
|||
<div class="bt-form">
|
||||
<div class="bt-w-main">
|
||||
<div class="bt-w-menu">
|
||||
<p class="bgw" onclick="pluginService('solr');">服务</p>
|
||||
<p onclick="pluginInitD('solr');">自启动</p>
|
||||
<p onclick="collectionManagement();">管理</p>
|
||||
<p onclick="pluginLogs('solr','','run_log');">日志</p>
|
||||
<p onclick="pluginConfig('solr','','script_full');">全量分页脚本</p>
|
||||
<p onclick="pluginConfig('solr','','script_incr');">增量更新脚本</p>
|
||||
<p onclick="pRead()">说明</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
resetPluginWinWidth(700);
|
||||
$.getScript( "/plugins/file?name=solr&f=js/solr.js", function() {
|
||||
pluginService('solr');
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,345 +0,0 @@
|
|||
# coding: utf-8
|
||||
|
||||
import time
|
||||
import random
|
||||
import os
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
|
||||
app_debug = False
|
||||
if mw.isAppleSystem():
|
||||
app_debug = True
|
||||
|
||||
|
||||
def getPluginName():
|
||||
return 'solr'
|
||||
|
||||
|
||||
def getPluginDir():
|
||||
return mw.getPluginDir() + '/' + getPluginName()
|
||||
|
||||
|
||||
def getServerDir():
|
||||
return mw.getServerDir() + '/' + getPluginName()
|
||||
|
||||
|
||||
def getInitDFile():
|
||||
if app_debug:
|
||||
return '/tmp/' + getPluginName()
|
||||
return '/etc/init.d/' + getPluginName()
|
||||
|
||||
|
||||
def getInitDTpl():
|
||||
return getPluginDir() + "/init.d/" + getPluginName() + ".tpl"
|
||||
|
||||
|
||||
def getLog():
|
||||
return getServerDir() + "/server/logs/solr.log"
|
||||
|
||||
|
||||
def getArgs():
|
||||
args = sys.argv[2:]
|
||||
tmp = {}
|
||||
args_len = len(args)
|
||||
|
||||
if args_len == 1:
|
||||
t = args[0].strip('{').strip('}')
|
||||
t = t.split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
elif args_len > 1:
|
||||
for i in range(len(args)):
|
||||
t = args[i].split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
|
||||
return tmp
|
||||
|
||||
|
||||
def checkArgs(data, ck=[]):
|
||||
for i in range(len(ck)):
|
||||
if not ck[i] in data:
|
||||
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
|
||||
return (True, mw.returnJson(True, 'ok'))
|
||||
|
||||
|
||||
def status():
|
||||
pn = getPluginName()
|
||||
data = mw.execShell(
|
||||
"ps -ef|grep " + pn + " |grep -v grep | grep -v python | awk '{print $2}'")
|
||||
if data[0] == '':
|
||||
return 'stop'
|
||||
return 'start'
|
||||
|
||||
|
||||
def initDreplace():
|
||||
|
||||
file_tpl = getInitDTpl()
|
||||
service_path = os.path.dirname(os.getcwd())
|
||||
|
||||
initD_path = getServerDir() + '/init.d'
|
||||
if not os.path.exists(initD_path):
|
||||
os.mkdir(initD_path)
|
||||
|
||||
user = 'solr'
|
||||
if mw.isAppleSystem():
|
||||
user = mw.execShell(
|
||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
|
||||
file_bin = initD_path + '/' + getPluginName()
|
||||
if not os.path.exists(file_bin):
|
||||
content = mw.readFile(file_tpl)
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = content.replace('{$RUN_USER}', user)
|
||||
mw.writeFile(file_bin, content)
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
|
||||
file_py = initD_path + '/' + getPluginName() + '.py'
|
||||
if not os.path.exists(file_py):
|
||||
content = mw.readFile(getPluginDir() + '/script/full.py')
|
||||
mw.writeFile(file_py, content)
|
||||
mw.execShell('chmod +x ' + file_py)
|
||||
|
||||
file_incr_py = initD_path + '/' + getPluginName() + '_incr.py'
|
||||
if not os.path.exists(file_incr_py):
|
||||
content = mw.readFile(getPluginDir() + '/script/incr.py')
|
||||
mw.writeFile(file_incr_py, content)
|
||||
mw.execShell('chmod +x ' + file_incr_py)
|
||||
|
||||
# realm.properties
|
||||
rp_path = getServerDir() + "/server/etc/realm.properties"
|
||||
rp_path_tpl = getPluginDir() + "/tpl/realm.properties"
|
||||
|
||||
# if not os.path.exists(rp_path):
|
||||
content = mw.readFile(rp_path_tpl)
|
||||
mw.writeFile(rp_path, content)
|
||||
|
||||
# web.xml
|
||||
web_xml = getServerDir() + "/server/solr-webapp/webapp/WEB-INF/web.xml"
|
||||
web_xml_tpl = getPluginDir() + "/tpl/web.xml"
|
||||
content = mw.readFile(web_xml_tpl)
|
||||
mw.writeFile(web_xml, content)
|
||||
|
||||
# solr-jetty-context.xml
|
||||
solr_jetty_context_xml = getServerDir() + "/server/contexts/solr-jetty-context.xml"
|
||||
solr_jetty_context_xml_tpl = getPluginDir() + "/tpl/solr-jetty-context.xml"
|
||||
content = mw.readFile(solr_jetty_context_xml_tpl)
|
||||
mw.writeFile(solr_jetty_context_xml, content)
|
||||
|
||||
log_file = getLog()
|
||||
if os.path.exists(log_file):
|
||||
mw.writeFile(log_file, '')
|
||||
|
||||
if not mw.isAppleSystem():
|
||||
mw.execShell('chown -R solr:solr ' + getServerDir())
|
||||
|
||||
return file_bin
|
||||
|
||||
|
||||
def runShell(shell):
|
||||
if mw.isAppleSystem():
|
||||
data = mw.execShell(shell)
|
||||
else:
|
||||
data = mw.execShell('su - solr -c "/bin/bash ' + shell + '"')
|
||||
return data
|
||||
|
||||
|
||||
def start():
|
||||
file = initDreplace()
|
||||
data = runShell(file + ' start')
|
||||
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
|
||||
def stop():
|
||||
file = initDreplace()
|
||||
data = runShell(file + ' stop')
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
|
||||
def restart():
|
||||
file = initDreplace()
|
||||
data = runShell(file + ' restart')
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
|
||||
def reload():
|
||||
file = initDreplace()
|
||||
data = runShell(file + ' reload')
|
||||
|
||||
solr_log = getServerDir() + "/server/logs/solr.log"
|
||||
mw.writeFile(solr_log, "")
|
||||
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
|
||||
def initdStatus():
|
||||
initd_bin = getInitDFile()
|
||||
if os.path.exists(initd_bin):
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
|
||||
def initdInstall():
|
||||
import shutil
|
||||
|
||||
source_bin = initDreplace()
|
||||
initd_bin = getInitDFile()
|
||||
shutil.copyfile(source_bin, initd_bin)
|
||||
mw.execShell('chmod +x ' + initd_bin)
|
||||
|
||||
if not app_debug:
|
||||
mw.execShell('chkconfig --add ' + getPluginName())
|
||||
return 'ok'
|
||||
|
||||
|
||||
def initdUinstall():
|
||||
if not app_debug:
|
||||
mw.execShell('chkconfig --del ' + getPluginName())
|
||||
|
||||
initd_bin = getInitDFile()
|
||||
|
||||
if os.path.exists(initd_bin):
|
||||
os.remove(initd_bin)
|
||||
return 'ok'
|
||||
|
||||
|
||||
def collectionList():
|
||||
path = getServerDir() + '/server/solr'
|
||||
listDir = os.listdir(path)
|
||||
data = {}
|
||||
dlist = []
|
||||
for dirname in listDir:
|
||||
dirpath = path + '/' + dirname
|
||||
if not os.path.isdir(dirpath):
|
||||
continue
|
||||
if dirname == 'configsets':
|
||||
continue
|
||||
|
||||
tmp = {}
|
||||
tmp['name'] = dirname
|
||||
dlist.append(tmp)
|
||||
data['list'] = dlist
|
||||
data['ip'] = mw.getLocalIp()
|
||||
data['port'] = '8983'
|
||||
|
||||
content = mw.readFile(path + '/solr.xml')
|
||||
|
||||
rep = "jetty.port:(.*)\}</int>"
|
||||
tmp = re.search(rep, content)
|
||||
port = tmp.groups()[0]
|
||||
data['port'] = port
|
||||
|
||||
return mw.returnJson(True, 'OK', data)
|
||||
|
||||
|
||||
def addCollection():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['name'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
name = args['name']
|
||||
solr_bin = getServerDir() + "/bin/solr"
|
||||
|
||||
retdata = runShell(solr_bin + ' create -c ' + name)
|
||||
if retdata[1] != "":
|
||||
return mw.returnJson(False, '添加失败!:' + retdata[1])
|
||||
|
||||
sc_path = getServerDir() + "/server/solr/" + name + "/conf/solrconfig.xml"
|
||||
sc_path_tpl = getPluginDir() + "/tpl/solrconfig.xml"
|
||||
content = mw.readFile(sc_path_tpl)
|
||||
mw.writeFile(sc_path, content)
|
||||
|
||||
sd_path = getServerDir() + "/server/solr/" + name + "/conf/db-data-config.xml"
|
||||
sd_path_tpl = getPluginDir() + "/tpl/db-data-config.xml"
|
||||
content = mw.readFile(sd_path_tpl)
|
||||
mw.writeFile(sd_path, content)
|
||||
|
||||
sd_path = getServerDir() + "/server/solr/" + name + "/conf/managed-schema"
|
||||
sd_path_tpl = getPluginDir() + "/tpl/managed-schema"
|
||||
content = mw.readFile(sd_path_tpl)
|
||||
mw.writeFile(sd_path, content)
|
||||
|
||||
return mw.returnJson(True, '添加成功!:' + retdata[0])
|
||||
|
||||
|
||||
def removeCollection():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['name'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
name = args['name']
|
||||
solr_bin = getServerDir() + "/bin/solr"
|
||||
|
||||
retdata = runShell(solr_bin + ' delete -c ' + name)
|
||||
if retdata[1] != "":
|
||||
return mw.returnJson(False, '删除失败!:' + retdata[1])
|
||||
return mw.returnJson(True, '删除成功!:' + retdata[0])
|
||||
|
||||
|
||||
def confFileCollection():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['name'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
conf_file = getServerDir() + "/server/solr/" + \
|
||||
args['name'] + "/conf/" + args['conf_file']
|
||||
# print conf_file
|
||||
return mw.returnJson(True, 'OK', {'path': conf_file})
|
||||
|
||||
|
||||
def scriptFull():
|
||||
return getServerDir() + "/init.d/solr.py"
|
||||
|
||||
|
||||
def scriptIncr():
|
||||
return getServerDir() + "/init.d/solr_incr.py"
|
||||
|
||||
# rsyncdReceive
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
print(status())
|
||||
elif func == 'start':
|
||||
print(start())
|
||||
elif func == 'stop':
|
||||
print(stop())
|
||||
elif func == 'restart':
|
||||
print(restart())
|
||||
elif func == 'reload':
|
||||
print(reload())
|
||||
elif func == 'initd_status':
|
||||
print(initdStatus())
|
||||
elif func == 'initd_install':
|
||||
print(initdInstall())
|
||||
elif func == 'initd_uninstall':
|
||||
print(initdUinstall())
|
||||
elif func == 'run_log':
|
||||
print(getLog())
|
||||
elif func == 'collection_list':
|
||||
print(collectionList())
|
||||
elif func == 'add_collection':
|
||||
print(addCollection())
|
||||
elif func == 'remove_collection':
|
||||
print(removeCollection())
|
||||
elif func == 'conf_file_collection':
|
||||
print(confFileCollection())
|
||||
elif func == 'script_full':
|
||||
print(scriptFull())
|
||||
elif func == 'script_incr':
|
||||
print(scriptIncr())
|
||||
else:
|
||||
print('error')
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"id":10,
|
||||
"title":"Solr",
|
||||
"tip":"soft",
|
||||
"name":"solr",
|
||||
"type":"软件",
|
||||
"ps":"一个独立的企业级搜索应用服务器",
|
||||
"versions":"6.3.0",
|
||||
"shell":"install.sh",
|
||||
"checks":"server/solr",
|
||||
"path": "server/solr",
|
||||
"author":"midoks",
|
||||
"home":"https://lucene.apache.org/solr/",
|
||||
"date":"2019-08-01",
|
||||
"pid":"2"
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: solr
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Description: Controls Apache Solr as a Service
|
||||
### END INIT INFO
|
||||
|
||||
# Example of a very simple *nix init script that delegates commands to the bin/solr script
|
||||
# Typical usage is to do:
|
||||
#
|
||||
# cp bin/init.d/solr /etc/init.d/solr
|
||||
# chmod 755 /etc/init.d/solr
|
||||
# chown root:root /etc/init.d/solr
|
||||
# update-rc.d solr defaults
|
||||
# update-rc.d solr enable
|
||||
|
||||
# Where you extracted the Solr distribution bundle
|
||||
SOLR_INSTALL_DIR="{$SERVER_PATH}/solr"
|
||||
|
||||
if [ ! -d "$SOLR_INSTALL_DIR" ]; then
|
||||
echo "$SOLR_INSTALL_DIR not found! Please check the SOLR_INSTALL_DIR setting in your $0 script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Path to an include file that defines environment specific settings to override default
|
||||
# variables used by the bin/solr script. It's highly recommended to define this script so
|
||||
# that you can keep the Solr binary files separated from live files (pid, logs, index data, etc)
|
||||
# see bin/solr.in.sh for an example
|
||||
SOLR_ENV="{$SERVER_PATH}/solr/bin/solr.in.sh"
|
||||
|
||||
if [ ! -f "$SOLR_ENV" ]; then
|
||||
echo "$SOLR_ENV not found! Please check the SOLR_ENV setting in your $0 script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Specify the user to run Solr as; if not set, then Solr will run as root.
|
||||
# Running Solr as root is not recommended for production environments
|
||||
RUNAS="{$RUN_USER}"
|
||||
|
||||
# verify the specified run as user exists
|
||||
runas_uid="`id -u "$RUNAS"`"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "User $RUNAS not found! Please create the $RUNAS user before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|status)
|
||||
SOLR_CMD="$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status}"
|
||||
exit
|
||||
esac
|
||||
|
||||
if [ -n "$RUNAS" ]; then
|
||||
su - "$RUNAS" -c "SOLR_INCLUDE=\"$SOLR_ENV\" \"$SOLR_INSTALL_DIR/bin/solr\" $SOLR_CMD"
|
||||
else
|
||||
SOLR_INCLUDE="$SOLR_ENV" "$SOLR_INSTALL_DIR/bin/solr" "$SOLR_CMD"
|
||||
fi
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sysName=`uname`
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
sysName=`uname`
|
||||
echo "use system: ${sysName}"
|
||||
|
||||
if [ ${sysName} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||
OSNAME='raspbian'
|
||||
else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
CheckJAVA()
|
||||
{
|
||||
which java > /dev/null
|
||||
if [ $? -eq 0 ];then
|
||||
echo 'java is exist'
|
||||
else
|
||||
echo 'java install...'
|
||||
if [ "centos" == "$OSNAME" ] || [ "fedora" == "$OSNAME" ];then
|
||||
yum install -y java
|
||||
elif [ "ubuntu" == "$OSNAME" ] || [ "debian" == "$OSNAME" ] ;then
|
||||
snap install openjdk
|
||||
else
|
||||
yum install -y java
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
if id solr &> /dev/null ;then
|
||||
echo "solr UID is `id -u solr`"
|
||||
echo "solr Shell is `grep "^solr:" /etc/passwd |cut -d':' -f7 `"
|
||||
else
|
||||
if [ "$OSNAME" == "macos" ];then
|
||||
echo "mac ..."
|
||||
echo "groupadd solr"
|
||||
echo "useradd -g solr -s /bin/bash solr"
|
||||
else
|
||||
groupadd solr
|
||||
useradd -g solr -s /bin/bash solr
|
||||
fi
|
||||
fi
|
||||
|
||||
action=$1
|
||||
version=$2
|
||||
Install_solr()
|
||||
{
|
||||
CheckJAVA
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
mkdir -p $serverPath/solr
|
||||
SOLR_DIR=${serverPath}/source/solr
|
||||
mkdir -p $SOLR_DIR
|
||||
if [ ! -f ${SOLR_DIR}/solr-${version}.tgz ];then
|
||||
wget -O ${SOLR_DIR}/solr-${version}.tgz https://archive.apache.org/dist/lucene/solr/${version}/solr-${version}.tgz
|
||||
fi
|
||||
|
||||
mmseg_version=2.4.0
|
||||
if [ ! -f ${SOLR_DIR}/mmseg4j-${mmseg_version}.zip ];then
|
||||
wget -O ${SOLR_DIR}/mmseg4j-${mmseg_version}.zip https://github.com/midoks/mdserver-web/releases/download/init/mmseg4j-${mmseg_version}.zip
|
||||
fi
|
||||
|
||||
if [ ! -d ${SOLR_DIR}/mmseg4j-${mmseg_version} ];then
|
||||
cd ${SOLR_DIR}/ && unzip mmseg4j-${mmseg_version}.zip
|
||||
fi
|
||||
|
||||
if [ ! -f ${SOLR_DIR}/mysql-connector-java-5.1.48.jar ];then
|
||||
wget -O ${SOLR_DIR}/mysql-connector-java-5.1.48.jar http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.48/mysql-connector-java-5.1.48.jar
|
||||
fi
|
||||
|
||||
if [ ! -f ${SOLR_DIR}/mysql-connector-java-8.0.17.jar ];then
|
||||
wget -O ${SOLR_DIR}/mysql-connector-java-8.0.17.jar http://central.maven.org/maven2/mysql/mysql-connector-java/8.0.17/mysql-connector-java-8.0.17.jar
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/solr/bin ];then
|
||||
cd ${SOLR_DIR} && tar -zxvf solr-${version}.tgz
|
||||
cp -rf ${SOLR_DIR}/solr-${version}/* $serverPath/solr/
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
echo "mac ... chown -R solr:solr $serverPath/solr"
|
||||
else
|
||||
chown -R solr:solr $serverPath/solr
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ -d $serverPath/solr/dist ]; then
|
||||
|
||||
if [ -f ${SOLR_DIR}/mysql-connector-java-5.1.48.jar ];then
|
||||
cp -rf ${SOLR_DIR}/mysql-connector-java-5.1.48.jar $serverPath/solr/dist/
|
||||
fi
|
||||
|
||||
if [ -f ${SOLR_DIR}/mysql-connector-java-8.0.17.jar ];then
|
||||
cp -rf ${SOLR_DIR}/mysql-connector-java-8.0.17.jar $serverPath/solr/dist/
|
||||
fi
|
||||
|
||||
if [ ! -f $serverPath/solr/dist/mmseg4j-core-1.10.0.jar ];then
|
||||
cp -rf ${SOLR_DIR}/mmseg4j-2.4.0/mmseg4j-core-1.10.0.jar $serverPath/solr/dist/
|
||||
fi
|
||||
|
||||
if [ ! -f $serverPath/solr/dist/mmseg4j-solr-2.4.0.jar ];then
|
||||
cp -rf ${SOLR_DIR}/mmseg4j-2.4.0/mmseg4j-solr-2.4.0.jar $serverPath/solr/dist/
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$version" > $serverPath/solr/version.pl
|
||||
echo '安装完成' > $install_tmp
|
||||
|
||||
}
|
||||
|
||||
Uninstall_solr()
|
||||
{
|
||||
rm -rf $serverPath/solr
|
||||
echo "卸载完成" > $install_tmp
|
||||
}
|
||||
|
||||
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_solr $version
|
||||
else
|
||||
Uninstall_solr $version
|
||||
fi
|
||||
|
|
@ -1,196 +0,0 @@
|
|||
function str2Obj(str){
|
||||
var data = {};
|
||||
kv = str.split('&');
|
||||
for(i in kv){
|
||||
v = kv[i].split('=');
|
||||
data[v[0]] = v[1];
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function pPost(method,args,callback, title){
|
||||
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
_args = JSON.stringify(str2Obj(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
|
||||
var _title = '正在获取...';
|
||||
if (typeof(title) != 'undefined'){
|
||||
_title = title;
|
||||
}
|
||||
|
||||
var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 });
|
||||
$.post('/plugins/run', {name:'solr', func:method, args:_args}, function(data) {
|
||||
layer.close(loadT);
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof(callback) == 'function'){
|
||||
callback(data);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
|
||||
function collectionManagement(){
|
||||
pPost('collection_list', '', function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
var list = rdata.data.list;
|
||||
var con = '';
|
||||
con += '<div class="divtable" style="margin-top:5px;"><table class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0">';
|
||||
con += '<thead><tr>';
|
||||
con += '<th>collection</th>';
|
||||
con += '<th>操作(<a class="btlink" onclick="addCollection()">添加</a>)'+ '|'+ '<a class="btlink" target="_blank" href="http://'+rdata.data.ip+':'+rdata.data.port+'">WEB管理</a></th>';
|
||||
con += '</tr></thead>';
|
||||
|
||||
con += '<tbody>';
|
||||
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
con += '<tr>'+
|
||||
'<td>' + list[i]['name']+'</td>' +
|
||||
'<td>\
|
||||
<a class="btlink" onclick="cmdCollection(\''+list[i]['name']+'\')">命令</a> \
|
||||
| <a class="btlink" onclick="confCollection(\''+list[i]['name']+'\')">配置</a> \
|
||||
| <a class="btlink" onclick="removeCollection(\''+list[i]['name']+'\')">删除</a></td> \
|
||||
</tr>';
|
||||
}
|
||||
|
||||
con += '</tbody>';
|
||||
con += '</table></div>';
|
||||
|
||||
$(".soft-man-con").html(con);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function addCollection(){
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '添加Collection',
|
||||
area: '400px',
|
||||
content:"<div class='bt-form pd20 pb70 c6'>\
|
||||
<div class='line'>\
|
||||
<span class='tname'>Collection</span>\
|
||||
<div class='info-r c4'>\
|
||||
<input id='name' class='bt-input-text' type='text' name='name' placeholder='Collection' style='width:200px' />\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button type='button' id='add_ok' class='btn btn-success btn-sm btn-title bi-btn'>确认</button>\
|
||||
</div>\
|
||||
</div>",
|
||||
});
|
||||
|
||||
$('#add_ok').click(function(){
|
||||
_data = {};
|
||||
_data['name'] = $('#name').val();
|
||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||
pPost('add_collection', _data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.close(loadOpen);
|
||||
layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']});
|
||||
setTimeout(function(){collectionManagement();},2000);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function removeCollection(name){
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '删除用户',
|
||||
area: '350px',
|
||||
content:"<div class='bt-form pd20 pb70 c6'>\
|
||||
<div class='version line'>你要确认要删除collection["+ name + "]</div>\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button type='button' id='solr_del_close' class='btn btn-danger btn-sm btn-title'>关闭</button>\
|
||||
<button type='button' id='solr_del_ok' class='btn btn-success btn-sm btn-title bi-btn'>确认</button>\
|
||||
</div>\
|
||||
</div>"
|
||||
});
|
||||
|
||||
$('#solr_del_close').click(function(){
|
||||
layer.close(loadOpen);
|
||||
});
|
||||
|
||||
$('#solr_del_ok').click(function(){
|
||||
var _data = {};
|
||||
_data['name'] = name;
|
||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||
|
||||
_data = {};
|
||||
_data['name'] = name;
|
||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||
pPost('remove_collection', _data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.close(loadOpen);
|
||||
layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']});
|
||||
setTimeout(function(){collectionManagement();},2000);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function confCollection(name){
|
||||
var html = '';
|
||||
html += '<button onclick="confFileCollection(\''+name+'\',\'solrconfig.xml\')" class="btn btn-default btn-sm">solrconfig.xml</button>';
|
||||
html += '<button onclick="confFileCollection(\''+name+'\',\'managed-schema\')" class="btn btn-default btn-sm">managed-schema</button>';
|
||||
html += '<button onclick="confFileCollection(\''+name+'\',\'db-data-config.xml\')" class="btn btn-default btn-sm">db-data-config.xml</button>';
|
||||
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '['+name+']配置设置',
|
||||
area: '240px',
|
||||
content:'<div class="change-default pd20">'+html+'</div>'
|
||||
});
|
||||
}
|
||||
|
||||
function confFileCollection(name, conf_file){
|
||||
pPost('conf_file_collection', {'name':name, 'conf_file':conf_file}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata['status']){
|
||||
onlineEditFile(0, rdata['data']['path']);
|
||||
} else {
|
||||
layer.msg(rdata.msg,{icon:1,time:2000,shade: [0.3, '#000']});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function cmdCollection(name){
|
||||
var cmd = '<div class="change-default pd20"><table class="table table-hover">';
|
||||
cmd += '<thead><tr><td>增量更新</td><td>curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=delta-import&wt=json&clean=false&commit=true"</td></tr>';
|
||||
cmd += '<tr><td>全量更新</td><td>curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true"<td></tr>';
|
||||
cmd += '<tr><td>全量分页更新[计划任务]</td><td>python /www/server/solr/init.d/solr.py<td></tr>';
|
||||
cmd += '<tr><td>增量更新[计划任务]</td><td>python /www/server/solr/init.d/solr_incr.py<td></tr>';
|
||||
cmd += '<tr><td colspan="2">默认端口:8983(可修改),默认IP为本地,可修改。</td></tr></thead>';
|
||||
cmd += '</table></div>';
|
||||
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '命令',
|
||||
area: '750px',
|
||||
content:cmd,
|
||||
});
|
||||
}
|
||||
|
||||
function pRead(){
|
||||
var readme = '<ul class="help-info-text c7">';
|
||||
readme += '<li>使用默认solr端口,如有需要自行修改</li>';
|
||||
readme += '<li>如果开启防火墙,需要放行solr设置的端口,例如(8983)</li>';
|
||||
readme += '<li>数据源设置好后,需要在managed-schema中同时设置</li>';
|
||||
readme += '<li>优化索引段:curl --basic -u admin:admin "http://127.0.0.1:8983/solr/project/update?optimize=true&wt=json"</li>';
|
||||
readme += '<li><a target="_blank" href="https://github.com/midoks/mdserver-web/wiki/插件管理%5Bsolr使用说明%5D">wiki说明</a></li>';
|
||||
readme += '</ul>';
|
||||
|
||||
$('.soft-man-con').html(readme);
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import MySQLdb as mdb
|
||||
import random
|
||||
import sys
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
sys.path.append("/usr/local/lib/python2.7/site-packages")
|
||||
|
||||
conn = mdb.connect(host='0.0.0.0',
|
||||
port=3306,
|
||||
user='xxx',
|
||||
passwd='xxx',
|
||||
db='xxx',
|
||||
charset='utf8')
|
||||
conn.autocommit(True)
|
||||
cursor = conn.cursor()
|
||||
|
||||
|
||||
sql = 'select id from xxx order by id desc limit 1'
|
||||
r = cursor.execute(sql)
|
||||
|
||||
count = 0
|
||||
for info in cursor.fetchall():
|
||||
count = info[0]
|
||||
conn.close()
|
||||
|
||||
|
||||
def execShell(cmdstring, cwd=None, timeout=None, shell=True):
|
||||
|
||||
if shell:
|
||||
cmdstring_list = cmdstring
|
||||
else:
|
||||
cmdstring_list = shlex.split(cmdstring)
|
||||
if timeout:
|
||||
end_time = datetime.datetime.now() + datetime.timedelta(seconds=timeout)
|
||||
|
||||
sub = subprocess.Popen(cmdstring_list, cwd=cwd, stdin=subprocess.PIPE,
|
||||
shell=shell, bufsize=4096, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
while sub.poll() is None:
|
||||
time.sleep(0.1)
|
||||
if timeout:
|
||||
if end_time <= datetime.datetime.now():
|
||||
raise Exception("Timeout:%s" % cmdstring)
|
||||
|
||||
return sub.communicate()
|
||||
|
||||
length = 100
|
||||
for x in xrange(0, count / length + 1):
|
||||
y = x * length
|
||||
cmd = 'curl --basic -u admin:admin "http://127.0.0.1:8983/solr/sodht/dataimport?command=full-import&wt=json&clean=false&commit=true&length=' + \
|
||||
str(length) + '&offset=' + str(y) + '"'
|
||||
print execShell(cmd)
|
||||
time.sleep(0.3)
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
print 'hello world'
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<dataConfig>
|
||||
<dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/test" user="root" password="root"/>
|
||||
<document>
|
||||
<!--
|
||||
query | 获取全部数据的SQL
|
||||
deltaImportQuery | 是获取增量数据时使用的SQL
|
||||
deltaQuery | 是获取pk的SQL
|
||||
parentDeltaQuery | 是获取父Entity的pk的SQL
|
||||
deletedPkQuery | 增量索引删除主键ID查询
|
||||
-->
|
||||
<entity name="test"
|
||||
pk="id"
|
||||
query="select * from test1"
|
||||
deltaImportQuery="select * from test1 where id='${dih.delta.id}'"
|
||||
deltaQuery="select id from test1 where FROM_UNIXTIME(`time`,'%Y-%m-%d %H:%i:%s')>'${dih.last_index_time}'"
|
||||
deletedPkQuery="select id from test1 where FROM_UNIXTIME(`time`,'%Y-%m-%d %H:%i:%s')>'${dih.last_index_time}'">
|
||||
<field column="id" name="id" />
|
||||
<field column="name" name="name" />
|
||||
<field column="value" name="value" />
|
||||
</entity>
|
||||
</document>
|
||||
</dataConfig>
|
||||
|
|
@ -1,635 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
|
||||
<schema name="example-data-driven-schema" version="1.6">
|
||||
|
||||
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
|
||||
<field name="_version_" type="long" indexed="false" stored="false"/>
|
||||
<field name="_root_" type="string" indexed="true" stored="false" docValues="false" />
|
||||
<field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/>
|
||||
|
||||
<copyField source="*" dest="_text_"/>
|
||||
|
||||
<dynamicField name="*_i" type="int" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_is" type="ints" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_s" type="string" indexed="true" stored="true" />
|
||||
<dynamicField name="*_ss" type="strings" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_l" type="long" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_ls" type="longs" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_t" type="text_general" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_bs" type="booleans" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_f" type="float" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_fs" type="floats" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_d" type="double" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_ds" type="doubles" indexed="true" stored="true"/>
|
||||
|
||||
<!-- Type used to index the lat and lon components for the "location" FieldType -->
|
||||
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" useDocValuesAsStored="false" />
|
||||
|
||||
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_dts" type="date" indexed="true" stored="true" multiValued="true"/>
|
||||
<dynamicField name="*_p" type="location" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true"/>
|
||||
|
||||
<!-- some trie-coded dynamic fields for faster range queries -->
|
||||
<dynamicField name="*_ti" type="tint" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tis" type="tints" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tl" type="tlong" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tls" type="tlongs" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tf" type="tfloat" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tfs" type="tfloats" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_td" type="tdouble" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tds" type="tdoubles" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
|
||||
<dynamicField name="*_tdts" type="tdates" indexed="true" stored="true"/>
|
||||
|
||||
<dynamicField name="*_c" type="currency" indexed="true" stored="true"/>
|
||||
|
||||
<dynamicField name="ignored_*" type="ignored" multiValued="true"/>
|
||||
<dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
|
||||
|
||||
<dynamicField name="random_*" type="random" />
|
||||
|
||||
<uniqueKey>id</uniqueKey>
|
||||
|
||||
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" />
|
||||
<fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true" />
|
||||
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
|
||||
<fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
|
||||
<fieldType name="int" class="solr.TrieIntField" docValues="true" precisionStep="0" positionIncrementGap="0"/>
|
||||
<fieldType name="float" class="solr.TrieFloatField" docValues="true" precisionStep="0" positionIncrementGap="0"/>
|
||||
<fieldType name="long" class="solr.TrieLongField" docValues="true" precisionStep="0" positionIncrementGap="0"/>
|
||||
<fieldType name="double" class="solr.TrieDoubleField" docValues="true" precisionStep="0" positionIncrementGap="0"/>
|
||||
<fieldType name="ints" class="solr.TrieIntField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="floats" class="solr.TrieFloatField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="longs" class="solr.TrieLongField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="doubles" class="solr.TrieDoubleField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="tint" class="solr.TrieIntField" docValues="true" precisionStep="8" positionIncrementGap="0"/>
|
||||
<fieldType name="tfloat" class="solr.TrieFloatField" docValues="true" precisionStep="8" positionIncrementGap="0"/>
|
||||
<fieldType name="tlong" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0"/>
|
||||
<fieldType name="tdouble" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0"/>
|
||||
<fieldType name="tints" class="solr.TrieIntField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="tfloats" class="solr.TrieFloatField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="tlongs" class="solr.TrieLongField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="tdoubles" class="solr.TrieDoubleField" docValues="true" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="date" class="solr.TrieDateField" docValues="true" precisionStep="0" positionIncrementGap="0"/>
|
||||
<fieldType name="dates" class="solr.TrieDateField" docValues="true" precisionStep="0" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="tdate" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0"/>
|
||||
<fieldType name="tdates" class="solr.TrieDateField" docValues="true" precisionStep="6" positionIncrementGap="0" multiValued="true"/>
|
||||
<fieldType name="binary" class="solr.BinaryField"/>
|
||||
<fieldType name="random" class="solr.RandomSortField" indexed="true" />
|
||||
<dynamicField name="*_ws" type="text_ws" indexed="true" stored="true"/>
|
||||
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
|
||||
<analyzer type="index">
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
</analyzer>
|
||||
<analyzer type="query">
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
|
||||
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<dynamicField name="*_txt_en" type="text_en" indexed="true" stored="true"/>
|
||||
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer type="index">
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.StopFilterFactory"
|
||||
ignoreCase="true"
|
||||
words="lang/stopwords_en.txt"
|
||||
/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.EnglishPossessiveFilterFactory"/>
|
||||
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
|
||||
<filter class="solr.PorterStemFilterFactory"/>
|
||||
</analyzer>
|
||||
<analyzer type="query">
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
|
||||
<filter class="solr.StopFilterFactory"
|
||||
ignoreCase="true"
|
||||
words="lang/stopwords_en.txt"
|
||||
/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.EnglishPossessiveFilterFactory"/>
|
||||
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
|
||||
|
||||
|
||||
<filter class="solr.PorterStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<dynamicField name="*_txt_en_split" type="text_en_splitting" indexed="true" stored="true"/>
|
||||
<fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
|
||||
<analyzer type="index">
|
||||
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
||||
|
||||
<filter class="solr.StopFilterFactory"
|
||||
ignoreCase="true"
|
||||
words="lang/stopwords_en.txt"
|
||||
/>
|
||||
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
|
||||
<filter class="solr.PorterStemFilterFactory"/>
|
||||
</analyzer>
|
||||
<analyzer type="query">
|
||||
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
||||
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
|
||||
<filter class="solr.StopFilterFactory"
|
||||
ignoreCase="true"
|
||||
words="lang/stopwords_en.txt"
|
||||
/>
|
||||
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
|
||||
<filter class="solr.PorterStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<dynamicField name="*_txt_en_split_tight" type="text_en_splitting_tight" indexed="true" stored="true"/>
|
||||
<fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
|
||||
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt"/>
|
||||
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
|
||||
<filter class="solr.EnglishMinimalStemFilterFactory"/>
|
||||
|
||||
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
|
||||
<dynamicField name="*_txt_rev" type="text_general_rev" indexed="true" stored="true"/>
|
||||
<fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer type="index">
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
|
||||
maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
|
||||
</analyzer>
|
||||
<analyzer type="query">
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<fieldtype name="textComplex" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="complex" dicPath="dic"/>
|
||||
</analyzer>
|
||||
</fieldtype>
|
||||
<fieldtype name="textMaxWord" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="max-word" />
|
||||
</analyzer>
|
||||
</fieldtype>
|
||||
<fieldtype name="textSimple" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple" dicPath="dic" />
|
||||
</analyzer>
|
||||
</fieldtype>
|
||||
|
||||
<dynamicField name="*_phon_en" type="phonetic_en" indexed="true" stored="true"/>
|
||||
<fieldType name="phonetic_en" stored="false" indexed="true" class="solr.TextField" >
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<dynamicField name="*_s_lower" type="lowercase" indexed="true" stored="true"/>
|
||||
<fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.KeywordTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory" />
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<dynamicField name="*_descendent_path" type="descendent_path" indexed="true" stored="true"/>
|
||||
<fieldType name="descendent_path" class="solr.TextField">
|
||||
<analyzer type="index">
|
||||
<tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
|
||||
</analyzer>
|
||||
<analyzer type="query">
|
||||
<tokenizer class="solr.KeywordTokenizerFactory" />
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<dynamicField name="*_ancestor_path" type="ancestor_path" indexed="true" stored="true"/>
|
||||
<fieldType name="ancestor_path" class="solr.TextField">
|
||||
<analyzer type="index">
|
||||
<tokenizer class="solr.KeywordTokenizerFactory" />
|
||||
</analyzer>
|
||||
<analyzer type="query">
|
||||
<tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- since fields of this type are by default not stored or indexed,
|
||||
any data added to them will be ignored outright. -->
|
||||
<fieldType name="ignored" stored="false" indexed="false" docValues="false" multiValued="true" class="solr.StrField" />
|
||||
|
||||
|
||||
<dynamicField name="*_point" type="point" indexed="true" stored="true"/>
|
||||
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
|
||||
|
||||
<!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
|
||||
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
|
||||
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
|
||||
geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
|
||||
<fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />
|
||||
|
||||
|
||||
<!-- Arabic -->
|
||||
<dynamicField name="*_txt_ar" type="text_ar" indexed="true" stored="true"/>
|
||||
<fieldType name="text_ar" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<!-- for any non-arabic -->
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ar.txt" />
|
||||
<!-- normalizes ﻯ to ﻱ, etc -->
|
||||
<filter class="solr.ArabicNormalizationFilterFactory"/>
|
||||
<filter class="solr.ArabicStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Bulgarian -->
|
||||
<dynamicField name="*_txt_bg" type="text_bg" indexed="true" stored="true"/>
|
||||
<fieldType name="text_bg" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_bg.txt" />
|
||||
<filter class="solr.BulgarianStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Catalan -->
|
||||
<dynamicField name="*_txt_ca" type="text_ca" indexed="true" stored="true"/>
|
||||
<fieldType name="text_ca" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<!-- removes l', etc -->
|
||||
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ca.txt"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- CJK bigram (see text_ja for a Japanese configuration using morphological analysis) -->
|
||||
<dynamicField name="*_txt_cjk" type="text_cjk" indexed="true" stored="true"/>
|
||||
<fieldType name="text_cjk" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<!-- normalize width before bigram, as e.g. half-width dakuten combine -->
|
||||
<filter class="solr.CJKWidthFilterFactory"/>
|
||||
<!-- for any non-CJK -->
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.CJKBigramFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Czech -->
|
||||
<dynamicField name="*_txt_cz" type="text_cz" indexed="true" stored="true"/>
|
||||
<fieldType name="text_cz" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" />
|
||||
<filter class="solr.CzechStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Danish -->
|
||||
<dynamicField name="*_txt_da" type="text_da" indexed="true" stored="true"/>
|
||||
<fieldType name="text_da" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- German -->
|
||||
<dynamicField name="*_txt_de" type="text_de" indexed="true" stored="true"/>
|
||||
<fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" />
|
||||
<filter class="solr.GermanNormalizationFilterFactory"/>
|
||||
<filter class="solr.GermanLightStemFilterFactory"/>
|
||||
<!-- less aggressive: <filter class="solr.GermanMinimalStemFilterFactory"/> -->
|
||||
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="German2"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Greek -->
|
||||
<dynamicField name="*_txt_el" type="text_el" indexed="true" stored="true"/>
|
||||
<fieldType name="text_el" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<!-- greek specific lowercase for sigma -->
|
||||
<filter class="solr.GreekLowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_el.txt" />
|
||||
<filter class="solr.GreekStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Spanish -->
|
||||
<dynamicField name="*_txt_es" type="text_es" indexed="true" stored="true"/>
|
||||
<fieldType name="text_es" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_es.txt" format="snowball" />
|
||||
<filter class="solr.SpanishLightStemFilterFactory"/>
|
||||
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Spanish"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Basque -->
|
||||
<dynamicField name="*_txt_eu" type="text_eu" indexed="true" stored="true"/>
|
||||
<fieldType name="text_eu" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Basque"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Persian -->
|
||||
<dynamicField name="*_txt_fa" type="text_fa" indexed="true" stored="true"/>
|
||||
<fieldType name="text_fa" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<!-- for ZWNJ -->
|
||||
<charFilter class="solr.PersianCharFilterFactory"/>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.ArabicNormalizationFilterFactory"/>
|
||||
<filter class="solr.PersianNormalizationFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" />
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Finnish -->
|
||||
<dynamicField name="*_txt_fi" type="text_fi" indexed="true" stored="true"/>
|
||||
<fieldType name="text_fi" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Finnish"/>
|
||||
<!-- less aggressive: <filter class="solr.FinnishLightStemFilterFactory"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- French -->
|
||||
<dynamicField name="*_txt_fr" type="text_fr" indexed="true" stored="true"/>
|
||||
<fieldType name="text_fr" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<!-- removes l', etc -->
|
||||
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_fr.txt"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fr.txt" format="snowball" />
|
||||
<filter class="solr.FrenchLightStemFilterFactory"/>
|
||||
<!-- less aggressive: <filter class="solr.FrenchMinimalStemFilterFactory"/> -->
|
||||
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="French"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Irish -->
|
||||
<dynamicField name="*_txt_ga" type="text_ga" indexed="true" stored="true"/>
|
||||
<fieldType name="text_ga" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<!-- removes d', etc -->
|
||||
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ga.txt"/>
|
||||
<!-- removes n-, etc. position increments is intentionally false! -->
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/hyphenations_ga.txt"/>
|
||||
<filter class="solr.IrishLowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ga.txt"/>
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Irish"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Galician -->
|
||||
<dynamicField name="*_txt_gl" type="text_gl" indexed="true" stored="true"/>
|
||||
<fieldType name="text_gl" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" />
|
||||
<filter class="solr.GalicianStemFilterFactory"/>
|
||||
<!-- less aggressive: <filter class="solr.GalicianMinimalStemFilterFactory"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Hindi -->
|
||||
<dynamicField name="*_txt_hi" type="text_hi" indexed="true" stored="true"/>
|
||||
<fieldType name="text_hi" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<!-- normalizes unicode representation -->
|
||||
<filter class="solr.IndicNormalizationFilterFactory"/>
|
||||
<!-- normalizes variation in spelling -->
|
||||
<filter class="solr.HindiNormalizationFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hi.txt" />
|
||||
<filter class="solr.HindiStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Hungarian -->
|
||||
<dynamicField name="*_txt_hu" type="text_hu" indexed="true" stored="true"/>
|
||||
<fieldType name="text_hu" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Hungarian"/>
|
||||
<!-- less aggressive: <filter class="solr.HungarianLightStemFilterFactory"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Armenian -->
|
||||
<dynamicField name="*_txt_hy" type="text_hy" indexed="true" stored="true"/>
|
||||
<fieldType name="text_hy" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Armenian"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Indonesian -->
|
||||
<dynamicField name="*_txt_id" type="text_id" indexed="true" stored="true"/>
|
||||
<fieldType name="text_id" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" />
|
||||
<filter class="solr.IndonesianStemFilterFactory" stemDerivational="true"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Italian -->
|
||||
<dynamicField name="*_txt_it" type="text_it" indexed="true" stored="true"/>
|
||||
<fieldType name="text_it" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<!-- removes l', etc -->
|
||||
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_it.txt"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_it.txt" format="snowball" />
|
||||
<filter class="solr.ItalianLightStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
|
||||
<dynamicField name="*_txt_ja" type="text_ja" indexed="true" stored="true"/>
|
||||
<fieldType name="text_ja" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="false">
|
||||
<analyzer>
|
||||
|
||||
<tokenizer class="solr.JapaneseTokenizerFactory" mode="search"/>
|
||||
<filter class="solr.JapaneseBaseFormFilterFactory"/>
|
||||
<filter class="solr.JapanesePartOfSpeechStopFilterFactory" tags="lang/stoptags_ja.txt" />
|
||||
<filter class="solr.CJKWidthFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ja.txt" />
|
||||
<filter class="solr.JapaneseKatakanaStemFilterFactory" minimumLength="4"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Latvian -->
|
||||
<dynamicField name="*_txt_lv" type="text_lv" indexed="true" stored="true"/>
|
||||
<fieldType name="text_lv" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" />
|
||||
<filter class="solr.LatvianStemFilterFactory"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Dutch -->
|
||||
<dynamicField name="*_txt_nl" type="text_nl" indexed="true" stored="true"/>
|
||||
<fieldType name="text_nl" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" />
|
||||
<filter class="solr.StemmerOverrideFilterFactory" dictionary="lang/stemdict_nl.txt" ignoreCase="false"/>
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Dutch"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Norwegian -->
|
||||
<dynamicField name="*_txt_no" type="text_no" indexed="true" stored="true"/>
|
||||
<fieldType name="text_no" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Norwegian"/>
|
||||
<!-- less aggressive: <filter class="solr.NorwegianLightStemFilterFactory"/> -->
|
||||
<!-- singular/plural: <filter class="solr.NorwegianMinimalStemFilterFactory"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Portuguese -->
|
||||
<dynamicField name="*_txt_pt" type="text_pt" indexed="true" stored="true"/>
|
||||
<fieldType name="text_pt" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" />
|
||||
<filter class="solr.PortugueseLightStemFilterFactory"/>
|
||||
<!-- less aggressive: <filter class="solr.PortugueseMinimalStemFilterFactory"/> -->
|
||||
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Portuguese"/> -->
|
||||
<!-- most aggressive: <filter class="solr.PortugueseStemFilterFactory"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Romanian -->
|
||||
<dynamicField name="*_txt_ro" type="text_ro" indexed="true" stored="true"/>
|
||||
<fieldType name="text_ro" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Romanian"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Russian -->
|
||||
<dynamicField name="*_txt_ru" type="text_ru" indexed="true" stored="true"/>
|
||||
<fieldType name="text_ru" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Russian"/>
|
||||
<!-- less aggressive: <filter class="solr.RussianLightStemFilterFactory"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Swedish -->
|
||||
<dynamicField name="*_txt_sv" type="text_sv" indexed="true" stored="true"/>
|
||||
<fieldType name="text_sv" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Swedish"/>
|
||||
<!-- less aggressive: <filter class="solr.SwedishLightStemFilterFactory"/> -->
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Thai -->
|
||||
<dynamicField name="*_txt_th" type="text_th" indexed="true" stored="true"/>
|
||||
<fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.ThaiTokenizerFactory"/>
|
||||
<filter class="solr.LowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" />
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
<!-- Turkish -->
|
||||
<dynamicField name="*_txt_tr" type="text_tr" indexed="true" stored="true"/>
|
||||
<fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
|
||||
<analyzer>
|
||||
<tokenizer class="solr.StandardTokenizerFactory"/>
|
||||
<filter class="solr.TurkishLowerCaseFilterFactory"/>
|
||||
<filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_tr.txt" />
|
||||
<filter class="solr.SnowballPorterFilterFactory" language="Turkish"/>
|
||||
</analyzer>
|
||||
</fieldType>
|
||||
|
||||
|
||||
</schema>
|
||||
|
|
@ -1 +0,0 @@
|
|||
admin: admin, admin
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Set name="contextPath"><Property name="hostContext" default="/solr"/></Set>
|
||||
<Set name="war"><Property name="jetty.base"/>/solr-webapp/webapp</Set>
|
||||
<Set name="defaultsDescriptor"><Property name="jetty.base"/>/etc/webdefault.xml</Set>
|
||||
<Set name="extractWAR">false</Set>
|
||||
|
||||
<Get name="securityHandler">
|
||||
<Set name="loginService">
|
||||
<New class="org.eclipse.jetty.security.HashLoginService">
|
||||
<Set name="name">Test Reaml</Set>
|
||||
<Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
|
||||
</New>
|
||||
</Set>
|
||||
</Get>
|
||||
</Configure>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,202 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
version="2.5"
|
||||
metadata-complete="true"
|
||||
>
|
||||
|
||||
|
||||
<!-- Uncomment if you are trying to use a Resin version before 3.0.19.
|
||||
Their XML implementation isn't entirely compatible with Xerces.
|
||||
Below are the implementations to use with Sun's JVM.
|
||||
<system-property javax.xml.xpath.XPathFactory=
|
||||
"com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"/>
|
||||
<system-property javax.xml.parsers.DocumentBuilderFactory=
|
||||
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/>
|
||||
<system-property javax.xml.parsers.SAXParserFactory=
|
||||
"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/>
|
||||
-->
|
||||
|
||||
<!-- People who want to hardcode their "Solr Home" directly into the
|
||||
WAR File can set the JNDI property here...
|
||||
-->
|
||||
<!--
|
||||
<env-entry>
|
||||
<env-entry-name>solr/home</env-entry-name>
|
||||
<env-entry-value>/put/your/solr/home/here</env-entry-value>
|
||||
<env-entry-type>java.lang.String</env-entry-type>
|
||||
</env-entry>
|
||||
-->
|
||||
|
||||
<!-- Any path (name) registered in solrconfig.xml will be sent to that filter -->
|
||||
<filter>
|
||||
<filter-name>SolrRequestFilter</filter-name>
|
||||
<filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
|
||||
<!--
|
||||
Exclude patterns is a list of directories that would be short circuited by the
|
||||
SolrDispatchFilter. It includes all Admin UI related static content.
|
||||
NOTE: It is NOT a pattern but only matches the start of the HTTP ServletPath.
|
||||
-->
|
||||
<init-param>
|
||||
<param-name>excludePatterns</param-name>
|
||||
<param-value>/css/.+,/js/.+,/img/.+,/tpl/.+</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<!--
|
||||
NOTE: When using multicore, /admin JSP URLs with a core specified
|
||||
such as /solr/coreName/admin/stats.jsp get forwarded by a
|
||||
RequestDispatcher to /solr/admin/stats.jsp with the specified core
|
||||
put into request scope keyed as "org.apache.solr.SolrCore".
|
||||
|
||||
It is unnecessary, and potentially problematic, to have the SolrDispatchFilter
|
||||
configured to also filter on forwards. Do not configure
|
||||
this dispatcher as <dispatcher>FORWARD</dispatcher>.
|
||||
-->
|
||||
<filter-name>SolrRequestFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>LoadAdminUI</servlet-name>
|
||||
<servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<!-- Remove in Solr 5.0 -->
|
||||
<!-- This sends SC_MOVED_PERMANENTLY (301) for resources that changed in 4.0 -->
|
||||
<servlet>
|
||||
<servlet-name>RedirectOldAdminUI</servlet-name>
|
||||
<servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>destination</param-name>
|
||||
<param-value>${context}/#/</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>RedirectOldZookeeper</servlet-name>
|
||||
<servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>destination</param-name>
|
||||
<param-value>${context}/admin/zookeeper</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>RedirectLogging</servlet-name>
|
||||
<servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>destination</param-name>
|
||||
<param-value>${context}/#/~logging</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>SolrRestApi</servlet-name>
|
||||
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>org.restlet.application</param-name>
|
||||
<param-value>org.apache.solr.rest.SolrSchemaRestApi</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>RedirectOldAdminUI</servlet-name>
|
||||
<url-pattern>/admin/</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>RedirectOldAdminUI</servlet-name>
|
||||
<url-pattern>/admin</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>RedirectOldZookeeper</servlet-name>
|
||||
<url-pattern>/zookeeper.jsp</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>RedirectOldZookeeper</servlet-name>
|
||||
<url-pattern>/zookeeper</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>RedirectLogging</servlet-name>
|
||||
<url-pattern>/logging</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>LoadAdminUI</servlet-name>
|
||||
<url-pattern>/old.html</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>LoadAdminUI</servlet-name>
|
||||
<url-pattern>/index.html</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>SolrRestApi</servlet-name>
|
||||
<url-pattern>/schema/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<mime-mapping>
|
||||
<extension>.xsl</extension>
|
||||
<!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ -->
|
||||
<mime-type>application/xslt+xml</mime-type>
|
||||
</mime-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<!-- Get rid of error message -->
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>Disable TRACE</web-resource-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
<http-method>TRACE</http-method>
|
||||
</web-resource-collection>
|
||||
<auth-constraint/>
|
||||
</security-constraint>
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>Enable everything but TRACE</web-resource-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
<http-method-omission>TRACE</http-method-omission>
|
||||
</web-resource-collection>
|
||||
</security-constraint>
|
||||
|
||||
<!--
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>solr</web-resource-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</web-resource-collection>
|
||||
<auth-constraint>
|
||||
<role-name>solr_home</role-name>
|
||||
<role-name>admin</role-name>
|
||||
</auth-constraint>
|
||||
</security-constraint>
|
||||
|
||||
<login-config>
|
||||
<auth-method>BASIC</auth-method>
|
||||
<realm-name>Solr</realm-name>
|
||||
</login-config>
|
||||
-->
|
||||
|
||||
</web-app>
|
||||
Loading…
Reference in New Issue