fix partial matching and weighting
This commit is contained in:
parent
502f7a9f86
commit
803d1ecfc5
|
|
@ -56,6 +56,7 @@ class SearchController extends ListDiscussionsController
|
|||
|
||||
if (! empty($search)) {
|
||||
$filterQuery
|
||||
// @todo commented out to use only partial matching for now
|
||||
// ->add($this->sentenceMatch($search))
|
||||
// ->add($this->wordMatch($search, 'and'))
|
||||
// ->add($this->wordMatch($search, 'or'))
|
||||
|
|
@ -246,7 +247,7 @@ class SearchController extends ListDiscussionsController
|
|||
|
||||
protected function partialMatch(string $q)
|
||||
{
|
||||
$query = (new MatchQuery('content_partial', $q));
|
||||
$query = (new MatchQuery('content', $q));
|
||||
|
||||
return BoolQuery::create()
|
||||
// Discussion titles
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ class BuildCommand extends Command
|
|||
|
||||
$properties = [
|
||||
'properties' => [
|
||||
'content' => ['type' => 'text', 'analyzer' => 'flarum_analyzer'],
|
||||
'content_partial' => ['type' => 'text', 'analyzer' => 'flarum_analyzer_partial', 'search_analyzer' => 'flarum_analyzer'],
|
||||
'content' => ['type' => 'text', 'analyzer' => 'flarum_analyzer_partial', 'search_analyzer' => 'flarum_analyzer'],
|
||||
'created_at' => ['type' => 'date'],
|
||||
'updated_at' => ['type' => 'date'],
|
||||
'is_private' => ['type' => 'boolean'],
|
||||
|
|
|
|||
Loading…
Reference in New Issue