Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set indexer name method #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adriaroca
Copy link

@adriaroca adriaroca commented Jun 27, 2018

I create a new method to set the index name, specialy when the devoloper don't need the 'search' method, only 'query'.

In 'query' method, SphinxSearch use the first indexer specified in the configuration file. With this method, the developer can specify the indexer that is needed.

Example:

$sphinx = new SphinxSearch();
$sphinx->setMatchMode(\Sphinx\SphinxClient::SPH_MATCH_FULLSCAN);
$sphinx->setFilterFloatRange('@geodist', 0.0, $circle);
$sphinx->setSortMode(SphinxClient::SPH_SORT_ATTR_ASC, '@geodist');
$sphinx->setGeoAnchor('lat', 'lng', $lat, $lng);
$sphinx->limit(5000);
$sphinx->setIndexName('insurance_centers');
$results = $sphinx->query();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant