Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
df64d556
Commit
df64d556
authored
Jun 08, 2016
by
Dominik Hebeler
Browse files
Bugfix bei dem es einen Fehler während des Rankings gab
parent
f3b711b6
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
app/Models/Result.php
View file @
df64d556
...
...
@@ -105,13 +105,17 @@ class Result
foreach
(
explode
(
" "
,
trim
(
$tmpEingabe
))
as
$el
)
{
$el
=
preg_quote
(
$el
,
"/"
);
if
(
strlen
(
$tmpTitle
)
>
0
)
{
if
(
preg_match
(
"/\b
$el
\b/si"
,
$tmpTitle
))
{
$tmpRank
+=
.7
*
.6
*
$maxRank
;
}
elseif
(
strpos
(
$tmpTitle
,
$el
)
!==
false
)
{
$tmpRank
+=
.3
*
.6
*
$maxRank
;
}
}
if
(
strlen
(
$tmpDescription
)
>
0
)
{
if
(
preg_match
(
"/\b
$el
\b/si"
,
$tmpDescription
))
{
$tmpRank
+=
.7
*
.4
*
$maxRank
;
...
...
@@ -119,6 +123,7 @@ class Result
$tmpRank
+=
.3
*
.4
*
$maxRank
;
}
}
}
$tmpRank
/=
sizeof
(
explode
(
" "
,
trim
(
$tmpEingabe
)))
*
10
;
$rank
+=
$tmpRank
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment