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)
version | SphinxAPI | SphinxQL | ||||
---|---|---|---|---|---|---|
0.1 | First release (very basic and not fully functional) | Raw Source | Commented Source | |||
0.2 | Made the Configuration section usuable | Raw Source | Commented Source | Live Demo | ||
0.3 | (withdrawn - had broken implementation) | Raw Source | ||||
0.4 | Added support for highlighted excerpts/snippets body in the results | Raw Source | Commented Source | |||
0.5 | support for paging! (and configuable page size) | Commented Source | Live Demo | Commented Source | Live Demo | |
0.6 | support for a single attribute - for facetted browsing! | Commented Source | Live Demo | |||
0.7 | support for multiple attributes! | Commented Source | Live Demo | |||
version | SphinxAPI | SphinxQL |