Search custom variables in SphinxSearch?

Hi. Is it possible to modify SphinxSearch so as to search for a new variable? I'd like to search by Role.

I'm not a coder but was wondering if the php files could be easily modified... maybe replacing the "tag" search function with "roles?" I found about 100 cases of "tag" in the plugin php files. Can I just find/replace them?

I doubt it's that easy, but maybe it can be done?

Comments

  • mcu_hqmcu_hq ✭✭✭

    It is certainly doable. From a high level of things, what needs to happen is that an attribute needs to be saved like sql_attr_uint = UserRoleId. Assuming that a role table is linked to the user table via an ID of some sort, then another inner join should also be added to the sql_query in the sphinx.conf file. Now sphinx can intelligently gather the needed information to filter.

    The plugin can then issue a filter against the query to filter the results by the UserRoleId. The returned results can then be displayed like normal. You can add a widget class in the widgets folder to do this, or manually edit the mainsearch widget

  • Thanks.

Sign In or Register to comment.