0

I am using sphinx and in most normal use queries it returns results as expected. One query however refuses to do so. I am using the following query code:

$cl = new SphinxClient();
$cl->SetServer( "localhost", 9312 );
$cl->SetMatchMode( SPH_MATCH_EXTENDED  );
$cl->SetRankingMode ( SPH_RANK_SPH04 );
$q = '"' . $cl->EscapeString($_REQUEST['keyword']) . ' @provider 2"/1';
$result = $cl->Query($q, 'mainIndex' );

The query ends up becoming:

"air compressor @provider 2"/1

Can anyone please explain why this query still returns results from providers with different IDs than '2'?

barryhunter
  • 20,886
  • 3
  • 30
  • 43

1 Answers1

0

Well the quorum operator, is the 'outermost' operator. All the words inside the quotes, will be words used by it. THe @ wont have any special meaning in there. So the query is the same as

"air compressor provider 2"/1

Hence, just requiring just one of those 4 words.

I wonder if you mean to do

"air compressor"/1 @provider 2

That would just do quorum on the two single keywords, and then the field syntax would work, and require '2' to match the provider.

barryhunter
  • 20,886
  • 3
  • 30
  • 43