zoukankan      html  css  js  c++  java
  • sphinx中,直接取主键ID

    sphinx.conf中 

    sql_query    = \
      SELECT aid,aid AS testid, title,group_id \
      FROM documents

    aid为主键ID,

    必须AS成testid后,

    再添加一个属性,sql_attr_uint   = testid

    才可以显示成如下形式:

      [matches] => Array
            (
                [1] => Array
                    (
                        [weight] => 1
                        [attrs] => Array
                            (
                                [testid] => 1                  ------------>显示出来了,这个问题搞了一下午,气人
                                [group_id] => 1
                            )

                    )

            )

  • 相关阅读:
    257. Binary Tree Paths
    324. Wiggle Sort II
    315. Count of Smaller Numbers After Self
    350. Intersection of Two Arrays II
    295. Find Median from Data Stream
    289. Game of Life
    287. Find the Duplicate Number
    279. Perfect Squares
    384. Shuffle an Array
    E
  • 原文地址:https://www.cnblogs.com/flex_fly/p/1759514.html
Copyright © 2011-2022 走看看