fix count paragraph search
This commit is contained in:
parent
e4b891bed6
commit
16703c9cea
@ -32,7 +32,7 @@ $STOP_WORDS = ['a', 'un', 'una', 'unas', 'unos', 'uno', 'sobre', 'todo',
|
|||||||
'trabajas', 'trabaja', 'trabajamos', 'trabajais', 'trabajan', 'podria',
|
'trabajas', 'trabaja', 'trabajamos', 'trabajais', 'trabajan', 'podria',
|
||||||
'podrias', 'podriamos', 'podrian', 'podriais', 'yo', 'aquel'];
|
'podrias', 'podriamos', 'podrian', 'podriais', 'yo', 'aquel'];
|
||||||
|
|
||||||
$DESCRIPTION_LENGTH = 20;
|
$DESCRIPTION_LENGTH = 25;
|
||||||
$HALF_DESCRIPTION_LENGTH = floor($DESCRIPTION_LENGTH / 2);
|
$HALF_DESCRIPTION_LENGTH = floor($DESCRIPTION_LENGTH / 2);
|
||||||
|
|
||||||
$web_content = json_decode(file_get_contents('tipuesearch_content.json'), true);
|
$web_content = json_decode(file_get_contents('tipuesearch_content.json'), true);
|
||||||
@ -158,7 +158,7 @@ if (isset($_GET['q'])) {
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
echo '<div class="tipue_search_content_text">';
|
echo '<div class="tipue_search_content_text">';
|
||||||
for ($i = 0; $i < $description_words_count - floor($description_words_count/2); $i++) {
|
for ($i = 0; $i < $DESCRIPTION_LENGTH; $i++) {
|
||||||
echo $description_words[$i] . ' ';
|
echo $description_words[$i] . ' ';
|
||||||
}
|
}
|
||||||
if ($description_words_count > $DESCRIPTION_LENGTH) {
|
if ($description_words_count > $DESCRIPTION_LENGTH) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user