Skip to content

Commit 852155a

Browse files
committed
minor tweaks
1 parent 6245d98 commit 852155a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

examples/custom.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
var_dump($terms);
2828

2929
// #3
30-
$q = '"security council" ding -code:A/RES/*';
30+
$q = '"security council" +africa tag:malaria code:A/RES/*';
3131
require 'phpSolrQueryTermCustom.php';
3232
require 'Exception.php';
3333
require 'HttpTransportException.php';

examples/phpSolrQueryTermCustom.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ protected function processTerm($term) {
2323
break;
2424
case 'tag':
2525
$field = 'tag_ids';
26+
/*
2627
$q = Doctrine_Query::create()
2728
->select('t.id')
2829
->from('Tag t')
2930
->where('t.name = ?', array($term));
3031
$term = $q->execute(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);
32+
*/
33+
$term = rand(1, 100);
3134
break;
3235
default:
3336
throw new Exception('Unsupported field: '.$field);
3437
}
35-
$this->criteria->addField($prefix.$field, $term, $op);
38+
$this->criteria->addField($prefix.$field, $term, $op, true);
3639
return;
3740
}
3841
$term = parent::processTerm($term);

0 commit comments

Comments
 (0)