mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 06:27:15 +00:00
check if query term already has a trailing '*'
This commit is contained in:
parent
416568f1c4
commit
e69f7125bc
|
@ -72,8 +72,10 @@ class SeedDMS_Lucene_Search {
|
||||||
*/
|
*/
|
||||||
function search($term, $fields=array(), $limit=array()) { /* {{{ */
|
function search($term, $fields=array(), $limit=array()) { /* {{{ */
|
||||||
$querystr = '';
|
$querystr = '';
|
||||||
if($term)
|
$term = trim($term);
|
||||||
$querystr .= trim($term);
|
if($term) {
|
||||||
|
$querystr = substr($term, -1) != '*' ? $term.'*' : $term;
|
||||||
|
}
|
||||||
if(!empty($fields['owner'])) {
|
if(!empty($fields['owner'])) {
|
||||||
if(is_string($owner)) {
|
if(is_string($owner)) {
|
||||||
if($querystr)
|
if($querystr)
|
||||||
|
|
|
@ -72,8 +72,10 @@ class SeedDMS_SQliteFTS_Search {
|
||||||
*/
|
*/
|
||||||
function search($term, $fields=array(), $limit=array()) { /* {{{ */
|
function search($term, $fields=array(), $limit=array()) { /* {{{ */
|
||||||
$querystr = '';
|
$querystr = '';
|
||||||
if($term)
|
$term = trim($term);
|
||||||
$querystr .= trim($term);
|
if($term) {
|
||||||
|
$querystr = substr($term, -1) != '*' ? $term.'*' : $term;
|
||||||
|
}
|
||||||
if(!empty($fields['owner'])) {
|
if(!empty($fields['owner'])) {
|
||||||
if(is_string($fields['owner'])) {
|
if(is_string($fields['owner'])) {
|
||||||
if($querystr)
|
if($querystr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user