Reputation: 586
I need to search multiple exact keyword matches in Sphinx Search (PHP). For instance, I have the keywords (note that these are queried all at once):
"facebook user" "google plus member" "myspace fan"
The results should be able to return exact matches for each keyword above all combined in one result.
An example of the results I want it to show is:
Notice that each result above have exact matches with any of the 3 keywords used. Somehow when I tried it in Sphinx, it doesn't work. Here's my code in PHP:
$sphinx->setMatchMode( SPH_MATCH_EXTENDED2 );
$sphinx->query( '"facebook user" "google plus member" "myspace fan"' );
What I did is to add quotes to each keyword to denote that I'm searching for exact matches, and just simply separated each keyword by spaces. Apparently, this doesn't work, so I need a good way to solve this.
Please help me with this, I'm not yet very familiar with Sphinx Search though. Thanks!
Upvotes: 0
Views: 1982
Reputation: 1719
Checkout Extended query syntax. In your case you need | (OR) operator between phrases.
Upvotes: 1