Sphinx-PHP Front-End Demo Code

Below is links to PHP examples of a simple search front end for a sphinxsearch index. This connects to sphinx, and runs the user entered query, and displays the results in HTML.

While they are functional pretty much as is, they are intended more as a demo how to implement a search front end, using a sphinx powered full-text index over a mysql database. They are all the same basic application, just gets more complicated as features are added. Start with the early versions first, as they are easier to understand.

Note: The live demos, is the exact code, just putting details of a real mysql database, and sphinx index in the CONF settings.

One thing that might not be clear here, the facetting support in 0.6+ ONLY supports singluar attribute facetting, where the number/string in the attribute is used directly and shown to the user. Does NOT support MVA attributes, NOR where the actual value has to be looked up in the database (eg the attribute just a id key)

0.1First release (very basic and not fully functional)Raw SourceCommented Source
0.2Made the Configuration section usuableRaw SourceCommented SourceLive Demo
0.3(withdrawn - had broken implementation)Raw Source
0.4Added support for highlighted excerpts/snippets body in the resultsRaw SourceCommented Source
0.5support for paging! (and configuable page size)Commented SourceLive DemoCommented SourceLive Demo
0.6support for a single attribute - for facetted browsing!Commented SourceLive Demo
0.7support for multiple attributes!Commented SourceLive Demo

If you want to support my work, Support nearby.org.uk