References:
Build a Custom Search Engine Using PHP
Sphinx Quick Start Guide
Test Environment
Operating System: windows xp
Database version: MYSQL Server version 5.0.45
I. Installation
For detailed installation process, refer to the Sphinx Quick Start Guide.
Ii. Test the demo provided by sphinx.
1. Import the database file example. SQL.
This file creates a ticket in the test database and inserts basic test data.
2. modify the configuration parameters of the sphworker. conf. in file and save them as the sphworker. conf file.
Modify the following parameters:
1. username and password for database connection
SQL _user = root
SQL _pass = ***** # Your own password
2. Index path
Path = E:/web/sphinx/data/test1 # change it to your own path
3. Create an index
Bin/indexer.exe is an index creation program. You can view the parameters in the command line for help.
E: \ web \ sphinx> bin \ indexer -- config sphinx. conf test1
Sph00000.9.8-release (r1371)
Copyright (c) 2001-2008, Andrew Aksyonoff
Using config file 'hsf-. conf '...
Indexing index 'test1 '...
Collected 4 docs, 0.0 MB
Sorted 0.0 Mhits, 100.0% done
Total 4 docs, 193 bytes
Total 0.127 sec, 1521.85 bytes/sec, 31.54 docs/sec
4. Enable the query daemon
E: \ web \ sphinx> bin \ searchd -- config sphinx. conf
Sph00000.9.8-release (r1371)
Copyright (c) 2001-2008, Andrew Aksyonoff
WARNING: forcing -- console mode on Windows
Using config file 'hsf-. conf '...
WARNING: index 'test1stemmed ': preload: failed to open @ CONFDIR @/data/test1stemm
Ed. fe-: No such file or directory; NOT SERVING
WARNING: index 'did1': no such local index 'test1stamp'-SKIPPING LOCAL INDE
X
Creating server socket on 0.0.0.0: 3312
Accepting connections
Enable port 3312 and modify relevant parameters.
5. query test.
Two Queries were made, ggart and another. Check with the database and the result is correct.
E: \ web \ sphworkflow> bin \ search-c sphworkflow. conf ggart
Sph00000.9.8-release (r1371)
Copyright (c) 2001-2008, Andrew Aksyonoff
Using config file 'hsf-. conf '...
Index 'test1': query 'ggart': returned 0 matches of 0 total in 0.000 sec
Words:
1. 'ggart': 0 events, 0 hits
Index 'test1stemmed ': search error: failed to open @ CONFDIR @/data/test1stemmed. s
Ph: No such file or directory.
E: \ web \ sphloud> bin \ search-c sphloud. conf another
Sph00000.9.8-release (r1371)
Copyright (c) 2001-2008, Andrew Aksyonoff
Using config file 'hsf-. conf '...
Index 'test1': query 'another ': returned 1 matches of 1 total in 0.000 sec
Displaying matches:
1. document = 3, weight = 2, group_id = 2, date_added = Tue Aug 05 17:22:06 2008
Id = 3
Group_id = 2
Group_id2 = 7
Date_added = 2008-08-05 17:22:06
Title = another doc
Content = this is another group
Words:
1. 'Another ': 1 documents, 2 hits
Index 'test1stemmed ': search error: failed to open @ CONFDIR @/data/test1stemmed. s
Ph: No such file or directory.