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

馋奶兔 提交于 2019-12-08 04:35:58

问题


i want to know how to get all column value from table using sphinx search...

i have configuration file, that file can get only one field from table.

but i need all field value.

where will i modify for getting all field from table.

thanks and advance...


回答1:


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.



回答2:


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
    


来源:https://stackoverflow.com/questions/3050853/how-to-get-all-column-value-from-sphinx-by-configuration-file-php

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