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
1e29566e
Commit
1e29566e
authored
Jul 28, 2016
by
Dominik Hebeler
Browse files
Merge branch 'Bugfix' into 'development'
Bugfix See merge request
!204
parents
3a977f25
826edf40
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/MetaGer.php
View file @
1e29566e
...
...
@@ -696,9 +696,19 @@ class MetaGer
}
# Meldung über eine Phrasensuche
if
(
preg_match
(
"/
\"
(.+)
\"
/si"
,
$this
->
q
,
$match
)){
$this
->
warnings
[]
=
"Sie führen eine Phrasensuche durch:
\"
"
.
$match
[
1
]
.
"
\"
"
;
$p
=
""
;
$tmp
=
$this
->
q
;
while
(
preg_match
(
"/(.*)
\"
(.+)
\"
(.*)/si"
,
$tmp
,
$match
)){
$tmp
=
$match
[
1
]
.
$match
[
3
];
$this
->
phrases
[]
=
strtolower
(
$match
[
2
]);
}
foreach
(
$this
->
phrases
as
$phrase
)
{
$p
.
=
"
\"
$phrase
\"
, "
;
}
$p
=
rtrim
(
$p
,
", "
);
if
(
sizeof
(
$this
->
phrases
)
>
0
)
$this
->
warnings
[]
=
"Sie führen eine Phrasensuche durch:
$p
"
;
}
public
function
getFokus
()
...
...
@@ -750,6 +760,11 @@ class MetaGer
return
$this
->
category
;
}
public
function
getPhrases
()
{
return
$this
->
phrases
;
}
public
function
getSumaFile
()
{
return
$this
->
sumaFile
;
...
...
app/Models/Result.php
View file @
1e29566e
...
...
@@ -180,6 +180,14 @@ class Result
}
}
# Die Strinsuche:
$text
=
strtolower
(
$this
->
titel
)
.
" "
.
strtolower
(
$this
->
descr
);
foreach
(
$metager
->
getPhrases
()
as
$phrase
)
{
if
(
strpos
(
$text
,
$phrase
)
===
FALSE
)
return
false
;
}
# Abschließend noch 2 Überprüfungen. Einmal den Host filter, der Sicherstellt, dass von jedem Host maximal 3 Links angezeigt werden
# und dann noch den Dublettefilter, der sicher stellt, dass wir nach Möglichkeit keinen Link doppelt in der Ergebnisliste haben
# Diese Überprüfung führen wir unter bestimmten Bedingungen nicht durch:
...
...
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