Monday, 6 August 2012

SPHINX CONFIGURATION & INSTALLATION WITH POSTGRESQL DATABASE



1. Installing Sphinx on Linux platform.
Required Tools
i) a working C++ compiler. GNU gcc is known to work.
ii) a good make program. GNU make is known to work.


Postgresql devel & lib installation:
before installation check
$ whereis pg_config
   return
 pg_config: null install these tools
1. $yum install postgresql-libs
2. $yum install postgresql-devel

return
pg_config: /usr/bin/pg_config /usr/include/pg_config.h /usr/share/man/man1/pg_config.1.gz

it means "already Installed all dependencies".


Installation Steps:

1. Download Sphinx source tarball from
http://sphinxsearch.com/downloads/release/
download sphinx-2.0.5-release.tar.gz.
2.
Extract everything from the distribution tarball (haven't you already?) and
go to the sphinx sub directory. (We are using version 2.0.1-beta here for
the sake of example only; be sure to change this to a specific version you're using.

    $ tar -xzvf sphinx-2.0.4-release.tar.gz
    $cd sphinx.
3.
    Run the configuration program:
    $ ./configure
    There's a number of options to configure. The complete listing may be obtained by using --help switch. The most important ones are:
    i) --prefix, which specifies where to install Sphinx;
    such as --prefix=/usr/local/sphinx (all of the examples use this prefix)
    ii) --with-pgsql, which specifies where to look for PostgreSQL include
    and library files.
    Example:
$./configure --prefix=/usr/local/sphinx --without-mysql --with-pgsql --with-pgsql-includes=/home/PostgreSQL/8.4/include/postgresql/ --with-pgsql-libs=/home/PostgreSQL/8.4/lib/postgresql/    4. Build the binaries:
    $ make
Install the binaries in the directory of your choice:
(defaults to /usr/local/bin on *nix systems, but is overridden with configure -prefix).
$ make install

Errors:
1. ERROR: source 'addressBookSource': unknown type 'pgsql'; skipping.

Solution:
 Install postgresql libraries
1. $yum install postgresql-libs
2. $yum install postgresql-devel

2. ERROR: index 'addressBookIndex': sql_query: ERROR:  permission denied for relation addressbook



Solution:Grant all permission to table
GRANT ALL ON "tablename" TO "username"
GRANT ALL ON DATABASE "databasename" TO "username"


                                                           -PAVANKUMAR JOSHI