how to get all column value from sphinx by configuration file php

放肆的年华 提交于 2019-12-06 14:53:25

Sphinx will only return the document id, weight and attributes. Use MySQL to get the rest of the values.

  1. Do a Sphinx search, which will give you a list of document IDs
  2. For every document ID, do a MySQL query which gives you the values for all fields.

I think there are some tricks could be used for the problem.

  1. if the column is not included in fulltext search, you could add it into attr entry. e.g. for field name and age, in xmlpipe2 source config file, you could add these in the index part:

    xmlpipe_attr_string = name
    xmlpipe_attr_uint = age
    
  2. if the column is included in fulltext search, you could add it into attr entry and field entry the same time. e.g. for field intro, in xmlpipe2 source config file, you could add these in the index part:

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