default search, and search context

git-svn-id: file:///home/shish/svn/shimmie2/trunk@1075 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-10-17 19:57:18 +00:00
parent c3732aaa84
commit aca9cad432
2 changed files with 10 additions and 2 deletions

View File

@ -268,11 +268,13 @@ class ThumbnailGenerationEvent extends Event {
*/ */
class SearchTermParseEvent extends Event { class SearchTermParseEvent extends Event {
var $term = null; var $term = null;
var $context = null;
var $querylet = null; var $querylet = null;
public function SearchTermParseEvent($term) { public function SearchTermParseEvent($term, $context) {
assert(!is_null($term)); assert(!is_null($term));
$this->term = $term; $this->term = $term;
$this->context = $context;
} }
public function is_querylet_set() { public function is_querylet_set() {

View File

@ -233,6 +233,12 @@ class Image {
$img_querylets = array(); $img_querylets = array();
$positive_tag_count = 0; $positive_tag_count = 0;
$stpe = new SearchTermParseEvent(null, $tags);
send_event($stpe);
if($stpe->is_querylet_set()) {
$img_querylets[] = new ImgQuerylet($stpe->get_querylet(), $positive);
}
// parse the words that are searched for into // parse the words that are searched for into
// various types of querylet // various types of querylet
foreach($terms as $term) { foreach($terms as $term) {
@ -244,7 +250,7 @@ class Image {
$term = $database->resolve_alias($term); $term = $database->resolve_alias($term);
$stpe = new SearchTermParseEvent($term); $stpe = new SearchTermParseEvent($term, $tags);
send_event($stpe); send_event($stpe);
if($stpe->is_querylet_set()) { if($stpe->is_querylet_set()) {
$img_querylets[] = new ImgQuerylet($stpe->get_querylet(), $positive); $img_querylets[] = new ImgQuerylet($stpe->get_querylet(), $positive);