[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 ...
随机推荐
- jemalloc/jemalloc.h: No such file or directory
Redis 2.6.9 安装报错,提示: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directoryzmalloc.h ...
- SQLyog之MySQL客户端的下载、安装和使用
本博文的主要内容有 .SQLyog的下载 .SQLyog的安装 .SQLyog的使用 1.SQLyog的下载 1.进入SQLyog官网, https://www.webyog.com/en 或 ...
- Grandpa's Estate - POJ 1228(稳定凸包)
刚开始看这个题目不知道是什么东东,后面看了大神的题解才知道是稳定凸包问题,什么是稳定凸包呢?所谓稳定就是判断能不能在原有凸包上加点,得到一个更大的凸包,并且这个凸包包含原有凸包上的所有点.知道了这个东 ...
- VM网络无法连接--提示ethernet0无法连接到虚拟网络
打开 “编辑->虚拟网络设置"里面,点“恢复默认” 如果还不行 然后 开网络和共享中心 左击 本地连接(若是无线网络,则点击无线网络连接)----属性----共享---- 在:允许其 ...
- C# richTextBox 重下往上依次查找关键字
private void richTextBox1_SelectionChanged(object sender, EventArgs e) { pos = richTextBox1.Sele ...
- etrace 跟踪 nginx之HTTP请求流程
curl 127.0.0.1 | | | \--ngx_epoll_process_events | | | | \--ngx_time_update | | | | | \--ngx_gmtime ...
- 使用Partitioner实现输出到多个文件
1.需求 按学生的年龄段,将数据输出到不同的文件.这里我们分为三个年龄段:小于等于20岁.大于20岁小于等于50岁和大于50岁 2.实现 1.编写Partitioner,代码如下 public sta ...
- viewpager+fragment学习笔记
有暇,总结一下viewpager+fragment的使用. 先来看看效果图: 有三个标题,三个fragment,滑动时标题的颜色会随着变化. MainActivity.java public clas ...
- float:left 与display:inline的具体区别?
设了float:left的元素允许它的右边存在任何元素同行显示,不论是内联元素还是块元素.但它的左边还是不允许存在任何元素与之同行显示,哪怕其它的元素的代码在前,除非也给前面的元素加上float:le ...
- rabbitmq 消息持久化之receive and send
二: 任务分发 &消息持久化 启用多个接收端的时候如果某一个receive 关闭要保证消息有反馈是否收到 send端 #-*- coding: UTF-8 -*-import pika ...