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)) {
|
if (! empty($search)) {
|
||||||
$filterQuery
|
$filterQuery
|
||||||
|
// @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'))
|
||||||
|
|
@ -246,7 +247,7 @@ class SearchController extends ListDiscussionsController
|
||||||
|
|
||||||
protected function partialMatch(string $q)
|
protected function partialMatch(string $q)
|
||||||
{
|
{
|
||||||
$query = (new MatchQuery('content_partial', $q));
|
$query = (new MatchQuery('content', $q));
|
||||||
|
|
||||||
return BoolQuery::create()
|
return BoolQuery::create()
|
||||||
// Discussion titles
|
// Discussion titles
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,7 @@ class BuildCommand extends Command
|
||||||
|
|
||||||
$properties = [
|
$properties = [
|
||||||
'properties' => [
|
'properties' => [
|
||||||
'content' => ['type' => 'text', 'analyzer' => 'flarum_analyzer'],
|
'content' => ['type' => 'text', 'analyzer' => 'flarum_analyzer_partial', 'search_analyzer' => 'flarum_analyzer'],
|
||||||
'content_partial' => ['type' => 'text', 'analyzer' => 'flarum_analyzer_partial', 'search_analyzer' => 'flarum_analyzer'],
|
|
||||||
'created_at' => ['type' => 'date'],
|
'created_at' => ['type' => 'date'],
|
||||||
'updated_at' => ['type' => 'date'],
|
'updated_at' => ['type' => 'date'],
|
||||||
'is_private' => ['type' => 'boolean'],
|
'is_private' => ['type' => 'boolean'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue