Wednesday, 4 July 2012

SPHINX SEARCH ENGINE INSTALLATION



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.

Installation Steps:
1. Download Sphinx source tarball from
http://sphinxsearch.com/downloads/release/
download sphinx-2.0.4-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-mysql, which specifies where to look for MySQL include
    and library files, if auto-detection fails;
    iii) --with-pgsql, which specifies where to look for PostgreSQL include
    and library files.
4. Build the binaries:
    $ make
  1. 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
2. Installing Sphinx on Window platform.
Required tools:
On Windows, you will need Microsoft Visual C/C++ Studio .NET 2005 or above. Other compilers/environments will probably work as well, but for the time being, you will have to build makefile (or other environment specific project files) manually. 
 
Installation Steps:
Download Sphinx source tarball from
http://sphinxsearch.com/downloads/release/
download sphinx-2.0.4-win32.zip or sphinx-2.0.4-win32-pgsql.zip.
  1. Extract everything from the .zip file you have downloaded – sphinx-2.0.4-win32.zip or sphinx-2.0.4-win32-pgsql.zip if you need PostgresSQL support as well. You can use Windows Explorer in Windows XP and up to extract the files, or a freeware package like 7Zip to open the archive.
    For the remainder of this guide, we will assume that the folders are unzipped into c:\sphinx, such that searchd.exe can be found in c:\sphinx\bin\searchd.exe . If you decide to use any different location for the folders or configuration file, please change it accordingly.

  2. Edit the contents of sphinx.conf.in - specifically entries relating to @CONFDIR@ - to paths suitable for your system.

  3. Install the searchd system as a Windows service:
    C:\Sphinx\bin> C:\Sphinx\bin\searchd --install –config
    C:\Sphinx\sphinx.conf.in --servicename SphinxSearch

  4. The searchd service will now be listed in the Services panel within the Management Console, available from Administrative Tools. It will not have been started, as you will need to configure it and build your indexes with indexer before starting the service.

Known Installation issues
1. Standard set of installation (PostgreSQL Issues)
./configure
make
make install.
Default supports Mysql database.
Solution: If use PostgreSQL Use
./configure –with-pgsql=/usr/local/include/postgresql
make
make install. 

2. If configure fails to locate MySQL headers and/or libraries,
    Solution: try checking for and installing mysql-devel package.
    On some systems, it is not installed by default.   
    3. If make fails with a message which look like
          /bin/sh: g++: command not found
          make[1]: *** [libsphinx_a-sphinx.o] Error 127
Solution: try checking for and installing gcc-c++ package.
    4. If you are getting compile-time errors which look like
         sphinx.cpp:67: error: invalid application of `sizeof' to
          incomplete type `Private::SizeError<false>'
         Solution:   this means that some compile-time type size check failed. 
                           The most probable   reason is that off_t type is less than 64-bit on your system. 
                         As a quick hack, you can edit sphinx.h and replace off_t with DWORD in a typedef for SphOffset_t,
     but note that this will prohibit you from using full-text indexes larger than 2 GB. Even if the hack helps, please report such issues,
 providing the exact error message and compiler/OS details, so I could properly fix them in next releases.  
 
5. While doing a make on
 sphinx we got:
sphinx.cpp:16792: error: ‘m_pMysqlFields’ was not declared in this scope
sphinx.cpp:16793: error: ‘m_pMysqlResult’ was not declared in this scope
sphinx.cpp:16793: error: ‘mysql_fetch_fields’ was not declared in this scope
sphinx.cpp:16795: error: ‘m_pMysqlFields’ was not declared in this scope
make[2]: *** [sphinx.o] Error 1
make[2]: Leaving directory `/usr/local/src/sphinx-0.9.8.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/sphinx-0.9.8.1/src'
make: *** [all-recursive] Error 1
Solution: simply install mysql-devel rpm and should compile fine.

6. While doing a ./confuger on sphinx we got:
             sphinx.h:54:19: error: mysql.h: No such file or directory.
    
           Solution: simply install mysql-devel rpm and should compile fine.
  

                                                                                   -PAVANKUMAR JOSHI













No comments:

Post a Comment