timewasted / Search-SphinxsearchBundle

Sphinx search bundle for Symfony 2.
http://sphinxsearch.com/
BSD 2-Clause "Simplified" License
40 stars 33 forks source link

Changed SphinxSearchBundle->search() to match API #4

Closed chrisapl closed 12 years ago

chrisapl commented 12 years ago

I have changed the search function to match the intended SphinxAPI behavior.

Previously when you searched multiple indexes with: $indexes = array( 'All_Items' => array( 'result_offset' => 0, 'result_limit' => 1000 ), 'All_Items_Delta' => array( 'result_offset' => 0, 'result_limit' => 1000 ) );

$result = $sphinxsearch->search($search_str,$indexes);

It executed SphinxAPI->query() once for each index and saved the results to a named array. This means advanced functionality like kill-lists do not work.

I have changed it so it now executes SphinxAPI->query() once with both indexes and my kill-list now works as intended which means I can have a delta index of updates and a full index but, not have results from the full index returned if that document exists in delta index (the delta being the latest version).

If someone wanted to execute a search on two different indexes independently I would expect they run SphinxSearchBundle->search() twice.

Anyhow fix my problem, not sure if you want to include it in the bundle.

Cheers for all your hard work, made it much easier for me to integrate Sphinx and Symfony2 thats for sure!