Skip to content

Set indexer name method#39

Open
adriaroca wants to merge 1 commit intosngrl:masterfrom
adriaroca:SS-add-set-index-name-method
Open

Set indexer name method#39
adriaroca wants to merge 1 commit intosngrl:masterfrom
adriaroca:SS-add-set-index-name-method

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