Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

olegpro/sphinx-udf-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sphinx UDF BK_FIELD (MySQL analog function FIELD)

Installation

git clone https://github.com/olegpro/sphinx-udf-field.git
cd sphinx-udf-field
make
sudo make install

Ensure that sphinx.conf contains plugin dir path:

common
{
	plugin_dir = /usr/local/sphinx/lib
}

Register plugin

mysql -h127.0.0.1 -P9306

mysql> CREATE FUNCTION bk_field RETURNS BIGINT SONAME 'bk_field.so';
Query OK, 0 rows affected (0,00 sec)

Usage

mysql -h127.0.0.1 -P9306

mysql> SELECT BK_FIELD('c', 'a', 'b', 'c', 'd', 'e');
+----------------------------------------+
| BK_FIELD('c', 'a', 'b', 'c', 'd', 'e') |
+----------------------------------------+
| 3                                      |
+----------------------------------------+
1 row in set (0.00 sec)

Blog post https://www.olegpro.ru/post/napisal_analog_funkcii_field_v_mysql_dlya_sphinx.html

Morty Proxy This is a proxified and sanitized view of the page, visit original site.