WordPress.org

Ready to get started?Download WordPress

Forums

Problem installing Sphinx search engine (3 posts)

  1. syflowers
    Member
    Posted 5 years ago #

    This is the first time I have used the forum to try to get help. I have tried to include enough information, but may have gone too far. I will appreciate any help you can give. I've got a LOT to learn.
    Thanks,
    Jim

    I am trying to install Sphinx search engine using WordPress installation. Everything seems to work successfully up to the installation stage. But that may be just because I don't really know what I'm doing. I have put some information here to give an idea of what I'm talking about, plus excerpts from other pages I have been using during the process -- to keep you from having to find them, hopefully.)

    I get the following message when I click the box (in WordPress's settings/installation page) to install Sphinx:

    Warning: copy(/home/seeyourf/sphinx/sphinx-0.9.8-svn-r1112.tar.gz) [function.copy]: failed to open stream: No such file or directory in /home/seeyourf/public_html/wpblog/wp-content/plugins/wordpress-sphinx-plugin/php/sphinxsearch_sphinxinstall.php on line 193
    (end of warning message)

    On the page with the box to select for installation, there are also several keyword wrapper settings that can be made, followed by places to enter Sphinx configuration settings -- I have not entered any paths there yet because I don't know what to put.

    Those are as follows:
    Sphinx сonfiguration -- Sphinx index name (defaults to wordpress)
    Sphinx port (default 3312)
    Sphinx configuration file path (Not exists)
    Sphinx searchd file path (Not exists)
    Sphinx indexer file path (Not exists)
    (They put "Not exists" to show I don't have an entry)

    Next is a box to reset the index

    Then one to start the Search daemon

    Last there is info about installation:
    Sphinx Search daemon installation
    Sphinx is not installed.
    You can install your personal Sphinx search engine in /home/seeyourf/sphinx directory of your blog.
    It may take a few minutes.

    (It took only a second to come back and give me the warning message.)

    *******
    BELOW IS A COPY OF THE INSTALLATION INFO FROM THE PLUGIN PAGE

    To use the power of Sphinx for your WordPress blog, follow these steps: 1. Install the Sphinx Search plugin. 2. Install Sphinx on your web server. 3. Set up cron jobs to re-index your website periodically. 4. Configure the Sphinx Search plugin. 5. Customize your WordPress templates to show the Sphinx search field.

    Install the Sphinx Search plugin: 1. Unpack the plugin archive to wp-content/plugins/sphinxsearch folder of your WordPress installation; 2. Activate SphinxSearch plugin via WordPress admin area; 3. Create "sphinx" directory outside of you document root 4. Chmod the "sphinx" directory to make it writeable for WordPress: e.g. chmod 777 sphinx (to make it writable for all).

    ****
    (JIM'S NOTE: I used automatic option. I assume that item 3 below applies whether you use automatic or manual option, but I could not find "plugin folder sphinxsearch/rep" that they refer to.)
    ****

    Install Sphinx on your web server: If you haven't already installed Sphinx, you can install it automatically or manually: 1. For automatic installation go to 'WP-Admin -> Options -> SphinxSearch' and press "Install Personal Sphinx Search Engine"; 2. For manual installation - please visit http://www.sphinxsearch.com/ for more instructions. 3. After you have installed Sphinx manually change your sphinx.conf: In plugin folder sphinxsearch/rep you can find an example of sphinx.conf; Copy "source" and "index" sections to your sphinx.conf; In sphinx.conf replace our placeholders with their values depending on your system; 4. Go to "WP-Admin -> Options -> SphinxSearch" Add index configuration options and save the changes; 5. Run sphinx indexer; 6. Restart sphinx search daemon. 7. Chmod the searchd.pid file to make it readable for WordPress: e.g. chmod 644 searchd.pid (to make it readable for all).

    Set up cron jobs to re-index your website periodically: 1. Copy cron/reindexconfigsample.php to cron/reindexconfig.php 2. Open reindexconfig.php in editor and change path to Sphinx Indexer, Sphinx conf and index name (optional) 3. Use "crontab -e" to add the following lines to your crontab:

    Delta index. Run cron job every 5 minutes to update delta index:
    */5 * * * * /usr/bin/php /path/to/wp-content/plugins/sphinxsearch/cron/reindex.php delta

    main indexing. Run cron job once a day to update main index: Run every day in 0 hours and 5 minutes
    5 0 * * * /usr/bin/php /path/to/wp-content/plugins/sphinxsearch/cron/reindex.php main

    Configure the Sphinx Search plugin: 1. You can control the majority of options via admin area of WordPress. Go to "WP-Admin -> Options -> SphinxSearch" to do it.

    Customize your WordPress templates to show the Sphinx search field: Template tags: You can use the following tags in your templates: 1. Search form in sidebar: 2. Search form on the top of search results: 3. Top 10 search results: 4. 10 latest search results: 5. To find out if the current post is comment: 6. If you want to use tags in post title - please use next function instead of the_title():

    Screenshots
    none

    Faq
    none

    Other notes
    Arbitrary section
    Search options: Sphinx extended queries syntax allows the following special operators to be used: * operator OR: hello | world * operator NOT: hello -world hello !world * field search operator: @title hello @body world * phrase search operator: "hello world" * proximity search operator: "hello world"~10 Here's an example query which uses all these operators: "hello world" @title "example program"~5 @body python -(php|perl) More information about extended syntax you can find at: http://sphinxsearch.com/doc.html#extended-syntax

    The following field operators are available: @title - search in post or page title @body - search in post, page, comment body @category - search search in blog categories

    Semi live update - "main+delta" scheme: To enable semi-live index updates also known as "main+delta" scheme, the plugin will create the following table in your MySQL database:

    in MySQL
    CREATE TABLE wpsphcounter ( counterid INTEGER PRIMARY KEY NOT NULL, maxdocid INTEGER NOT NULL ); If your WordPress installation's table prefix is not "wp", substitute the correct value.

    Top and last tags: In order to be able to store search statistics the plugin will run the following SQL query during the activation process:

    in MySQL
    CREATE TABLE wp_sph_stats ( id int(11) unsigned NOT NULL autoincrement, keywords varchar(255) NOT NULL default '', dateadded datetime NOT NULL default '0000-00-00 00:00:00', keywordsfull varchar(255) NOT NULL default '', PRIMARY KEY (id), KEY keywords (keywords) ); If your WordPress installation's table prefix is not "wp", substitute the correct value.

    The plugin folder structure: ./cron - contains crontab scripts, see crontab instructions below; ./php - contains php classes and libs; ./tags - contains sphinx search tags implementation; ./templates - contains html templates, that you can change to suit more to your blog design;

    How to automatically start Sphinx search daemon at boot: In Debian based systems i.e. Ubuntu: % update-rc.d "/path/to/bin/searchd --config /path/to/etc/sphinx.conf" defaults In Redhat based systems i.e. Fedora: % chkconfig --add "/path/to/bin/searchd --config /path/to/etc/sphinx.conf"

  2. syflowers
    Member
    Posted 5 years ago #

    I think I have made some progress, at least. I'll post again if it turns out that I still need help. Thanks.

  3. taghaboy
    Member
    Posted 5 years ago #

    Hi, i hop you find a solution,
    just one question, did you ever try to use the sphinx to search in the custom fields data?
    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic