Chapter 4. Searching

In the previous chapter we learned how to create indexes. Now let's see how to search those indexes from within your applications.

In this chapter we will learn how to use the Sphinx API to issue search queries from your PHP applications. We will examine different query syntaxes and learn about weighting, sorting, and grouping our search results.

We will be using the indexes created in Chapter 3, Indexing and write search queries to search those indexes.

Client API implementations for Sphinx

Sphinx comes with a number of native searchd client API implementations. At the time of writing this book, Sphinx came with PHP, Python, and Java implementations. Some third-party open source implementations for Perl, Ruby, and C++ are also available.

All APIs provide the same set of methods and they implement the same network protocol. As a result, they more or less all work in a similar fashion, they all work in a similar fashion.

Note

All examples in this chapter are for PHP implementation of the Sphinx API. However, you can just as easily use other programming languages.

Sphinx is used with PHP more widely than any other language.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset