Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jdbc 将停止字从Mysql加载到Solr6_Jdbc_Solr_Solr6 - Fatal编程技术网

Jdbc 将停止字从Mysql加载到Solr6

Jdbc 将停止字从Mysql加载到Solr6,jdbc,solr,solr6,Jdbc,Solr,Solr6,我是新来solr的。我想在分析阶段将同义词或停止词从DB而不是txt文件加载到solr。我怎样才能在solr 6中实现它 我尝试了移植Solr-JDBC(),但没有成功,因为它使用了tomcat。这可以用于solr 6和jetty吗?是的,您可以将solr JDBC用于jetty,只需为其配置数据库连接即可。首先在web.xml中命名数据库连接器: 我的Stopword数据源 jdbc/stopwords javax.sql.DataSource 容器 然后,继续执行jetty.xml文件、

我是新来solr的。我想在分析阶段将同义词或停止词从DB而不是txt文件加载到solr。我怎样才能在solr 6中实现它


我尝试了移植Solr-JDBC(),但没有成功,因为它使用了tomcat。这可以用于solr 6和jetty吗?

是的,您可以将solr JDBC用于jetty,只需为其配置数据库连接即可。首先在web.xml中命名数据库连接器:


我的Stopword数据源
jdbc/stopwords
javax.sql.DataSource
容器
然后,继续执行jetty.xml文件、WEB-INF/jetty-env.xml文件或上下文xml文件中的实际配置:

<New id="stopwords" class="org.eclipse.jetty.plus.jndi.Resource">
  <Arg></Arg>
  <Arg>jdbc/stopwords</Arg>
  <Arg>
    <New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
      <Set name="Url">jdbc:mysql://localhost:3306/databasename</Set>
      <Set name="User">user</Set>
      <Set name="Password">pass</Set>
    </New>
  </Arg>
</New>

jdbc/stopwords
jdbc:mysql://localhost:3306/databasename
用户
通过
此时,您可以像使用Tomcat一样使用Solr JDBC:

<filter class="com.s24.search.solr.analysis.jdbc.JdbcStopFilterFactory"   
  sql="SELECT stopword FROM stopwords" 
  jndiName="jdbc/stopwords"/>


您希望使用哪种数据库?@sven.windisch MySql
<filter class="com.s24.search.solr.analysis.jdbc.JdbcStopFilterFactory"   
  sql="SELECT stopword FROM stopwords" 
  jndiName="jdbc/stopwords"/>