Changeset 28064 for trunk/include
- Timestamp:
- Apr 3, 2014, 9:46:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_search.inc.php
r27884 r28064 310 310 { 311 311 var $is_single = true; 312 var $t oken; /* the actual word/phrase string*/312 var $term; /* the actual word/phrase string*/ 313 313 var $idx; 314 314 315 function __construct($token) 316 { 317 $this->token = $token; 315 function __construct($term) 316 { 317 $this->term = $term; 318 } 319 320 function __toString() 321 { 322 return $this->term; 318 323 } 319 324 } … … 350 355 else 351 356 { 352 $s .= $this->tokens[$i] ->token;357 $s .= $this->tokens[$i]; 353 358 } 354 359 if ($modifier & QST_QUOTED) … … 438 443 { 439 444 $crt_modifier |= QST_WILDCARD_END; 440 $ ai++;445 $qi++; 441 446 } 442 447 $this->push($crt_token, $crt_modifier); … … 458 463 if ( ($this->token_modifiers[$i]&QST_QUOTED)==0 ) 459 464 { 460 if ('not' == strtolower($token->t oken))465 if ('not' == strtolower($token->term)) 461 466 { 462 467 if ($i+1 < count($this->tokens)) 463 468 $this->token_modifiers[$i+1] |= QST_NOT; 464 $token->t oken= "";469 $token->term = ""; 465 470 } 466 if ('or' == strtolower($token->t oken))471 if ('or' == strtolower($token->term)) 467 472 { 468 473 if ($i+1 < count($this->tokens)) 469 474 $this->token_modifiers[$i+1] |= QST_OR; 470 $token->t oken= "";475 $token->term = ""; 471 476 } 472 if ('and' == strtolower($token->t oken))477 if ('and' == strtolower($token->term)) 473 478 { 474 $token->t oken= "";479 $token->term = ""; 475 480 } 476 if ( substr($token->t oken, -1)=='*' )481 if ( substr($token->term, -1)=='*' ) 477 482 { 478 $token->t oken = rtrim($token->token, '*');483 $token->term = rtrim($token->term, '*'); 479 484 $this->token_modifiers[$i] |= QST_WILDCARD_END; 480 485 } 481 486 } 482 if (!strlen($token->t oken))487 if (!strlen($token->term)) 483 488 $remove = true; 484 489 } … … 568 573 { 569 574 $token->idx = count($this->stokens); 570 $this->stokens[] = $token ->token;575 $this->stokens[] = $token; 571 576 572 577 $modifier = $expr->token_modifiers[$i]; … … 614 619 for ($i=0; $i<count($expr->stokens); $i++) 615 620 { 616 $token = $expr->stokens[$i] ;621 $token = $expr->stokens[$i]->term; 617 622 $clauses = array(); 618 623 … … 674 679 foreach ($tokens as $token) 675 680 { 676 $transliterated_tokens[] = transliterate($token );681 $transliterated_tokens[] = transliterate($token->term); 677 682 } 678 683 … … 844 849 $crt_ids = $qsr->iids[$crt->idx] = array_unique( array_merge($qsr->images_iids[$crt->idx], $qsr->tag_iids[$crt->idx]) ); 845 850 $crt_qualifies = count($crt_ids)>0 || count($qsr->tag_ids[$crt->idx])>0; 846 $crt_ignored_terms = $crt_qualifies ? array() : array($crt->t oken);851 $crt_ignored_terms = $crt_qualifies ? array() : array($crt->term); 847 852 } 848 853 else … … 921 926 { 922 927 $debug[] = $expression->stokens[$i].': '.count($qsr->tag_ids[$i]).' tags, '.count($qsr->tag_iids[$i]).' tiids, '.count($qsr->images_iids[$i]).' iiids, '.count($qsr->iids[$i]).' iids' 923 .( !empty($qsr->variants[$expression->stokens[$i] ]) ? ' variants: '.implode(', ',$qsr->variants[$expression->stokens[$i]]): '');928 .( !empty($qsr->variants[$expression->stokens[$i]->term]) ? ' variants: '.implode(', ',$qsr->variants[$expression->stokens[$i]->term]): ''); 924 929 } 925 930 $debug[] = 'before perms '.count($ids);
Note: See TracChangeset
for help on using the changeset viewer.