Hi,

Here's a small howto on installing Sphinx Search (http://sphinxsearch.com/) and configuring it to work with Adult Script Pro. By using sphinx
you will be able to allow users to search for video on your adult tube site by title, description and tags. The search results will be automatically
ordered by relevance (its almost the same as using mysql MATCH_AGAINST, but faster and it can support even 1.000.000 videos).

You will need ssh root access. The installation itself is quite easy, depending on your distribution:

Ubuntu (tested on Ubuntu 10.10):

sudo apt-get update
sudo apt-get install sphinxsearch

CentOs (tested on 5.4):

yum install sphinx

Configuring sphinx si also straight forward, all you need to do is edit the sphinx configuration file and add:

source videos
{
type = mysql
sql_host = localhost
sql_user = mysql-username
sql_pass = mysql-password
sql_db = mysql-database
sql_sock = /var/lib/mysqld/mysqld.sock (this depends on your server)
sql_port = sql_query_pre = SET NAMES utf8
sql_query = \
SELECT v.video_id, v.title, v.description, v.mobile, v.add_time, \
v.rating, v.total_views, v.duration, v.video_id AS video, \ #added in RC4
GROUP_CONCAT(DISTINCT t.name SEPARATOR ' ') AS tags \
FROM video AS v \
LEFT JOIN video_tags AS t ON (t.video_id = v.video_id) \
WHERE v.status = \
GROUP BY v.video_id sql_attr_uint = video #added in RC4
sql_attr_uint = mobile
sql_attr_uint = total_views
sql_attr_float = duration
sql_attr_float = rating
sql_attr_timestamp = add_time
sql_attr_multi = uint categories FROM query; SELECT video_id, cat_id FROM video_category
sql_query_info = SELECT video_id, add_date FROM video WHERE video_id=$id
} index videos
{
source = videos
path = /var/lib/sphinxsearch/data/videos (this depends on your distribution)
charset_type = utf-
min_prefix_len =
enable_star =
} searchd
{
port =
log = /var/log/sphinxsearch/searchd.log (this depends on your distribution)
query_log = /var/log/sphinxsearch/query.log (this depends on your distribution)
pid_file = /var/log/sphinxsearch/searchd.pid (this depends on your distribution)
}

The sphinx data and log folders might depend on your distribution.

After this you need to create the initial index with the following command:

indexer --all --config /path/to/your/sphinx/configuration/file.conf

You will also need to create a cron file and place it into the /etc/cron.hourly (or add it to cron from cpanel or console). The script
should be named sphinx and chmoded to 755, with the following contents:

#!/bin/bash
/usr/bin/indexer --all --rotate --config /path/to/your/sphinx/configuration/file.conf

Thats it :-)

If you dont have the time do the installation yourself, or you dont like the linux console, just drop us a email and we can do the installation
for 49$.

source videos
{
type = mysql
sql_host = localhost
sql_user = mysql-username
sql_pass = mysql-password
sql_db = mysql-database
sql_sock = /var/lib/mysqld/mysqld.sock (this depends on your server)
sql_port = sql_query_pre = SET NAMES utf8
sql_query = \
SELECT v.video_id, v.title, v.description, v.mobile, v.add_time, \
v.rating, v.total_views, v.duration, \
GROUP_CONCAT(DISTINCT t.name SEPARATOR ' ') AS tags \
FROM video AS v \
LEFT JOIN video_tags AS t ON (t.video_id = v.video_id) \
AND v.status = \
GROUP BY v.video_id sql_attr_uint = mobile
sql_attr_uint = total_views
sql_attr_float = duration
sql_attr_float = rating
sql_attr_timestamp = add_time
sql_attr_multi = uint categories FROM query; SELECT video_id, cat_id FROM video_category
sql_query_info = SELECT video_id, add_date FROM video WHERE video_id=$id
} index videos
{
source = videos
path = /var/lib/sphinxsearch/data/videos (this depends on your distribution)
charset_type = utf-
min_prefix_len =
enable_star =
} searchd
{
port =
log = /var/log/sphinxsearch/searchd.log (this depends on your distribution)
query_log = /var/log/sphinxsearch/query.log (this depends on your distribution)
pid_file = /var/log/sphinxsearch/searchd.pid (this depends on your distribution)
}

[HOWTO] Install Sphinx for A Script Pro的更多相关文章

  1. HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits

    安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章. 成功安装的关键点:install ...

  2. How-to Install VMware Tools on Debian Stretch 9 32/64bit Linux+GNU

    在虚拟机VMWARE上安装debian9 安装vmwaretools时候遇到问题 询问我IFCONFIG安装在哪里? 新版的debian不知道是用户权限问题还是使用了其他网络配置工具 vmwareto ...

  3. MinGW - 安装和配置 / MinGW - Howto Install And Configure

    MinGW在线安装程序下载地址:http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get- ...

  4. HOWTO Install the MinGW (GCC) Compiler Suite

    Posted July 25th, 2008 by mingwadmin getting started install mingw Automated Installer If you are ne ...

  5. A Script Pro nginx URL重写规则无法播放MP4解决方法

    I am using nginx and I have already add the line location /file/ { rewrite ^/-]+)/([-]+)/([^/]*)/([- ...

  6. Bash+R: howto pass parameters from bash script to R(转)

    From original post @ http://analyticsblog.mecglobal.it/analytics-tools/bashr/ In the world of data a ...

  7. SphinxJS——把字符串编码成png图片的超轻量级开源库

    体验地址:https://jrainlau.github.io/sp...项目地址:https://github.com/jrainlau/s... SphinxJS 一个能够把字符串编码成png图片 ...

  8. How to: cgminer (Bitcoin, Litecoin etc.) + AMD Radeon driver install on CentOS

    UPDATE 7/7/13: If you want to use Catalyst drivers version 12.8 you will find that X won’t start (er ...

  9. Sphinx 2.2.11-release reference manual

    1. Introduction 1.1. About 1.2. Sphinx features 1.3. Where to get Sphinx 1.4. License 1.5. Credits 1 ...

随机推荐

  1. Android NDK开发指南---Application.mk文件和android.mk文件

    https://android.googlesource.com/platform/development/+/donut-release/ndk/docs/OVERVIEW.TXT https:// ...

  2. objective-c保护属性

    #import <Foundation/Foundation.h> @interface ClassVirable : NSObject{ NSInteger year;//保护树形 } ...

  3. cf493A

    Description Vasya has started watching football games. He has learned that for some fouls the player ...

  4. Android中的主题Theme

    系统自带的Theme: android以及为我们定义好了一些theme,需要是我们直接可以拿来使用. 常用的Theme通常如下:  android:theme="@android:style ...

  5. PHP运行出现Notice : Use of undefined constant 的完美解决方案

    Notice: Use of undefined constant title - assumed 'title' in F:\wamp\www\load_myweb.php on line 22No ...

  6. shell中trap捕获信号

    信号是一种进程间通信机制,它给应用程序提供一种异步的软件中断,使应用程序有机会接受其他程序活终端发送的命令(即信号).应用程序收到信号后,有三种处理方式:忽略,默认,或捕捉.进程收到一个信号后,会检查 ...

  7. XZ压缩

    XZ压缩最新压缩率之王 xz这个压缩可能很多都很陌生,不过您可知道xz是绝大数linux默认就带的一个压缩工具. 之前xz使用一直很少,所以几乎没有什么提起. 我是在下载phpmyadmin的时候看到 ...

  8. [转] git修改author

    Changing author info To change the name and/or email address recorded in existing commits, you must ...

  9. C++实现二叉树(转)

    /************************************************************************* 这是一个二叉查找树,实现了以下操作:插入结点.构造 ...

  10. windows使用python调用wget批处理下载数据

    wget是linux/unix下通常使用的下载http/ftp的数据,使用非常方便,其实wget目前经过编译,也可在windows下使用.最近需要下载大量的遥感数据,使用了python写了批处理下载程 ...