Created
November 29, 2011 23:29
-
-
Save ruckus/1407145 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Docs: http://us3.php.net/manual/en/class.sphinxclient.php | |
| $s = new SphinxClient; | |
| $s->setServer("127.0.0.1", 3312); | |
| $s->setMatchMode(SPH_MATCH_EXTENDED); | |
| echo "\nsearch all indexes across all fields for \"wave\"\n"; | |
| $result = $s->query("wave", "*"); | |
| print_r($result); | |
| echo "\n-------------------------------------------------------------------\n"; | |
| echo "\nsearch the media_items and posts indexes across all fields for \"wave\"\n"; | |
| $result = $s->query("wave", "media_items,posts"); | |
| print_r($result); | |
| echo "\n-------------------------------------------------------------------\n"; | |
| echo "\n\nsearch the users index for all fields for \"josh\"\n"; | |
| $result = $s->query("josh", "users"); | |
| print_r($result); | |
| echo "\n-------------------------------------------------------------------\n"; | |
| echo "\nusers firstName field for \"josh\"\n"; | |
| $result = $s->query("@firstName josh", "users"); | |
| print_r($result); | |
| echo "\n-------------------------------------------------------------------\n"; | |
| echo "\nusers firstName field for \"josh\" and @lastName field of bobcat \n"; | |
| $result = $s->query("@firstName josh @lastName bobcat", "users"); | |
| print_r($result); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment