【发布时间】:2023-04-05 00:02:01
【问题描述】:
我是 Solr 的新手,我正在尝试将它与 Mysql 和 PHP 集成。
我让 Solr 服务器运行,并且我也配置了 db 模式。但是当我访问collection1 -> data import 时,我收到以下错误:
sorry, no dataimport-handler defined!
我在谷歌上搜索了很多,但我仍然感到困惑:
- 如何让 solr 在我的 php web 应用程序上工作。
- 具体是如何工作的?
这是我的 data-config.xml 文件,
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:81/solr" user="root" password=""
batchSize="1" />
<document name="products">
<entity name="products_data" query="SELECT * FROM products">
<field column="product_id" name="product_id" />
<field column="product_name" name="product_name" />
<field column="product_description" name="product_description" />
<field column="product_price" name="product_price" />
</entity>
</document>
</dataConfig>
【问题讨论】:
-
-1 请发布您的代码的一部分,并更具体地说明您到目前为止所做的尝试。你说你试图访问数据,你到底用了什么代码?
-
我已经添加了我的 data-config.xml sn-p。
-
solr 定义数据源是不够的。你需要在某个地方使用它。您需要一种特殊类型的请求处理程序,名为 dataimport-handler。这些需要在您的 solrconfig.xml 中声明。我假设你没有对 solrconfig.xml 做任何事情?如果还有,请发帖...
标签: php mysql solr indexing lucene