[HOWTO] Install Sphinx for A Script Pro

Source: Internet
Author: User
Tags root access

Hi

Here's a small howto on installing Sphinx Search (http://sphinxsearch.com/) and configuring it to work with adult Script P Ro. By using Sphinx
You'll be able to allow users to search for video on your adult tube site by title, description and tags. The search results'll be automatically
Ordered by relevance (their almost the same as using MySQL match_against, but faster and it can support even 1.000.000 video s).

You'll need SSH root access. The installation itself is quite easy and depending on your distribution:

Ubuntu (tested on Ubuntu 10.10):

sudo apt-get updatesudo apt-get install Sphinxsearch

CentOs (Tested on 5.4):

Yum Install Sphinx

Configuring Sphinx Si also straight forward, all your need to does 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=3306Sql_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, \ #addedinchRC4 group_concat (DISTINCT t.name SEPARATOR' 'As tags from video as V left joins Video_tags as T on (t.video_id=v.video_id) WHERE V.status=1GROUP by v.video_id Sql_attr_uint= Video #addedinchRC4 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=UINTcategories 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-8Min_prefix_len=3Enable_star=1}searchd{Port=3312Log=/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 need to create the initial index with the following command:

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

You'll also need to create a cron file and place it into the the/etc/cron.hourly (or add it to cron from cpanel or console) . The script
Should is 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 has the time do the installation yourself, or you dont like the Linux console, just drop us a email and we CA n 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=3306Sql_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 joins Video_tags as T on (t.video_id=v.video_id) and V.status=1GROUP 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=UINTcategories 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-8Min_prefix_len=3Enable_star=1}searchd{Port=3312Log=/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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.