Sphinx ignores ranking, always sorts in the same order
===

I have sphinx index on `schools`, and when I do a query I always receive the same results, in the same order. I've tried every imaginable combination of ranking, sorting, and matching, and always get the same sorting.

A sample of the bad data I'm getting is below:

	"albany high"
	
	Albany Junior High School | Auckland, NZ | 2001 (shouldn't be first)
	Albany High School        | Albany, NY   | 2001
	South Albany High School  | Albany, OR   | 2001
	Albany High School        | Albany, CA   | 1001 (shouldn't be last)

As you can see, the highest-ranked school is not in a city named "Albany", and should be lower, while the lowest-ranked "Albany High School" should be ranked higher than it is. This problem is replicated across many search terms.

The Sphinx index looks like this:

    source schools : root
	{
		sql_query = \
			SELECT schools.id, schools.name, schools.state, schools.country, schools.city, \
			(select COUNT(*) from user2school WHERE school_id = schools.id) as user_count \
			FROM schools

		sql_attr_uint		= user_count
	}

	index schools
	{
		charset_type			= utf-8
		charset_table			= <?php echo file_get_contents(__DIR__.'/sphinx-charset.conf') ?>
		docinfo					= extern
		source					= schools
		path					= /var/db/sphinx/data/schools
		min_infix_len			= 3
		infix_fields			= name
	}




The code that generates the results is as follows:


	$sphinx->SetSelect('@weight');

	$sphinx->SetMatchMode(SPH_MATCH_EXTENDED);
	$sphinx->SetRankingMode(SPH_RANK_WORDCOUNT);
	$sphinx->SetSortMode(SPH_SORT_RELEVANCE);

	$sphinx->SetFieldWeights(array(
		'id' => 0,
		'name' => 1000,
		'city' => 0,
		'state' => 0,
		'user_count' => 0
	));



How can I get Sphinx to recognize my custom weights? Every combination I've tried seems to fail.