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. poj 1192最优连通子集(简单树形dp)

    题目链接:http://poj.org/problem?id=1192 #include<cstdio> #include<cstring> #include<iostr ...

  2. codeforces 710C

    C. Magic Odd Square time limit per test 1 second memory limit per test 256 megabytes input standard ...

  3. winform 解决界面闪动、提升加载速度 分类: WinForm 2015-02-03 16:34 161人阅读 评论(0) 收藏

    说明: 从一个技术交流群里获得,经验证效果不错. //作用 加快界面加载 protected override CreateParams CreateParams          {         ...

  4. Asp.net网站后台代码不能访问-iis部署

    最近自己写了点东西,部署的时候确发生了点问题,后台代码访问不了,错误为:由于扩展配置问题而无法提供您请求的页面.如果该页面是脚本,请添加处理程序.   错误详细提示: HTTP 错误 404.3 -  ...

  5. 只有在配置文件中或 Page 说明会 enableSessionState 至 true 时刻,能够使用会话状态。另外,还要确保应用程序配置 // 段包含 System.Web.SessionSta

    首先,弄清楚我们的目的,我的目标是验证用户登录.那是,Session["userName"]!=null 在ok该 起初,我是这么写的,结果给出,提示如果上述错误标题,在调查的很长 ...

  6. android 19 activity纵横屏切换的数据保存与恢复

    Bundle类:竖屏的activity换到横屏的activity的时候,会把竖屏的activity杀掉横屏的activity创建,竖屏的activity会有一些计算结果,可以用数据存起来,存到内存里面 ...

  7. Qt 学习之路:输入元素

    前面的章节中,我们看到了作为输入元素的MouseArea,用于接收鼠标的输入.下面,我们再来介绍关于键盘输入的两个元素:TextInput和TextEdit. TextInput是单行的文本输入框,支 ...

  8. [转] Linux抓包工具tcpdump详解

    http://www.ha97.com/4550.html PS:tcpdump是一个用于截取网络分组,并输出分组内容的工具,简单说就是数据包抓包工具.tcpdump凭借强大的功能和灵活的截取策略,使 ...

  9. oracle 异常管理

    命名的系统异常                  产生原因 access_into_null 未定义对象 CASE_NOT_FOUND CASE 中若未包含相应的 WHEN ,并且没有设置 ELSE ...

  10. 'Service' object has no attribute 'process'

    在使用selenium+phantomjs时,运行总是出现错误信息: 'Service' object has no attribute 'process' 出现该错误的原因是未能找到可执行程序&qu ...