drop partial search
This commit is contained in:
parent
8ab60b2fb8
commit
cc8145c236
|
|
@ -61,10 +61,10 @@ class SearchController extends ListDiscussionsController
|
||||||
if (! empty($search)) {
|
if (! empty($search)) {
|
||||||
$filterQuery
|
$filterQuery
|
||||||
// @todo commented out to use only partial matching for now
|
// @todo commented out to use only partial matching for now
|
||||||
// ->add($this->sentenceMatch($search))
|
->add($this->sentenceMatch($search))
|
||||||
// ->add($this->wordMatch($search, 'and'))
|
->add($this->wordMatch($search, 'and'))
|
||||||
// ->add($this->wordMatch($search, 'or'))
|
->add($this->wordMatch($search, 'or'))
|
||||||
->add($this->partialMatch($search))
|
// ->add($this->partialMatch($search))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -225,14 +225,14 @@ class SearchController extends ListDiscussionsController
|
||||||
->add(
|
->add(
|
||||||
BoolQuery::create()
|
BoolQuery::create()
|
||||||
->add(TermQuery::create('type', 'discussions'), 'filter')
|
->add(TermQuery::create('type', 'discussions'), 'filter')
|
||||||
->add($query->boost(1)),
|
->add($query->boost(2)),
|
||||||
'should'
|
'should'
|
||||||
)
|
)
|
||||||
// Post bodies
|
// Post bodies
|
||||||
->add(
|
->add(
|
||||||
BoolQuery::create()
|
BoolQuery::create()
|
||||||
->add(TermQuery::create('type', 'posts'), 'filter')
|
->add(TermQuery::create('type', 'posts'), 'filter')
|
||||||
->add($query->boost(.9)),
|
->add($query->boost(1.9)),
|
||||||
'should'
|
'should'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -242,21 +242,21 @@ class SearchController extends ListDiscussionsController
|
||||||
$query = (new MatchQuery('content', $q))
|
$query = (new MatchQuery('content', $q))
|
||||||
->operator($operator);
|
->operator($operator);
|
||||||
|
|
||||||
$boost = $operator === 'and' ? 1 : .5;
|
$boost = $operator === 'and' ? 1 : .8;
|
||||||
|
|
||||||
return BoolQuery::create()
|
return BoolQuery::create()
|
||||||
// Discussion titles
|
// Discussion titles
|
||||||
->add(
|
->add(
|
||||||
BoolQuery::create()
|
BoolQuery::create()
|
||||||
->add(TermQuery::create('type', 'discussions'), 'filter')
|
->add(TermQuery::create('type', 'discussions'), 'filter')
|
||||||
->add($query->boost($boost * 1.2)),
|
->add($query->boost($boost * 1.8)),
|
||||||
'should'
|
'should'
|
||||||
)
|
)
|
||||||
// Post bodies
|
// Post bodies
|
||||||
->add(
|
->add(
|
||||||
BoolQuery::create()
|
BoolQuery::create()
|
||||||
->add(TermQuery::create('type', 'posts'), 'filter')
|
->add(TermQuery::create('type', 'posts'), 'filter')
|
||||||
->add($query->boost($boost * 1.1)),
|
->add($query->boost($boost * 1.8)),
|
||||||
'should'
|
'should'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -270,7 +270,7 @@ class SearchController extends ListDiscussionsController
|
||||||
->add(
|
->add(
|
||||||
BoolQuery::create()
|
BoolQuery::create()
|
||||||
->add(TermQuery::create('type', 'discussions'), 'filter')
|
->add(TermQuery::create('type', 'discussions'), 'filter')
|
||||||
->add(clone $query->boost(2)),
|
->add(clone $query->boost(1.6)),
|
||||||
'should'
|
'should'
|
||||||
)
|
)
|
||||||
// Post bodies
|
// Post bodies
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue