how to use solr with mysql and php?

老子叫甜甜 提交于 2019-12-21 02:44:13

问题


i read about how i could use solr to search in my threads but i dont quite understand how it works and i cant find any articles explaining this for a total beginner.

could someone explain briefly how solr works and how it communicate with mysql and php?


回答1:


First take a look at this tutorial.

With solr you will need to have an xml (or csv) document which will be pushed to solr (process is called updating; indexing is the process to make fields available for search). The format of xml is sth. like:

<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>

Look here for more details.

But in your case you could use a crawler (appropriated if different or external sources) to get different document formats recognized. Try to understand if Nutch could help here.

E.g. take a look at this presentation for an explanation about solr, lucene and nutch.



来源:https://stackoverflow.com/questions/1893857/how-to-use-solr-with-mysql-and-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!