0
我是新來的solr。我想從DB加載同義詞或停用詞,而不是txt文件來分析階段。我如何在solr 6中實現它。將停用詞從Mysql加載到Solr6
我嘗試移植Solr-JDBC(https://github.com/shopping24/solr-jdbc),但由於它使用tomcat,所以我沒有成功。這可以用於solr 6和碼頭嗎?
我是新來的solr。我想從DB加載同義詞或停用詞,而不是txt文件來分析階段。我如何在solr 6中實現它。將停用詞從Mysql加載到Solr6
我嘗試移植Solr-JDBC(https://github.com/shopping24/solr-jdbc),但由於它使用tomcat,所以我沒有成功。這可以用於solr 6和碼頭嗎?
是的,你可以在Jetty上使用Solr-JDBC,只需要爲它配置數據庫連接即可。與命名數據庫連接器web.xml中開始:
<resource-ref>
<description>My Stopword Datasource</description>
<res-ref-name>jdbc/stopwords</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
然後,在的jetty.xml文件與實際配置下去,一個WEB-INF /碼頭-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>
在這一點上,你可以使用Solr的-JDBC,你會與Tomcat使用它:
<filter class="com.s24.search.solr.analysis.jdbc.JdbcStopFilterFactory"
sql="SELECT stopword FROM stopwords"
jndiName="jdbc/stopwords"/>
你想使用什麼樣的數據庫? –
@ sven.windisch MySql – starkk92