Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.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
如何在mysql和php中使用solr?_Php_Mysql_Search_Solr - Fatal编程技术网

如何在mysql和php中使用solr?

如何在mysql和php中使用solr?,php,mysql,search,solr,Php,Mysql,Search,Solr,我读过关于如何使用solr在我的线程中搜索的文章,但我不太明白它是如何工作的,我找不到任何文章来解释这一点 有人能简单地解释一下solr是如何工作的,以及它是如何与mysql和php通信的吗 使用solr,您需要有一个xml(或)文档,该文档将被推送到solr(这个过程称为更新;索引是使字段可用于搜索的过程)。xml的格式如下: <add> <doc> <field name="id">9885A004</field> <

我读过关于如何使用solr在我的线程中搜索的文章,但我不太明白它是如何工作的,我找不到任何文章来解释这一点

有人能简单地解释一下solr是如何工作的,以及它是如何与mysql和php通信的吗

使用solr,您需要有一个xml(或)文档,该文档将被推送到solr(这个过程称为更新;索引是使字段可用于搜索的过程)。xml的格式如下:

<add>
  <doc>
    <field name="id">9885A004</field>
    <field name="name">Canon PowerShot SD500</field>
    <field name="category">camera</field>
    <field name="features">3x optical zoom</field>
    <field name="features">aluminum case</field>
    <field name="weight">6.4</field>
    <field name="price">329.95</field>
  </doc>
</add>
了解更多详细信息

但在您的情况下,您可以使用爬虫(如果不同或外部来源,则适用)来识别不同的文档格式。 试着了解一下你是否能帮上忙


例如,看一看关于solr、lucene和nutch的解释。

回答得好,但我在问题中没有看到任何东西表明OP需要爬虫。好的,没错。我想他提到php是因为一些外部服务/cms