[HOWTO] Install Sphinx for A Script Pro
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的更多相关文章
- HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits
安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章. 成功安装的关键点:install ...
- How-to Install VMware Tools on Debian Stretch 9 32/64bit Linux+GNU
在虚拟机VMWARE上安装debian9 安装vmwaretools时候遇到问题 询问我IFCONFIG安装在哪里? 新版的debian不知道是用户权限问题还是使用了其他网络配置工具 vmwareto ...
- MinGW - 安装和配置 / MinGW - Howto Install And Configure
MinGW在线安装程序下载地址:http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get- ...
- HOWTO Install the MinGW (GCC) Compiler Suite
Posted July 25th, 2008 by mingwadmin getting started install mingw Automated Installer If you are ne ...
- A Script Pro nginx URL重写规则无法播放MP4解决方法
I am using nginx and I have already add the line location /file/ { rewrite ^/-]+)/([-]+)/([^/]*)/([- ...
- 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 ...
- SphinxJS——把字符串编码成png图片的超轻量级开源库
体验地址:https://jrainlau.github.io/sp...项目地址:https://github.com/jrainlau/s... SphinxJS 一个能够把字符串编码成png图片 ...
- 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 ...
- 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 ...
随机推荐
- z
360导航_新一代安全上网导航 http://www.codeproject.com/Articles/636730/Distributed-caching-using-Redis-server-wi ...
- poj 3169 Layout
Layout Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8610 Accepted: 4147 Descriptio ...
- MySQL 面试基础
相关:http://blog.csdn.net/u013252072/article/details/52912385 http://blog.csdn.net/zhangliang ...
- jump_ur.php通知模板
<title>出错啦~~~</title> <script language="javascript" type="text/javascr ...
- 树莓派(raspberry)启用root账户 分类: 服务器搭建 Raspberry Pi 2015-04-12 18:45 95人阅读 评论(0) 收藏
树莓派使用的linux是debian系统,所以树莓派启用root和debian是相同的. debian里root账户默认没有密码,但账户锁定. 当需要root权限时,由默认账户经由sudo执行,Ras ...
- java websockect
https://github.com/TooTallNate/Java-WebSocket (websockect类库包) http://blog.openlg.net/index.php/archi ...
- Android 仿PhotoShop调色板应用(三) 主体界面绘制
版权声明:本文为博主原创文章,未经博主允许不得转载. Android 仿PhotoShop调色板应用(三) 主体界面绘制 关于PhotoShop调色板应用的实现我总结了两个最核心的部分: 1 ...
- Android中Style和Theme的使用
Style: Style是View中一些属性的集合,包括height,padding,font color,background等等,Style单独定义在xml文件中,类似与web页面中css的角色, ...
- 为Android GridView 设置行背景
经常有这样的需求,你的功能图标要像一个个物品,摆放在书架上,像这样: 我的思路比较简单,重载GridView,在他绘制子视图前,先把背景绘制完成 1 2 3 4 5 6 7 8 9 10 11 12 ...
- 基于hadoop2.6.0搭建5个节点的分布式集群
1.前言 我们使用hadoop2.6.0版本配置Hadoop集群,同时配置NameNode+HA.ResourceManager+HA,并使用zookeeper来管理Hadoop集群 2.规划 1.主 ...