Version Description
- Relevanssi had a bug that lead to inflated relevancy scores for posts.
- Relevanssi can now index the human-readable labels of ACF "select" fields. (Thanks to Raphal Droz.)
- New filter:
relevanssi_30days
can be used to adjust the 30 day logs to a different number of days. - Adding stopwords that contain apostrophes didn't work.
- Ensured PHP7 and WP 4.6 compatibility.
- Fixed a small glitch that could happen if a highlighted term is next to a starting square bracket.
Download this release
Release Info
Developer | msaari |
Plugin | Relevanssi – A Better Search |
Version | 3.5.4 |
Comparing to | |
See all releases |
Code changes from version 3.5.3 to 3.5.4
- lib/cache.php +0 -77
- lib/common.php +4 -5
- lib/excerpts-highlights.php +58 -46
- lib/indexing.php +75 -58
- lib/init.php +6 -0
- lib/interface.php +152 -148
- lib/search.php +83 -82
- readme.txt +26 -12
- relevanssi-de_DE.mo +0 -0
- relevanssi-de_DE.po +212 -239
- relevanssi.php +4 -3
lib/cache.php
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function relevanssi_purge_excerpt_cache($post) {
|
4 |
-
global $wpdb, $relevanssi_variables;
|
5 |
-
|
6 |
-
$wpdb->query("DELETE FROM " . $relevanssi_variables['relevanssi_excerpt_cache'] . " WHERE post = $post");
|
7 |
-
}
|
8 |
-
|
9 |
-
function relevanssi_fetch_excerpt($post, $query) {
|
10 |
-
global $wpdb, $relevanssi_variables;
|
11 |
-
|
12 |
-
$query = mysql_real_escape_string($query);
|
13 |
-
$excerpt = $wpdb->get_var("SELECT excerpt FROM " . $relevanssi_variables['relevanssi_excerpt_cache'] . " WHERE post = $post AND query = '$query'");
|
14 |
-
|
15 |
-
if (!$excerpt) return null;
|
16 |
-
|
17 |
-
return $excerpt;
|
18 |
-
}
|
19 |
-
|
20 |
-
function relevanssi_store_excerpt($post, $query, $excerpt) {
|
21 |
-
global $wpdb, $relevanssi_variables;
|
22 |
-
|
23 |
-
$query = mysql_real_escape_string($query);
|
24 |
-
$excerpt = mysql_real_escape_string($excerpt);
|
25 |
-
|
26 |
-
$wpdb->query("INSERT INTO " . $relevanssi_variables['relevanssi_excerpt_cache'] . " (post, query, excerpt)
|
27 |
-
VALUES ($post, '$query', '$excerpt')
|
28 |
-
ON DUPLICATE KEY UPDATE excerpt = '$excerpt'");
|
29 |
-
}
|
30 |
-
|
31 |
-
function relevanssi_fetch_hits($param) {
|
32 |
-
global $wpdb, $relevanssi_variables;
|
33 |
-
|
34 |
-
$time = get_option('relevanssi_cache_seconds', 172800);
|
35 |
-
|
36 |
-
$hits = $wpdb->get_var("SELECT hits FROM " . $relevanssi_variables['relevanssi_cache'] . " WHERE param = '$param' AND UNIX_TIMESTAMP() - UNIX_TIMESTAMP(tstamp) < $time");
|
37 |
-
|
38 |
-
if ($hits) {
|
39 |
-
return unserialize($hits);
|
40 |
-
}
|
41 |
-
else {
|
42 |
-
return null;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
function relevanssi_store_hits($param, $data) {
|
47 |
-
global $wpdb, $relevanssi_variables;
|
48 |
-
|
49 |
-
$param = mysql_real_escape_string($param);
|
50 |
-
$data = mysql_real_escape_string($data);
|
51 |
-
$wpdb->query("INSERT INTO " . $relevanssi_variables['relevanssi_cache'] . " (param, hits)
|
52 |
-
VALUES ('$param', '$data')
|
53 |
-
ON DUPLICATE KEY UPDATE hits = '$data'");
|
54 |
-
}
|
55 |
-
|
56 |
-
function relevanssi_truncate_cache($all = false) {
|
57 |
-
global $wpdb, $relevanssi_variables;
|
58 |
-
$relevanssi_excerpt_cache = $relevanssi_variables['relevanssi_excerpt_cache'];
|
59 |
-
$relevanssi_cache = $relevanssi_variables['relevanssi_cache'];
|
60 |
-
|
61 |
-
if ($all) {
|
62 |
-
$query = "TRUNCATE TABLE $relevanssi_excerpt_cache";
|
63 |
-
$wpdb->query($query);
|
64 |
-
|
65 |
-
$query = "TRUNCATE TABLE $relevanssi_cache";
|
66 |
-
}
|
67 |
-
else {
|
68 |
-
$time = get_option('relevanssi_cache_seconds', 172800);
|
69 |
-
$query = "DELETE FROM $relevanssi_cache
|
70 |
-
WHERE UNIX_TIMESTAMP() - UNIX_TIMESTAMP(tstamp) > $time";
|
71 |
-
// purge all expired cache data
|
72 |
-
}
|
73 |
-
$wpdb->query($query);
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/common.php
CHANGED
@@ -706,11 +706,10 @@ function relevanssi_get_the_title($post_id) {
|
|
706 |
}
|
707 |
|
708 |
function relevanssi_update_doc_count( $values, $post ) {
|
709 |
-
$
|
710 |
-
$
|
711 |
-
|
712 |
-
|
713 |
-
}
|
714 |
return $values;
|
715 |
}
|
716 |
|
706 |
}
|
707 |
|
708 |
function relevanssi_update_doc_count( $values, $post ) {
|
709 |
+
global $wpdb, $relevanssi_variables;
|
710 |
+
$relevanssi_table = $relevanssi_variables['relevanssi_table'];
|
711 |
+
$D = $wpdb->get_var("SELECT COUNT(DISTINCT(relevanssi.doc)) FROM $relevanssi_table AS relevanssi");
|
712 |
+
update_option( 'relevanssi_doc_count', $D);
|
|
|
713 |
return $values;
|
714 |
}
|
715 |
|
lib/excerpts-highlights.php
CHANGED
@@ -24,20 +24,21 @@ function relevanssi_do_excerpt($t_post, $query) {
|
|
24 |
// These shortcodes cause problems with Relevanssi excerpts
|
25 |
remove_shortcode('layerslider');
|
26 |
remove_shortcode('responsive-flipbook');
|
27 |
-
|
|
|
28 |
$content = apply_filters('relevanssi_pre_excerpt_content', $post->post_content, $post, $query);
|
29 |
$content = apply_filters('the_content', $content);
|
30 |
$content = apply_filters('relevanssi_excerpt_content', $content, $post, $query);
|
31 |
-
|
32 |
$content = relevanssi_strip_invisibles($content); // removes <script>, <embed> &c with content
|
33 |
$content = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $content); // add spaces between tags to avoid getting words stuck together
|
34 |
$content = strip_tags($content, get_option('relevanssi_excerpt_allowable_tags', '')); // this removes the tags, but leaves the content
|
35 |
-
|
36 |
$content = preg_replace("/\n\r|\r\n|\n|\r/", " ", $content);
|
37 |
// $content = trim(preg_replace("/\s\s+/", " ", $content));
|
38 |
-
|
39 |
$query = relevanssi_add_synonyms($query);
|
40 |
-
|
41 |
$excerpt_data = relevanssi_create_excerpt($content, $terms, $query);
|
42 |
|
43 |
if (get_option("relevanssi_index_comments") != 'none') {
|
@@ -64,7 +65,7 @@ function relevanssi_do_excerpt($t_post, $query) {
|
|
64 |
|
65 |
$start = $excerpt_data[2];
|
66 |
|
67 |
-
$excerpt = $excerpt_data[0];
|
68 |
$excerpt = trim($excerpt);
|
69 |
$excerpt = apply_filters('relevanssi_excerpt', $excerpt);
|
70 |
|
@@ -92,7 +93,7 @@ function relevanssi_do_excerpt($t_post, $query) {
|
|
92 |
if (!empty($excerpt))
|
93 |
$excerpt = $excerpt . $ellipsis;
|
94 |
}
|
95 |
-
|
96 |
if (relevanssi_s2member_level($post->ID) == 1) $excerpt = $post->post_excerpt;
|
97 |
|
98 |
if ($old_global_post != NULL) $post = $old_global_post;
|
@@ -127,14 +128,14 @@ function relevanssi_create_excerpt($content, $terms, $query) {
|
|
127 |
$non_phrase_terms[] = $term;
|
128 |
}
|
129 |
}
|
130 |
-
|
131 |
$terms = $non_phrase_terms;
|
132 |
$terms[$phrase] = 1;
|
133 |
}
|
134 |
|
135 |
// longest search terms first, because those are generally more significant
|
136 |
uksort($terms, 'relevanssi_strlen_sort');
|
137 |
-
|
138 |
$start = false;
|
139 |
if ("chars" == $type) {
|
140 |
$prev_count = floor($excerpt_length / 2);
|
@@ -143,28 +144,28 @@ function relevanssi_create_excerpt($content, $terms, $query) {
|
|
143 |
else {
|
144 |
$words = explode(' ', $content);
|
145 |
$i = 0;
|
146 |
-
|
147 |
while ($i < count($words)) {
|
148 |
if ($i + $excerpt_length > count($words)) {
|
149 |
$i = count($words) - $excerpt_length;
|
150 |
if ($i < 0) $i = 0;
|
151 |
}
|
152 |
-
|
153 |
$excerpt_slice = array_slice($words, $i, $excerpt_length);
|
154 |
$excerpt_slice = implode(' ', $excerpt_slice);
|
155 |
|
156 |
$excerpt_slice = " $excerpt_slice";
|
157 |
$term_hits = 0;
|
158 |
$count = relevanssi_count_matches(array_keys($terms), $excerpt_slice);
|
159 |
-
|
160 |
if ($count > 0 && $count > $best_excerpt_term_hits) {
|
161 |
$best_excerpt_term_hits = $count;
|
162 |
$excerpt = $excerpt_slice;
|
163 |
}
|
164 |
-
|
165 |
$i += $excerpt_length;
|
166 |
}
|
167 |
-
|
168 |
if ("" == $excerpt) {
|
169 |
$excerpt = explode(' ', $content, $excerpt_length);
|
170 |
array_pop($excerpt);
|
@@ -185,11 +186,11 @@ function relevanssi_highlight_in_docs($content) {
|
|
185 |
$referrer = preg_replace('@(http|https)://@', '', stripslashes(urldecode($_SERVER['HTTP_REFERER'])));
|
186 |
$args = explode('?', $referrer);
|
187 |
$query = array();
|
188 |
-
|
189 |
if ( count( $args ) > 1 )
|
190 |
parse_str( $args[1], $query );
|
191 |
-
|
192 |
-
if (stripos($referrer, $_SERVER['SERVER_NAME']) !== false) {
|
193 |
// Local search
|
194 |
if (isset($query['s'])) {
|
195 |
$q = relevanssi_add_synonyms($query['s']);
|
@@ -203,7 +204,7 @@ function relevanssi_highlight_in_docs($content) {
|
|
203 |
}
|
204 |
}
|
205 |
}
|
206 |
-
|
207 |
return $content;
|
208 |
}
|
209 |
|
@@ -212,7 +213,7 @@ function relevanssi_highlight_terms($excerpt, $query) {
|
|
212 |
if ("none" == $type) {
|
213 |
return $excerpt;
|
214 |
}
|
215 |
-
|
216 |
switch ($type) {
|
217 |
case "mark": // thanks to Jeff Byrnes
|
218 |
$start_emp = "<mark>";
|
@@ -253,16 +254,16 @@ function relevanssi_highlight_terms($excerpt, $query) {
|
|
253 |
default:
|
254 |
return $excerpt;
|
255 |
}
|
256 |
-
|
257 |
-
$start_emp_token = "**[";
|
258 |
-
$end_emp_token = "]**";
|
259 |
|
260 |
if ( function_exists('mb_internal_encoding') )
|
261 |
mb_internal_encoding("UTF-8");
|
262 |
|
263 |
-
do_action('relevanssi_highlight_tokenize');
|
264 |
$terms = array_keys(relevanssi_tokenize($query, $remove_stopwords = true, $min_word_length = -1));
|
265 |
-
|
266 |
if (is_array($query)) $query = implode(' ', $query); // just in case
|
267 |
$phrases = relevanssi_extract_phrases(stripslashes($query));
|
268 |
|
@@ -284,22 +285,24 @@ function relevanssi_highlight_terms($excerpt, $query) {
|
|
284 |
foreach ($terms as $term) {
|
285 |
// $pr_term = relevanssi_replace_punctuation(preg_quote($term, '/'));
|
286 |
$pr_term = preg_quote($term, '/');
|
287 |
-
|
288 |
$undecoded_excerpt = $excerpt;
|
289 |
$excerpt = html_entity_decode($excerpt);
|
290 |
-
|
291 |
if ($word_boundaries) {
|
292 |
// get_option('relevanssi_fuzzy') != 'none' ? $regex = "/($pr_term)(?!(^&+)?(;))/iu" : $regex = "/(\b$pr_term|$pr_term\b)(?!(^&+)?(;))/iu";
|
293 |
-
get_option('relevanssi_fuzzy') != 'none' ? $regex = "/(\b$pr_term|$pr_term\b)(?!(^&+)?(;))/iu" : $regex = "/(\b$pr_term\b)(?!(^&+)?(;))/iu";
|
294 |
-
|
|
|
295 |
$excerpt = preg_replace($regex, $start_emp_token . '\\1' . $end_emp_token, $excerpt);
|
296 |
if (empty($excerpt)) $excerpt = preg_replace($regex, $start_emp_token . '\\1' . $end_emp_token, $undecoded_excerpt);
|
297 |
}
|
298 |
else {
|
299 |
-
|
300 |
-
|
|
|
301 |
}
|
302 |
-
|
303 |
$preg_start = preg_quote($start_emp_token);
|
304 |
$preg_end = preg_quote($end_emp_token);
|
305 |
|
@@ -312,6 +315,15 @@ function relevanssi_highlight_terms($excerpt, $query) {
|
|
312 |
}
|
313 |
}
|
314 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
if (preg_match_all('/<(style|script|object|embed)>.*<\/(style|script|object|embed)>/U', $excerpt, $matches) > 0) {
|
316 |
// Remove highlights in style, object, embed and script tags
|
317 |
foreach ($matches as $match) {
|
@@ -321,7 +333,7 @@ function relevanssi_highlight_terms($excerpt, $query) {
|
|
321 |
}
|
322 |
}
|
323 |
}
|
324 |
-
|
325 |
$excerpt = relevanssi_remove_nested_highlights($excerpt, $start_emp_token, $end_emp_token);
|
326 |
|
327 |
/*
|
@@ -349,12 +361,12 @@ function relevanssi_replace_punctuation($a) {
|
|
349 |
function relevanssi_remove_nested_highlights($s, $a, $b) {
|
350 |
$offset = 0;
|
351 |
$string = "";
|
352 |
-
$bits = explode($a, $s);
|
353 |
$new_bits = array($bits[0]);
|
354 |
$in = false;
|
355 |
for ($i = 1; $i < count($bits); $i++) {
|
356 |
if ($bits[$i] == '') continue;
|
357 |
-
|
358 |
if (!$in) {
|
359 |
array_push($new_bits, $a);
|
360 |
$in = true;
|
@@ -377,7 +389,7 @@ function relevanssi_remove_nested_highlights($s, $a, $b) {
|
|
377 |
array_push($new_bits, $bits[$i]);
|
378 |
}
|
379 |
$whole = implode('', $new_bits);
|
380 |
-
|
381 |
return $whole;
|
382 |
}
|
383 |
|
@@ -387,7 +399,7 @@ function relevanssi_remove_nested_highlights($s, $a, $b) {
|
|
387 |
*/
|
388 |
|
389 |
// find the locations of each of the words
|
390 |
-
// Nothing exciting here. The array_unique is required
|
391 |
// unless you decide to make the words unique before passing in
|
392 |
function relevanssi_extract_locations($words, $fulltext) {
|
393 |
$locations = array();
|
@@ -430,23 +442,23 @@ function relevanssi_count_matches($words, $fulltext) {
|
|
430 |
}
|
431 |
|
432 |
// Work out which is the most relevant portion to display
|
433 |
-
// This is done by looping over each match and finding the smallest distance between two found
|
434 |
-
// strings. The idea being that the closer the terms are the better match the snippet would be.
|
435 |
-
// When checking for matches we only change the location if there is a better match.
|
436 |
-
// The only exception is where we have only two matches in which case we just take the
|
437 |
// first as will be equally distant.
|
438 |
function relevanssi_determine_snip_location($locations, $prevcount) {
|
439 |
if (!is_array($locations) || empty($locations)) return 0;
|
440 |
|
441 |
// If we only have 1 match we dont actually do the for loop so set to the first
|
442 |
-
$startpos = $locations[0];
|
443 |
$loccount = count($locations);
|
444 |
-
$smallestdiff = PHP_INT_MAX;
|
445 |
|
446 |
// If we only have 2 skip as its probably equally relevant
|
447 |
if(count($locations) > 2) {
|
448 |
// skip the first as we check 1 behind
|
449 |
-
for($i=1; $i < $loccount; $i++) {
|
450 |
if($i == $loccount-1) { // at the end
|
451 |
$diff = $locations[$i] - $locations[$i-1];
|
452 |
}
|
@@ -492,7 +504,7 @@ function relevanssi_extract_relevant($words, $fulltext, $rellength=300, $prevcou
|
|
492 |
}
|
493 |
else {
|
494 |
$reltext = substr($fulltext, $startpos, $rellength);
|
495 |
-
}
|
496 |
|
497 |
// check to ensure we dont snip the last word if thats the match
|
498 |
if( $startpos + $rellength < $textlength) {
|
@@ -507,9 +519,9 @@ function relevanssi_extract_relevant($words, $fulltext, $rellength=300, $prevcou
|
|
507 |
$start = false;
|
508 |
if($startpos == 0) $start = true;
|
509 |
|
510 |
-
$besthits = count(relevanssi_extract_locations($words, $reltext));
|
511 |
|
512 |
return array($reltext, $besthits, $start);
|
513 |
}
|
514 |
|
515 |
-
?>
|
24 |
// These shortcodes cause problems with Relevanssi excerpts
|
25 |
remove_shortcode('layerslider');
|
26 |
remove_shortcode('responsive-flipbook');
|
27 |
+
remove_shortcode('breadcrumb');
|
28 |
+
|
29 |
$content = apply_filters('relevanssi_pre_excerpt_content', $post->post_content, $post, $query);
|
30 |
$content = apply_filters('the_content', $content);
|
31 |
$content = apply_filters('relevanssi_excerpt_content', $content, $post, $query);
|
32 |
+
|
33 |
$content = relevanssi_strip_invisibles($content); // removes <script>, <embed> &c with content
|
34 |
$content = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $content); // add spaces between tags to avoid getting words stuck together
|
35 |
$content = strip_tags($content, get_option('relevanssi_excerpt_allowable_tags', '')); // this removes the tags, but leaves the content
|
36 |
+
|
37 |
$content = preg_replace("/\n\r|\r\n|\n|\r/", " ", $content);
|
38 |
// $content = trim(preg_replace("/\s\s+/", " ", $content));
|
39 |
+
|
40 |
$query = relevanssi_add_synonyms($query);
|
41 |
+
|
42 |
$excerpt_data = relevanssi_create_excerpt($content, $terms, $query);
|
43 |
|
44 |
if (get_option("relevanssi_index_comments") != 'none') {
|
65 |
|
66 |
$start = $excerpt_data[2];
|
67 |
|
68 |
+
$excerpt = $excerpt_data[0];
|
69 |
$excerpt = trim($excerpt);
|
70 |
$excerpt = apply_filters('relevanssi_excerpt', $excerpt);
|
71 |
|
93 |
if (!empty($excerpt))
|
94 |
$excerpt = $excerpt . $ellipsis;
|
95 |
}
|
96 |
+
|
97 |
if (relevanssi_s2member_level($post->ID) == 1) $excerpt = $post->post_excerpt;
|
98 |
|
99 |
if ($old_global_post != NULL) $post = $old_global_post;
|
128 |
$non_phrase_terms[] = $term;
|
129 |
}
|
130 |
}
|
131 |
+
|
132 |
$terms = $non_phrase_terms;
|
133 |
$terms[$phrase] = 1;
|
134 |
}
|
135 |
|
136 |
// longest search terms first, because those are generally more significant
|
137 |
uksort($terms, 'relevanssi_strlen_sort');
|
138 |
+
|
139 |
$start = false;
|
140 |
if ("chars" == $type) {
|
141 |
$prev_count = floor($excerpt_length / 2);
|
144 |
else {
|
145 |
$words = explode(' ', $content);
|
146 |
$i = 0;
|
147 |
+
|
148 |
while ($i < count($words)) {
|
149 |
if ($i + $excerpt_length > count($words)) {
|
150 |
$i = count($words) - $excerpt_length;
|
151 |
if ($i < 0) $i = 0;
|
152 |
}
|
153 |
+
|
154 |
$excerpt_slice = array_slice($words, $i, $excerpt_length);
|
155 |
$excerpt_slice = implode(' ', $excerpt_slice);
|
156 |
|
157 |
$excerpt_slice = " $excerpt_slice";
|
158 |
$term_hits = 0;
|
159 |
$count = relevanssi_count_matches(array_keys($terms), $excerpt_slice);
|
160 |
+
|
161 |
if ($count > 0 && $count > $best_excerpt_term_hits) {
|
162 |
$best_excerpt_term_hits = $count;
|
163 |
$excerpt = $excerpt_slice;
|
164 |
}
|
165 |
+
|
166 |
$i += $excerpt_length;
|
167 |
}
|
168 |
+
|
169 |
if ("" == $excerpt) {
|
170 |
$excerpt = explode(' ', $content, $excerpt_length);
|
171 |
array_pop($excerpt);
|
186 |
$referrer = preg_replace('@(http|https)://@', '', stripslashes(urldecode($_SERVER['HTTP_REFERER'])));
|
187 |
$args = explode('?', $referrer);
|
188 |
$query = array();
|
189 |
+
|
190 |
if ( count( $args ) > 1 )
|
191 |
parse_str( $args[1], $query );
|
192 |
+
|
193 |
+
if (stripos($referrer, $_SERVER['SERVER_NAME']) !== false) {
|
194 |
// Local search
|
195 |
if (isset($query['s'])) {
|
196 |
$q = relevanssi_add_synonyms($query['s']);
|
204 |
}
|
205 |
}
|
206 |
}
|
207 |
+
|
208 |
return $content;
|
209 |
}
|
210 |
|
213 |
if ("none" == $type) {
|
214 |
return $excerpt;
|
215 |
}
|
216 |
+
|
217 |
switch ($type) {
|
218 |
case "mark": // thanks to Jeff Byrnes
|
219 |
$start_emp = "<mark>";
|
254 |
default:
|
255 |
return $excerpt;
|
256 |
}
|
257 |
+
|
258 |
+
$start_emp_token = "**{}[";
|
259 |
+
$end_emp_token = "]}**";
|
260 |
|
261 |
if ( function_exists('mb_internal_encoding') )
|
262 |
mb_internal_encoding("UTF-8");
|
263 |
|
264 |
+
do_action('relevanssi_highlight_tokenize');
|
265 |
$terms = array_keys(relevanssi_tokenize($query, $remove_stopwords = true, $min_word_length = -1));
|
266 |
+
|
267 |
if (is_array($query)) $query = implode(' ', $query); // just in case
|
268 |
$phrases = relevanssi_extract_phrases(stripslashes($query));
|
269 |
|
285 |
foreach ($terms as $term) {
|
286 |
// $pr_term = relevanssi_replace_punctuation(preg_quote($term, '/'));
|
287 |
$pr_term = preg_quote($term, '/');
|
288 |
+
|
289 |
$undecoded_excerpt = $excerpt;
|
290 |
$excerpt = html_entity_decode($excerpt);
|
291 |
+
|
292 |
if ($word_boundaries) {
|
293 |
// get_option('relevanssi_fuzzy') != 'none' ? $regex = "/($pr_term)(?!(^&+)?(;))/iu" : $regex = "/(\b$pr_term|$pr_term\b)(?!(^&+)?(;))/iu";
|
294 |
+
// get_option('relevanssi_fuzzy') != 'none' ? $regex = "/(\b$pr_term|$pr_term\b)(?!(^&+)?(;))/iu" : $regex = "/(\b$pr_term\b)(?!(^&+)?(;))/iu";
|
295 |
+
get_option('relevanssi_fuzzy') != 'none' ? $regex = "/(\b$pr_term|$pr_term\b)/iu" : $regex = "/(\b$pr_term\b)/iu";
|
296 |
+
|
297 |
$excerpt = preg_replace($regex, $start_emp_token . '\\1' . $end_emp_token, $excerpt);
|
298 |
if (empty($excerpt)) $excerpt = preg_replace($regex, $start_emp_token . '\\1' . $end_emp_token, $undecoded_excerpt);
|
299 |
}
|
300 |
else {
|
301 |
+
// $excerpt = preg_replace("/($pr_term)(?!(^&+)?(;))/iu", $start_emp_token . '\\1' . $end_emp_token, $excerpt);
|
302 |
+
$excerpt = preg_replace("/($pr_term)/iu", $start_emp_token . '\\1' . $end_emp_token, $excerpt);
|
303 |
+
if (empty($excerpt)) $excerpt = preg_replace("/($pr_term)/iu", $start_emp_token . '\\1' . $end_emp_token, $undecoded_excerpt);
|
304 |
}
|
305 |
+
|
306 |
$preg_start = preg_quote($start_emp_token);
|
307 |
$preg_end = preg_quote($end_emp_token);
|
308 |
|
315 |
}
|
316 |
}
|
317 |
|
318 |
+
if (preg_match_all('/&.*;/U', $excerpt, $matches) > 0) {
|
319 |
+
// Remove highlights from inside HTML entities
|
320 |
+
foreach ($matches as $match) {
|
321 |
+
$new_match = str_replace($start_emp_token, '', $match);
|
322 |
+
$new_match = str_replace($end_emp_token, '', $new_match);
|
323 |
+
$excerpt = str_replace($match, $new_match, $excerpt);
|
324 |
+
}
|
325 |
+
}
|
326 |
+
|
327 |
if (preg_match_all('/<(style|script|object|embed)>.*<\/(style|script|object|embed)>/U', $excerpt, $matches) > 0) {
|
328 |
// Remove highlights in style, object, embed and script tags
|
329 |
foreach ($matches as $match) {
|
333 |
}
|
334 |
}
|
335 |
}
|
336 |
+
|
337 |
$excerpt = relevanssi_remove_nested_highlights($excerpt, $start_emp_token, $end_emp_token);
|
338 |
|
339 |
/*
|
361 |
function relevanssi_remove_nested_highlights($s, $a, $b) {
|
362 |
$offset = 0;
|
363 |
$string = "";
|
364 |
+
$bits = explode($a, $s);
|
365 |
$new_bits = array($bits[0]);
|
366 |
$in = false;
|
367 |
for ($i = 1; $i < count($bits); $i++) {
|
368 |
if ($bits[$i] == '') continue;
|
369 |
+
|
370 |
if (!$in) {
|
371 |
array_push($new_bits, $a);
|
372 |
$in = true;
|
389 |
array_push($new_bits, $bits[$i]);
|
390 |
}
|
391 |
$whole = implode('', $new_bits);
|
392 |
+
|
393 |
return $whole;
|
394 |
}
|
395 |
|
399 |
*/
|
400 |
|
401 |
// find the locations of each of the words
|
402 |
+
// Nothing exciting here. The array_unique is required
|
403 |
// unless you decide to make the words unique before passing in
|
404 |
function relevanssi_extract_locations($words, $fulltext) {
|
405 |
$locations = array();
|
442 |
}
|
443 |
|
444 |
// Work out which is the most relevant portion to display
|
445 |
+
// This is done by looping over each match and finding the smallest distance between two found
|
446 |
+
// strings. The idea being that the closer the terms are the better match the snippet would be.
|
447 |
+
// When checking for matches we only change the location if there is a better match.
|
448 |
+
// The only exception is where we have only two matches in which case we just take the
|
449 |
// first as will be equally distant.
|
450 |
function relevanssi_determine_snip_location($locations, $prevcount) {
|
451 |
if (!is_array($locations) || empty($locations)) return 0;
|
452 |
|
453 |
// If we only have 1 match we dont actually do the for loop so set to the first
|
454 |
+
$startpos = $locations[0];
|
455 |
$loccount = count($locations);
|
456 |
+
$smallestdiff = PHP_INT_MAX;
|
457 |
|
458 |
// If we only have 2 skip as its probably equally relevant
|
459 |
if(count($locations) > 2) {
|
460 |
// skip the first as we check 1 behind
|
461 |
+
for($i=1; $i < $loccount; $i++) {
|
462 |
if($i == $loccount-1) { // at the end
|
463 |
$diff = $locations[$i] - $locations[$i-1];
|
464 |
}
|
504 |
}
|
505 |
else {
|
506 |
$reltext = substr($fulltext, $startpos, $rellength);
|
507 |
+
}
|
508 |
|
509 |
// check to ensure we dont snip the last word if thats the match
|
510 |
if( $startpos + $rellength < $textlength) {
|
519 |
$start = false;
|
520 |
if($startpos == 0) $start = true;
|
521 |
|
522 |
+
$besthits = count(relevanssi_extract_locations($words, $reltext));
|
523 |
|
524 |
return array($reltext, $besthits, $start);
|
525 |
}
|
526 |
|
527 |
+
?>
|
lib/indexing.php
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
<?php
|
2 |
|
3 |
function relevanssi_build_index($extend = false) {
|
4 |
-
if (function_exists('wp_suspend_cache_addition'))
|
5 |
wp_suspend_cache_addition(true); // Thanks to Julien Mession
|
6 |
-
|
7 |
global $wpdb, $relevanssi_variables;
|
8 |
$relevanssi_table = $relevanssi_variables['relevanssi_table'];
|
9 |
|
10 |
-
|
11 |
-
|
12 |
$post_types = array();
|
13 |
$types = get_option("relevanssi_index_post_types");
|
14 |
if (!is_array($types)) $types = array();
|
15 |
foreach ($types as $type) {
|
16 |
array_push($post_types, "'$type'");
|
17 |
}
|
18 |
-
|
19 |
if (count($post_types) > 0) {
|
20 |
$restriction = " AND post.post_type IN (" . implode(', ', $post_types) . ') ';
|
21 |
}
|
@@ -35,10 +35,10 @@ function relevanssi_build_index($extend = false) {
|
|
35 |
// this really should never happen
|
36 |
$valid_status = "'publish', 'draft', 'private', 'pending', 'future'";
|
37 |
}
|
38 |
-
|
39 |
$n = 0;
|
40 |
$size = 0;
|
41 |
-
|
42 |
if (!$extend) {
|
43 |
// truncate table first
|
44 |
$wpdb->query("TRUNCATE TABLE $relevanssi_table");
|
@@ -104,16 +104,16 @@ function relevanssi_build_index($extend = false) {
|
|
104 |
|
105 |
do_action('relevanssi_pre_indexing_query');
|
106 |
$content = $wpdb->get_results($q);
|
107 |
-
|
108 |
foreach ($content as $post) {
|
109 |
$n += relevanssi_index_doc($post->ID, false, $custom_fields, true);
|
110 |
// n calculates the number of insert queries
|
111 |
// $bypassglobalpost set to true, because at this point global $post should be NULL, but in some cases it is not
|
112 |
}
|
113 |
-
|
114 |
$wpdb->query("ANALYZE TABLE $relevanssi_table");
|
115 |
// To prevent empty indices
|
116 |
-
|
117 |
echo '<div id="message" class="updated fade"><p>'
|
118 |
. __((($size == 0) || (count($content) < $size)) ? "Indexing complete!" : "More to index...", "relevanssi")
|
119 |
. '</p></div>';
|
@@ -123,7 +123,7 @@ function relevanssi_build_index($extend = false) {
|
|
123 |
$D = $wpdb->get_var("SELECT COUNT(DISTINCT(relevanssi.doc)) FROM $relevanssi_table AS relevanssi");
|
124 |
update_option( 'relevanssi_doc_count', $D);
|
125 |
|
126 |
-
if (function_exists('wp_suspend_cache_addition'))
|
127 |
wp_suspend_cache_addition(false); // Thanks to Julien Mession
|
128 |
}
|
129 |
|
@@ -135,10 +135,10 @@ function relevanssi_build_index($extend = false) {
|
|
135 |
|
136 |
- Build index:
|
137 |
global $post is NULL, $indexpost is a post object.
|
138 |
-
|
139 |
- Update post:
|
140 |
global $post has the original $post, $indexpost is the ID of revision.
|
141 |
-
|
142 |
- Quick edit:
|
143 |
global $post is an array, $indexpost is the ID of current revision.
|
144 |
*/
|
@@ -164,7 +164,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
164 |
if (is_array($post)) {
|
165 |
$post = get_post($post['ID']);
|
166 |
}
|
167 |
-
|
168 |
if (empty($post)) {
|
169 |
// No $post set, so we need to use $indexpost, if it's a post object
|
170 |
$post_was_null = true;
|
@@ -180,14 +180,14 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
180 |
$previous_post = $post;
|
181 |
}
|
182 |
}
|
183 |
-
|
184 |
if ($post == NULL) {
|
185 |
// At this point we should have something in $post; if not, quit.
|
186 |
if ($post_was_null) $post = null;
|
187 |
if ($previous_post) $post = $previous_post;
|
188 |
return;
|
189 |
}
|
190 |
-
|
191 |
// Finally fetch the post again by ID. Complicated, yes, but unless we do this, we might end
|
192 |
// up indexing the post before the updates come in.
|
193 |
$post = get_post($post->ID);
|
@@ -228,7 +228,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
228 |
return;
|
229 |
}
|
230 |
|
231 |
-
$n = 0;
|
232 |
|
233 |
$post = apply_filters('relevanssi_post_to_index', $post);
|
234 |
|
@@ -242,7 +242,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
242 |
$pcoms = relevanssi_strip_invisibles($pcoms);
|
243 |
$pcoms = preg_replace('/<[a-zA-Z\/][^>]*>/', ' ', $pcoms);
|
244 |
$pcoms = strip_tags($pcoms);
|
245 |
-
$pcoms = relevanssi_tokenize($pcoms, true, $min_word_length);
|
246 |
if (count($pcoms) > 0) {
|
247 |
foreach ($pcoms as $pcom => $count) {
|
248 |
$n++;
|
@@ -259,7 +259,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
259 |
foreach ($taxonomies as $taxonomy) {
|
260 |
$insert_data = relevanssi_index_taxonomy_terms($post, $taxonomy, $insert_data);
|
261 |
}
|
262 |
-
|
263 |
// index author
|
264 |
if ("on" == get_option("relevanssi_index_author")) {
|
265 |
$auth = $post->post_author;
|
@@ -272,7 +272,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
272 |
|
273 |
if ($custom_fields) {
|
274 |
$remove_underscore_fields = false;
|
275 |
-
if ($custom_fields == 'all')
|
276 |
$custom_fields = get_post_custom_keys($post->ID);
|
277 |
if ($custom_fields == 'visible') {
|
278 |
$custom_fields = get_post_custom_keys($post->ID);
|
@@ -280,6 +280,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
280 |
}
|
281 |
$custom_fields = apply_filters('relevanssi_index_custom_fields', $custom_fields);
|
282 |
if (is_array($custom_fields)) {
|
|
|
283 |
foreach ($custom_fields as $field) {
|
284 |
if ($remove_underscore_fields) {
|
285 |
if (substr($field, 0, 1) == '_') continue;
|
@@ -287,6 +288,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
287 |
$values = get_post_meta($post->ID, $field, false);
|
288 |
if ("" == $values) continue;
|
289 |
foreach ($values as $value) {
|
|
|
290 |
$value_tokens = relevanssi_tokenize($value, true, $min_word_length);
|
291 |
foreach ($value_tokens as $token => $count) {
|
292 |
isset($insert_data[$token]['customfield']) ? $insert_data[$token]['customfield'] += $count : $insert_data[$token]['customfield'] = $count;
|
@@ -315,7 +317,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
315 |
if (apply_filters('relevanssi_index_titles', $index_titles)) {
|
316 |
$filtered_title = apply_filters('relevanssi_post_title_before_tokenize', $post->post_title, $post);
|
317 |
$titles = relevanssi_tokenize(apply_filters('the_title', $filtered_title, $post->ID), apply_filters('relevanssi_remove_stopwords_in_titles', true));
|
318 |
-
|
319 |
if (count($titles) > 0) {
|
320 |
foreach ($titles as $title => $count) {
|
321 |
$n++;
|
@@ -324,20 +326,20 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
324 |
}
|
325 |
}
|
326 |
}
|
327 |
-
|
328 |
$index_content = true;
|
329 |
if (apply_filters('relevanssi_index_content', $index_content)) {
|
330 |
remove_shortcode('noindex');
|
331 |
add_shortcode('noindex', 'relevanssi_noindex_shortcode_indexing');
|
332 |
|
333 |
$contents = apply_filters('relevanssi_post_content', $post->post_content, $post);
|
334 |
-
|
335 |
// Allow user to add extra content for Relevanssi to index
|
336 |
// Thanks to Alexander Gieg
|
337 |
$additional_content = trim(apply_filters('relevanssi_content_to_index', '', $post));
|
338 |
if ('' != $additional_content)
|
339 |
-
$contents .= ' '.$additional_content;
|
340 |
-
|
341 |
if ('on' == get_option('relevanssi_expand_shortcodes')) {
|
342 |
if (function_exists("do_shortcode")) {
|
343 |
// WP Table Reloaded support
|
@@ -366,8 +368,8 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
366 |
remove_shortcode('watupro'); // Watu PRO doesn't co-operate
|
367 |
remove_shortcode('starbox'); // Starbox shortcode breaks Relevanssi
|
368 |
remove_shortcode('cfdb-save-form-post'); // Contact Form DB
|
369 |
-
remove_shortcode('cfdb-datatable');
|
370 |
-
remove_shortcode('cfdb-table');
|
371 |
remove_shortcode('cfdb-json');
|
372 |
remove_shortcode('cfdb-value');
|
373 |
remove_shortcode('cfdb-count');
|
@@ -384,11 +386,11 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
384 |
remove_shortcode('woocommerce_thankyou');
|
385 |
remove_shortcode('woocommerce_lost_password');
|
386 |
remove_shortcode('woocommerce_edit_address');
|
387 |
-
|
388 |
$post_before_shortcode = $post;
|
389 |
$contents = do_shortcode($contents);
|
390 |
$post = $post_before_shortcode;
|
391 |
-
|
392 |
if (defined('TABLEPRESS_ABSPATH')) {
|
393 |
unset($My_TablePress_Controller);
|
394 |
}
|
@@ -403,12 +405,12 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
403 |
$contents = strip_shortcodes($contents);
|
404 |
}
|
405 |
}
|
406 |
-
|
407 |
remove_shortcode('noindex');
|
408 |
add_shortcode('noindex', 'relevanssi_noindex_shortcode');
|
409 |
|
410 |
$contents = relevanssi_strip_invisibles($contents);
|
411 |
-
|
412 |
if (function_exists('relevanssi_process_internal_links')) {
|
413 |
$contents = relevanssi_process_internal_links($contents, $post->ID);
|
414 |
}
|
@@ -418,7 +420,7 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
418 |
if (function_exists('wp_encode_emoji')) $contents = wp_encode_emoji($contents);
|
419 |
$contents = apply_filters('relevanssi_post_content_before_tokenize', $contents, $post);
|
420 |
$contents = relevanssi_tokenize($contents, true, $min_word_length);
|
421 |
-
|
422 |
if (count($contents) > 0) {
|
423 |
foreach ($contents as $content => $count) {
|
424 |
$n++;
|
@@ -426,10 +428,10 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
426 |
}
|
427 |
}
|
428 |
}
|
429 |
-
|
430 |
$type = 'post';
|
431 |
if ($post->post_type == 'attachment') $type = 'attachment';
|
432 |
-
|
433 |
$insert_data = apply_filters('relevanssi_indexing_data', $insert_data, $post);
|
434 |
|
435 |
$values = array();
|
@@ -456,9 +458,9 @@ function relevanssi_index_doc($indexpost, $remove_first = false, $custom_fields
|
|
456 |
|
457 |
array_push($values, $value);
|
458 |
}
|
459 |
-
|
460 |
$values = apply_filters('relevanssi_indexing_values', $values, $post);
|
461 |
-
|
462 |
if (!empty($values)) {
|
463 |
$values = implode(', ', $values);
|
464 |
$query = "INSERT IGNORE INTO $relevanssi_table (doc, term, term_reverse, content, title, comment, tag, link, author, category, excerpt, taxonomy, customfield, type, taxonomy_detail, customfield_detail, mysqlcolumn)
|
@@ -489,22 +491,22 @@ function relevanssi_index_taxonomy_terms($post = null, $taxonomy = "", $insert_d
|
|
489 |
|
490 |
if (null == $post) return $insert_data;
|
491 |
if ("" == $taxonomy) return $insert_data;
|
492 |
-
|
493 |
$min_word_length = get_option('relevanssi_min_word_length', 3);
|
494 |
$ptagobj = get_the_terms($post->ID, $taxonomy);
|
495 |
-
if ($ptagobj !== FALSE) {
|
496 |
$tagstr = "";
|
497 |
foreach ($ptagobj as $ptag) {
|
498 |
if (is_object($ptag)) {
|
499 |
$tagstr .= $ptag->name . ' ';
|
500 |
}
|
501 |
-
}
|
502 |
$tagstr = trim($tagstr);
|
503 |
-
$ptags = relevanssi_tokenize($tagstr, true, $min_word_length);
|
504 |
if (count($ptags) > 0) {
|
505 |
foreach ($ptags as $ptag => $count) {
|
506 |
$n++;
|
507 |
-
|
508 |
if ('post_tags' == $taxonomy) {
|
509 |
$insert_data[$ptag]['tag'] = $count;
|
510 |
}
|
@@ -533,7 +535,7 @@ function relevanssi_index_taxonomy_terms($post = null, $taxonomy = "", $insert_d
|
|
533 |
}
|
534 |
$insert_data[$ptag]['taxonomy_detail'] = serialize($tax_detail);
|
535 |
}
|
536 |
-
}
|
537 |
}
|
538 |
return $insert_data;
|
539 |
}
|
@@ -553,7 +555,7 @@ function relevanssi_update_child_posts($new_status, $old_status, $post) {
|
|
553 |
|| (in_array($post->post_type, array('attachment', 'revision')))) {
|
554 |
return;
|
555 |
}
|
556 |
-
|
557 |
$q = "SELECT * FROM $wpdb->posts WHERE post_parent=$post->ID AND post_type!='revision'";
|
558 |
$child_posts = $wpdb->get_results($q);
|
559 |
if ($child_posts) {
|
@@ -601,7 +603,7 @@ function relevanssi_delete($post) {
|
|
601 |
|
602 |
function relevanssi_publish($post, $bypassglobalpost = false) {
|
603 |
global $relevanssi_publish_doc;
|
604 |
-
|
605 |
$post_status = get_post_status($post);
|
606 |
if ('auto-draft' == $post_status) return;
|
607 |
|
@@ -634,7 +636,7 @@ function relevanssi_insert_edit($post_id) {
|
|
634 |
}
|
635 |
}
|
636 |
|
637 |
-
//Added by OdditY ->
|
638 |
function relevanssi_comment_edit($comID) {
|
639 |
relevanssi_comment_index($comID,$action="update");
|
640 |
}
|
@@ -647,10 +649,10 @@ function relevanssi_comment_index($comID,$action="add") {
|
|
647 |
global $wpdb;
|
648 |
$comtype = get_option("relevanssi_index_comments");
|
649 |
switch ($comtype) {
|
650 |
-
case "all":
|
651 |
// all (incl. customs, track-&pingbacks)
|
652 |
break;
|
653 |
-
case "normal":
|
654 |
// normal (excl. customs, track-&pingbacks)
|
655 |
$restriction=" AND comment_type='' ";
|
656 |
break;
|
@@ -659,28 +661,28 @@ function relevanssi_comment_index($comID,$action="add") {
|
|
659 |
return ;
|
660 |
}
|
661 |
switch ($action) {
|
662 |
-
case "update":
|
663 |
//(update) comment status changed:
|
664 |
$cpostID = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID='$comID'".$restriction);
|
665 |
break;
|
666 |
-
case "remove":
|
667 |
//(remove) approved comment will be deleted (if not approved, its not in index):
|
668 |
$cpostID = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID='$comID' AND comment_approved='1'".$restriction);
|
669 |
if($cpostID!=NULL) {
|
670 |
//empty comment_content & reindex, then let WP delete the empty comment
|
671 |
$wpdb->query("UPDATE $wpdb->comments SET comment_content='' WHERE comment_ID='$comID'");
|
672 |
-
}
|
673 |
break;
|
674 |
default:
|
675 |
// (add) new comment:
|
676 |
$cpostID = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID='$comID' AND comment_approved='1'".$restriction);
|
677 |
break;
|
678 |
}
|
679 |
-
if($cpostID!=NULL) relevanssi_publish($cpostID);
|
680 |
}
|
681 |
//Added by OdditY END <-
|
682 |
|
683 |
-
function relevanssi_get_comments($postID) {
|
684 |
global $wpdb;
|
685 |
|
686 |
if (apply_filters('relevanssi_index_comments_exclude', false, $postID))
|
@@ -690,10 +692,10 @@ function relevanssi_get_comments($postID) {
|
|
690 |
$restriction = "";
|
691 |
$comment_string = "";
|
692 |
switch ($comtype) {
|
693 |
-
case "all":
|
694 |
// all (incl. customs, track- & pingbacks)
|
695 |
break;
|
696 |
-
case "normal":
|
697 |
// normal (excl. customs, track- & pingbacks)
|
698 |
$restriction=" AND comment_type='' ";
|
699 |
break;
|
@@ -709,9 +711,9 @@ function relevanssi_get_comments($postID) {
|
|
709 |
$sql = "SELECT comment_ID, comment_content, comment_author
|
710 |
FROM $wpdb->comments
|
711 |
WHERE comment_post_ID = '$postID'
|
712 |
-
AND comment_approved = '1'
|
713 |
".$restriction."
|
714 |
-
LIMIT $from, $to";
|
715 |
$comments = $wpdb->get_results($sql);
|
716 |
if (sizeof($comments) == 0) break;
|
717 |
foreach($comments as $comment) {
|
@@ -719,8 +721,23 @@ function relevanssi_get_comments($postID) {
|
|
719 |
}
|
720 |
$from += $to;
|
721 |
}
|
722 |
-
|
723 |
return $comment_string;
|
724 |
}
|
725 |
|
726 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
|
3 |
function relevanssi_build_index($extend = false) {
|
4 |
+
if (function_exists('wp_suspend_cache_addition'))
|
5 |
wp_suspend_cache_addition(true); // Thanks to Julien Mession
|
6 |
+
|
7 |
global $wpdb, $relevanssi_variables;
|
8 |
$relevanssi_table = $relevanssi_variables['relevanssi_table'];
|
9 |
|
10 |
+
set_time_limit(0);
|
11 |
+
|
12 |
$post_types = array();
|
13 |
$types = get_option("relevanssi_index_post_types");
|
14 |
if (!is_array($types)) $types = array();
|
15 |
foreach ($types as $type) {
|
16 |
array_push($post_types, "'$type'");
|
17 |
}
|
18 |
+
|
19 |
if (count($post_types) > 0) {
|
20 |
$restriction = " AND post.post_type IN (" . implode(', ', $post_types) . ') ';
|
21 |
}
|
35 |
// this really should never happen
|
36 |
$valid_status = "'publish', 'draft', 'private', 'pending', 'future'";
|
37 |
}
|
38 |
+
|
39 |
$n = 0;
|
40 |
$size = 0;
|
41 |
+
|
42 |
if (!$extend) {
|
43 |
// truncate table first
|
44 |
$wpdb->query("TRUNCATE TABLE $relevanssi_table");
|
104 |
|
105 |
do_action('relevanssi_pre_indexing_query');
|
106 |
$content = $wpdb->get_results($q);
|
107 |
+
|
108 |
foreach ($content as $post) {
|
109 |
$n += relevanssi_index_doc($post->ID, false, $custom_fields, true);
|
110 |
// n calculates the number of insert queries
|
111 |
// $bypassglobalpost set to true, because at this point global $post should be NULL, but in some cases it is not
|
112 |
}
|
113 |
+
|
114 |
$wpdb->query("ANALYZE TABLE $relevanssi_table");
|
115 |
// To prevent empty indices
|
116 |
+
|
117 |
echo '<div id="message" class="updated fade"><p>'
|
118 |
. __((($size == 0) || (count($content) < $size)) ? "Indexing complete!" : "More to index...", "relevanssi")
|
119 |
. '</p></div>';
|
123 |
$D = $wpdb->get_var("SELECT COUNT(DISTINCT(relevanssi.doc)) FROM $relevanssi_table AS relevanssi");
|
124 |
update_option( 'relevanssi_doc_count', $D);
|
125 |
|
126 |
+
if (function_exists('wp_suspend_cache_addition'))
|
127 |
wp_suspend_cache_addition(false); // Thanks to Julien Mession
|
128 |
}
|
129 |
|
135 |
|
136 |
- Build index:
|
137 |
global $post is NULL, $indexpost is a post object.
|
138 |
+
|
139 |
- Update post:
|
140 |
global $post has the original $post, $indexpost is the ID of revision.
|
141 |
+
|
142 |
- Quick edit:
|
143 |
global $post is an array, $indexpost is the ID of current revision.
|
144 |
*/
|
164 |
if (is_array($post)) {
|
165 |
$post = get_post($post['ID']);
|
166 |
}
|
167 |
+
|
168 |
if (empty($post)) {
|
169 |
// No $post set, so we need to use $indexpost, if it's a post object
|
170 |
$post_was_null = true;
|
180 |
$previous_post = $post;
|
181 |
}
|
182 |
}
|
183 |
+
|
184 |
if ($post == NULL) {
|
185 |
// At this point we should have something in $post; if not, quit.
|
186 |
if ($post_was_null) $post = null;
|
187 |
if ($previous_post) $post = $previous_post;
|
188 |
return;
|
189 |
}
|
190 |
+
|
191 |
// Finally fetch the post again by ID. Complicated, yes, but unless we do this, we might end
|
192 |
// up indexing the post before the updates come in.
|
193 |
$post = get_post($post->ID);
|
228 |
return;
|
229 |
}
|
230 |
|
231 |
+
$n = 0;
|
232 |
|
233 |
$post = apply_filters('relevanssi_post_to_index', $post);
|
234 |
|
242 |
$pcoms = relevanssi_strip_invisibles($pcoms);
|
243 |
$pcoms = preg_replace('/<[a-zA-Z\/][^>]*>/', ' ', $pcoms);
|
244 |
$pcoms = strip_tags($pcoms);
|
245 |
+
$pcoms = relevanssi_tokenize($pcoms, true, $min_word_length);
|
246 |
if (count($pcoms) > 0) {
|
247 |
foreach ($pcoms as $pcom => $count) {
|
248 |
$n++;
|
259 |
foreach ($taxonomies as $taxonomy) {
|
260 |
$insert_data = relevanssi_index_taxonomy_terms($post, $taxonomy, $insert_data);
|
261 |
}
|
262 |
+
|
263 |
// index author
|
264 |
if ("on" == get_option("relevanssi_index_author")) {
|
265 |
$auth = $post->post_author;
|
272 |
|
273 |
if ($custom_fields) {
|
274 |
$remove_underscore_fields = false;
|
275 |
+
if ($custom_fields == 'all')
|
276 |
$custom_fields = get_post_custom_keys($post->ID);
|
277 |
if ($custom_fields == 'visible') {
|
278 |
$custom_fields = get_post_custom_keys($post->ID);
|
280 |
}
|
281 |
$custom_fields = apply_filters('relevanssi_index_custom_fields', $custom_fields);
|
282 |
if (is_array($custom_fields)) {
|
283 |
+
$custom_fields = array_unique($custom_fields); // no reason to index duplicates
|
284 |
foreach ($custom_fields as $field) {
|
285 |
if ($remove_underscore_fields) {
|
286 |
if (substr($field, 0, 1) == '_') continue;
|
288 |
$values = get_post_meta($post->ID, $field, false);
|
289 |
if ("" == $values) continue;
|
290 |
foreach ($values as $value) {
|
291 |
+
relevanssi_index_acf($insert_data, $post->ID, $field, $value);
|
292 |
$value_tokens = relevanssi_tokenize($value, true, $min_word_length);
|
293 |
foreach ($value_tokens as $token => $count) {
|
294 |
isset($insert_data[$token]['customfield']) ? $insert_data[$token]['customfield'] += $count : $insert_data[$token]['customfield'] = $count;
|
317 |
if (apply_filters('relevanssi_index_titles', $index_titles)) {
|
318 |
$filtered_title = apply_filters('relevanssi_post_title_before_tokenize', $post->post_title, $post);
|
319 |
$titles = relevanssi_tokenize(apply_filters('the_title', $filtered_title, $post->ID), apply_filters('relevanssi_remove_stopwords_in_titles', true));
|
320 |
+
|
321 |
if (count($titles) > 0) {
|
322 |
foreach ($titles as $title => $count) {
|
323 |
$n++;
|
326 |
}
|
327 |
}
|
328 |
}
|
329 |
+
|
330 |
$index_content = true;
|
331 |
if (apply_filters('relevanssi_index_content', $index_content)) {
|
332 |
remove_shortcode('noindex');
|
333 |
add_shortcode('noindex', 'relevanssi_noindex_shortcode_indexing');
|
334 |
|
335 |
$contents = apply_filters('relevanssi_post_content', $post->post_content, $post);
|
336 |
+
|
337 |
// Allow user to add extra content for Relevanssi to index
|
338 |
// Thanks to Alexander Gieg
|
339 |
$additional_content = trim(apply_filters('relevanssi_content_to_index', '', $post));
|
340 |
if ('' != $additional_content)
|
341 |
+
$contents .= ' '.$additional_content;
|
342 |
+
|
343 |
if ('on' == get_option('relevanssi_expand_shortcodes')) {
|
344 |
if (function_exists("do_shortcode")) {
|
345 |
// WP Table Reloaded support
|
368 |
remove_shortcode('watupro'); // Watu PRO doesn't co-operate
|
369 |
remove_shortcode('starbox'); // Starbox shortcode breaks Relevanssi
|
370 |
remove_shortcode('cfdb-save-form-post'); // Contact Form DB
|
371 |
+
remove_shortcode('cfdb-datatable');
|
372 |
+
remove_shortcode('cfdb-table');
|
373 |
remove_shortcode('cfdb-json');
|
374 |
remove_shortcode('cfdb-value');
|
375 |
remove_shortcode('cfdb-count');
|
386 |
remove_shortcode('woocommerce_thankyou');
|
387 |
remove_shortcode('woocommerce_lost_password');
|
388 |
remove_shortcode('woocommerce_edit_address');
|
389 |
+
|
390 |
$post_before_shortcode = $post;
|
391 |
$contents = do_shortcode($contents);
|
392 |
$post = $post_before_shortcode;
|
393 |
+
|
394 |
if (defined('TABLEPRESS_ABSPATH')) {
|
395 |
unset($My_TablePress_Controller);
|
396 |
}
|
405 |
$contents = strip_shortcodes($contents);
|
406 |
}
|
407 |
}
|
408 |
+
|
409 |
remove_shortcode('noindex');
|
410 |
add_shortcode('noindex', 'relevanssi_noindex_shortcode');
|
411 |
|
412 |
$contents = relevanssi_strip_invisibles($contents);
|
413 |
+
|
414 |
if (function_exists('relevanssi_process_internal_links')) {
|
415 |
$contents = relevanssi_process_internal_links($contents, $post->ID);
|
416 |
}
|
420 |
if (function_exists('wp_encode_emoji')) $contents = wp_encode_emoji($contents);
|
421 |
$contents = apply_filters('relevanssi_post_content_before_tokenize', $contents, $post);
|
422 |
$contents = relevanssi_tokenize($contents, true, $min_word_length);
|
423 |
+
|
424 |
if (count($contents) > 0) {
|
425 |
foreach ($contents as $content => $count) {
|
426 |
$n++;
|
428 |
}
|
429 |
}
|
430 |
}
|
431 |
+
|
432 |
$type = 'post';
|
433 |
if ($post->post_type == 'attachment') $type = 'attachment';
|
434 |
+
|
435 |
$insert_data = apply_filters('relevanssi_indexing_data', $insert_data, $post);
|
436 |
|
437 |
$values = array();
|
458 |
|
459 |
array_push($values, $value);
|
460 |
}
|
461 |
+
|
462 |
$values = apply_filters('relevanssi_indexing_values', $values, $post);
|
463 |
+
|
464 |
if (!empty($values)) {
|
465 |
$values = implode(', ', $values);
|
466 |
$query = "INSERT IGNORE INTO $relevanssi_table (doc, term, term_reverse, content, title, comment, tag, link, author, category, excerpt, taxonomy, customfield, type, taxonomy_detail, customfield_detail, mysqlcolumn)
|
491 |
|
492 |
if (null == $post) return $insert_data;
|
493 |
if ("" == $taxonomy) return $insert_data;
|
494 |
+
|
495 |
$min_word_length = get_option('relevanssi_min_word_length', 3);
|
496 |
$ptagobj = get_the_terms($post->ID, $taxonomy);
|
497 |
+
if ($ptagobj !== FALSE) {
|
498 |
$tagstr = "";
|
499 |
foreach ($ptagobj as $ptag) {
|
500 |
if (is_object($ptag)) {
|
501 |
$tagstr .= $ptag->name . ' ';
|
502 |
}
|
503 |
+
}
|
504 |
$tagstr = trim($tagstr);
|
505 |
+
$ptags = relevanssi_tokenize($tagstr, true, $min_word_length);
|
506 |
if (count($ptags) > 0) {
|
507 |
foreach ($ptags as $ptag => $count) {
|
508 |
$n++;
|
509 |
+
|
510 |
if ('post_tags' == $taxonomy) {
|
511 |
$insert_data[$ptag]['tag'] = $count;
|
512 |
}
|
535 |
}
|
536 |
$insert_data[$ptag]['taxonomy_detail'] = serialize($tax_detail);
|
537 |
}
|
538 |
+
}
|
539 |
}
|
540 |
return $insert_data;
|
541 |
}
|
555 |
|| (in_array($post->post_type, array('attachment', 'revision')))) {
|
556 |
return;
|
557 |
}
|
558 |
+
|
559 |
$q = "SELECT * FROM $wpdb->posts WHERE post_parent=$post->ID AND post_type!='revision'";
|
560 |
$child_posts = $wpdb->get_results($q);
|
561 |
if ($child_posts) {
|
603 |
|
604 |
function relevanssi_publish($post, $bypassglobalpost = false) {
|
605 |
global $relevanssi_publish_doc;
|
606 |
+
|
607 |
$post_status = get_post_status($post);
|
608 |
if ('auto-draft' == $post_status) return;
|
609 |
|
636 |
}
|
637 |
}
|
638 |
|
639 |
+
//Added by OdditY ->
|
640 |
function relevanssi_comment_edit($comID) {
|
641 |
relevanssi_comment_index($comID,$action="update");
|
642 |
}
|
649 |
global $wpdb;
|
650 |
$comtype = get_option("relevanssi_index_comments");
|
651 |
switch ($comtype) {
|
652 |
+
case "all":
|
653 |
// all (incl. customs, track-&pingbacks)
|
654 |
break;
|
655 |
+
case "normal":
|
656 |
// normal (excl. customs, track-&pingbacks)
|
657 |
$restriction=" AND comment_type='' ";
|
658 |
break;
|
661 |
return ;
|
662 |
}
|
663 |
switch ($action) {
|
664 |
+
case "update":
|
665 |
//(update) comment status changed:
|
666 |
$cpostID = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID='$comID'".$restriction);
|
667 |
break;
|
668 |
+
case "remove":
|
669 |
//(remove) approved comment will be deleted (if not approved, its not in index):
|
670 |
$cpostID = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID='$comID' AND comment_approved='1'".$restriction);
|
671 |
if($cpostID!=NULL) {
|
672 |
//empty comment_content & reindex, then let WP delete the empty comment
|
673 |
$wpdb->query("UPDATE $wpdb->comments SET comment_content='' WHERE comment_ID='$comID'");
|
674 |
+
}
|
675 |
break;
|
676 |
default:
|
677 |
// (add) new comment:
|
678 |
$cpostID = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID='$comID' AND comment_approved='1'".$restriction);
|
679 |
break;
|
680 |
}
|
681 |
+
if($cpostID!=NULL) relevanssi_publish($cpostID);
|
682 |
}
|
683 |
//Added by OdditY END <-
|
684 |
|
685 |
+
function relevanssi_get_comments($postID) {
|
686 |
global $wpdb;
|
687 |
|
688 |
if (apply_filters('relevanssi_index_comments_exclude', false, $postID))
|
692 |
$restriction = "";
|
693 |
$comment_string = "";
|
694 |
switch ($comtype) {
|
695 |
+
case "all":
|
696 |
// all (incl. customs, track- & pingbacks)
|
697 |
break;
|
698 |
+
case "normal":
|
699 |
// normal (excl. customs, track- & pingbacks)
|
700 |
$restriction=" AND comment_type='' ";
|
701 |
break;
|
711 |
$sql = "SELECT comment_ID, comment_content, comment_author
|
712 |
FROM $wpdb->comments
|
713 |
WHERE comment_post_ID = '$postID'
|
714 |
+
AND comment_approved = '1'
|
715 |
".$restriction."
|
716 |
+
LIMIT $from, $to";
|
717 |
$comments = $wpdb->get_results($sql);
|
718 |
if (sizeof($comments) == 0) break;
|
719 |
foreach($comments as $comment) {
|
721 |
}
|
722 |
$from += $to;
|
723 |
}
|
724 |
+
|
725 |
return $comment_string;
|
726 |
}
|
727 |
|
728 |
+
/**
|
729 |
+
* Indexes the human-readable value of "choice" options list ACF
|
730 |
+
* Droz Raphaël, June 2016
|
731 |
+
*/
|
732 |
+
function relevanssi_index_acf(&$insert_data, $post_id, $field_name, $field_value) {
|
733 |
+
if (! is_plugin_active('advanced-custom-fields/acf.php')) return ;
|
734 |
+
|
735 |
+
$field_object = get_field_object($field_name, $post_id);
|
736 |
+
if (! isset($field_object['choices'])) return; // not a "select" field
|
737 |
+
if (! isset($field_object['choices'][$field_value])) return; // value does not exist
|
738 |
+
|
739 |
+
if ( ($value = $field_object['choices'][$field_value]) ) {
|
740 |
+
$insert_data[$value]['customfield']++;
|
741 |
+
}
|
742 |
+
}
|
743 |
+
?>
|
lib/init.php
CHANGED
@@ -118,6 +118,9 @@ function relevanssi_create_database_tables($relevanssi_db_version) {
|
|
118 |
if ($wpdb->collate == '' && $wpdb->charset == "utf8") {
|
119 |
$charset_collate_bin_column .= " COLLATE utf8_bin";
|
120 |
}
|
|
|
|
|
|
|
121 |
}
|
122 |
|
123 |
$relevanssi_table = $wpdb->prefix . "relevanssi";
|
@@ -220,6 +223,9 @@ function relevanssi_create_database_tables($relevanssi_db_version) {
|
|
220 |
if ($wpdb->collate == '' && $wpdb->charset == "utf8") {
|
221 |
$charset_collate_bin_column .= " COLLATE utf8_bin";
|
222 |
}
|
|
|
|
|
|
|
223 |
}
|
224 |
|
225 |
$sql = "ALTER TABLE $relevanssi_stopword_table MODIFY COLUMN stopword varchar(50) $charset_collate_bin_column NOT NULL";
|
118 |
if ($wpdb->collate == '' && $wpdb->charset == "utf8") {
|
119 |
$charset_collate_bin_column .= " COLLATE utf8_bin";
|
120 |
}
|
121 |
+
if ($wpdb->collate == '' && $wpdb->charset == "utf8mb4") {
|
122 |
+
$charset_collate_bin_column .= " COLLATE utf8mb4_bin";
|
123 |
+
}
|
124 |
}
|
125 |
|
126 |
$relevanssi_table = $wpdb->prefix . "relevanssi";
|
223 |
if ($wpdb->collate == '' && $wpdb->charset == "utf8") {
|
224 |
$charset_collate_bin_column .= " COLLATE utf8_bin";
|
225 |
}
|
226 |
+
if ($wpdb->collate == '' && $wpdb->charset == "utf8mb4") {
|
227 |
+
$charset_collate_bin_column .= " COLLATE utf8mb4_bin";
|
228 |
+
}
|
229 |
}
|
230 |
|
231 |
$sql = "ALTER TABLE $relevanssi_stopword_table MODIFY COLUMN stopword varchar(50) $charset_collate_bin_column NOT NULL";
|
lib/interface.php
CHANGED
@@ -15,13 +15,13 @@ function relevanssi_options() {
|
|
15 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
16 |
update_relevanssi_options();
|
17 |
}
|
18 |
-
|
19 |
if (isset($_REQUEST['index'])) {
|
20 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
21 |
update_relevanssi_options();
|
22 |
relevanssi_build_index();
|
23 |
}
|
24 |
-
|
25 |
if (isset($_REQUEST['index_extend'])) {
|
26 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
27 |
update_relevanssi_options();
|
@@ -35,11 +35,11 @@ function relevanssi_options() {
|
|
35 |
relevanssi_import_options($options);
|
36 |
}
|
37 |
}
|
38 |
-
|
39 |
if (isset($_REQUEST['search'])) {
|
40 |
relevanssi_search($_REQUEST['q']);
|
41 |
}
|
42 |
-
|
43 |
if (isset($_REQUEST['dowhat'])) {
|
44 |
if ("add_stopword" == $_REQUEST['dowhat']) {
|
45 |
if (isset($_REQUEST['term'])) {
|
@@ -48,29 +48,29 @@ function relevanssi_options() {
|
|
48 |
}
|
49 |
}
|
50 |
}
|
51 |
-
|
52 |
if (isset($_REQUEST['addstopword'])) {
|
53 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
54 |
relevanssi_add_stopword($_REQUEST['addstopword']);
|
55 |
}
|
56 |
-
|
57 |
if (isset($_REQUEST['removestopword'])) {
|
58 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
59 |
relevanssi_remove_stopword($_REQUEST['removestopword']);
|
60 |
}
|
61 |
-
|
62 |
if (isset($_REQUEST['removeallstopwords'])) {
|
63 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
64 |
relevanssi_remove_all_stopwords();
|
65 |
}
|
66 |
}
|
67 |
relevanssi_options_form();
|
68 |
-
|
69 |
-
if (apply_filters('relevanssi_display_common_words', true))
|
70 |
relevanssi_common_words();
|
71 |
-
|
72 |
echo "<div style='clear:both'></div>";
|
73 |
-
|
74 |
echo "</div>";
|
75 |
}
|
76 |
|
@@ -110,19 +110,19 @@ function relevanssi_search_stats() {
|
|
110 |
else {
|
111 |
echo "<p>" . __('Enable query logging to see stats here.', 'relevanssi') . "</p>";
|
112 |
}
|
113 |
-
|
114 |
echo "</div>";
|
115 |
-
|
116 |
if ('on' != $relevanssi_hide_branding )
|
117 |
relevanssi_sidebar();
|
118 |
}
|
119 |
|
120 |
function relevanssi_truncate_logs() {
|
121 |
global $wpdb, $relevanssi_variables;
|
122 |
-
|
123 |
$query = "TRUNCATE " . $relevanssi_variables['log_table'];
|
124 |
$wpdb->query($query);
|
125 |
-
|
126 |
echo "<div id='relevanssi-warning' class='updated fade'>" . __('Logs clear!', 'relevanssi') . "</div>";
|
127 |
}
|
128 |
|
@@ -213,7 +213,7 @@ function update_relevanssi_options() {
|
|
213 |
update_option('relevanssi_excerpt_length', $value);
|
214 |
}
|
215 |
}
|
216 |
-
|
217 |
if (isset($_REQUEST['relevanssi_synonyms'])) {
|
218 |
$linefeeds = array("\r\n", "\n", "\r");
|
219 |
$value = str_replace($linefeeds, ";", $_REQUEST['relevanssi_synonyms']);
|
@@ -250,7 +250,7 @@ function update_relevanssi_options() {
|
|
250 |
if ('on' == $value) $index_terms_list[$type] = true;
|
251 |
}
|
252 |
}
|
253 |
-
|
254 |
if (count($post_type_weights) > 0) {
|
255 |
update_option('relevanssi_post_type_weights', $post_type_weights);
|
256 |
}
|
@@ -263,11 +263,11 @@ function update_relevanssi_options() {
|
|
263 |
if (RELEVANSSI_PREMIUM) update_option('relevanssi_index_terms', array_keys($index_terms_list));
|
264 |
|
265 |
if (isset($_REQUEST['relevanssi_admin_search'])) update_option('relevanssi_admin_search', $_REQUEST['relevanssi_admin_search']);
|
266 |
-
if (isset($_REQUEST['relevanssi_excerpts'])) update_option('relevanssi_excerpts', $_REQUEST['relevanssi_excerpts']);
|
267 |
-
if (isset($_REQUEST['relevanssi_excerpt_type'])) update_option('relevanssi_excerpt_type', $_REQUEST['relevanssi_excerpt_type']);
|
268 |
if (isset($_REQUEST['relevanssi_excerpt_allowable_tags'])) update_option('relevanssi_excerpt_allowable_tags', $_REQUEST['relevanssi_excerpt_allowable_tags']);
|
269 |
-
if (isset($_REQUEST['relevanssi_log_queries'])) update_option('relevanssi_log_queries', $_REQUEST['relevanssi_log_queries']);
|
270 |
-
if (isset($_REQUEST['relevanssi_log_queries_with_ip'])) update_option('relevanssi_log_queries_with_ip', $_REQUEST['relevanssi_log_queries_with_ip']);
|
271 |
if (isset($_REQUEST['relevanssi_highlight'])) update_option('relevanssi_highlight', $_REQUEST['relevanssi_highlight']);
|
272 |
if (isset($_REQUEST['relevanssi_highlight_docs'])) update_option('relevanssi_highlight_docs', $_REQUEST['relevanssi_highlight_docs']);
|
273 |
if (isset($_REQUEST['relevanssi_highlight_comments'])) update_option('relevanssi_highlight_comments', $_REQUEST['relevanssi_highlight_comments']);
|
@@ -280,8 +280,8 @@ function update_relevanssi_options() {
|
|
280 |
if (isset($_REQUEST['relevanssi_extag'])) update_option('relevanssi_extag', $_REQUEST['relevanssi_extag']);
|
281 |
if (isset($_REQUEST['relevanssi_index_fields'])) update_option('relevanssi_index_fields', $_REQUEST['relevanssi_index_fields']);
|
282 |
if (isset($_REQUEST['relevanssi_expst'])) update_option('relevanssi_exclude_posts', $_REQUEST['relevanssi_expst']); //added by OdditY
|
283 |
-
if (isset($_REQUEST['relevanssi_hilite_title'])) update_option('relevanssi_hilite_title', $_REQUEST['relevanssi_hilite_title']); //added by OdditY
|
284 |
-
if (isset($_REQUEST['relevanssi_index_comments'])) update_option('relevanssi_index_comments', $_REQUEST['relevanssi_index_comments']); //added by OdditY
|
285 |
if (isset($_REQUEST['relevanssi_index_author'])) update_option('relevanssi_index_author', $_REQUEST['relevanssi_index_author']);
|
286 |
if (isset($_REQUEST['relevanssi_index_excerpt'])) update_option('relevanssi_index_excerpt', $_REQUEST['relevanssi_index_excerpt']);
|
287 |
if (isset($_REQUEST['relevanssi_fuzzy'])) update_option('relevanssi_fuzzy', $_REQUEST['relevanssi_fuzzy']);
|
@@ -305,10 +305,10 @@ function update_relevanssi_options() {
|
|
305 |
function relevanssi_add_stopword($term) {
|
306 |
global $wpdb;
|
307 |
if ('' == $term) return; // do not add empty $term to stopwords - added by renaissancehack
|
308 |
-
|
309 |
$n = 0;
|
310 |
$s = 0;
|
311 |
-
|
312 |
$terms = explode(',', $term);
|
313 |
if (count($terms) > 1) {
|
314 |
foreach($terms as $term) {
|
@@ -322,12 +322,12 @@ function relevanssi_add_stopword($term) {
|
|
322 |
else {
|
323 |
// add to stopwords
|
324 |
$success = relevanssi_add_single_stopword($term);
|
325 |
-
|
326 |
if ($success) {
|
327 |
-
printf(__("<div id='message' class='updated fade'><p>Term '%s' added to stopwords!</p></div>", "relevanssi"), $term);
|
328 |
}
|
329 |
else {
|
330 |
-
printf(__("<div id='message' class='updated fade'><p>Couldn't add term '%s' to stopwords!</p></div>", "relevanssi"), $term);
|
331 |
}
|
332 |
}
|
333 |
}
|
@@ -336,18 +336,20 @@ function relevanssi_add_single_stopword($term) {
|
|
336 |
global $wpdb, $relevanssi_variables;
|
337 |
if ('' == $term) return;
|
338 |
|
|
|
|
|
339 |
if (method_exists($wpdb, 'esc_like')) {
|
340 |
-
$term = $wpdb->esc_like(
|
341 |
}
|
342 |
else {
|
343 |
// Compatibility for pre-4.0 WordPress
|
344 |
-
$term = like_escape(
|
345 |
}
|
346 |
|
347 |
$q = $wpdb->prepare("INSERT INTO " . $relevanssi_variables['stopword_table'] . " (stopword) VALUES (%s)", $term);
|
348 |
// Clean: escaped.
|
349 |
$success = $wpdb->query($q);
|
350 |
-
|
351 |
if ($success) {
|
352 |
// remove from index
|
353 |
$q = $wpdb->prepare("DELETE FROM " . $relevanssi_variables['relevanssi_table'] . " WHERE term=%s", $term);
|
@@ -361,37 +363,37 @@ function relevanssi_add_single_stopword($term) {
|
|
361 |
|
362 |
function relevanssi_remove_all_stopwords() {
|
363 |
global $wpdb, $relevanssi_variables;
|
364 |
-
|
365 |
$success = $wpdb->query("TRUNCATE " . $relevanssi_variables['stopword_table']);
|
366 |
-
|
367 |
printf(__("<div id='message' class='updated fade'><p>Stopwords removed! Remember to re-index.</p></div>", "relevanssi"), $term);
|
368 |
}
|
369 |
|
370 |
function relevanssi_remove_stopword($term) {
|
371 |
global $wpdb, $relevanssi_variables;
|
372 |
-
|
373 |
$q = $wpdb->prepare("DELETE FROM " . $relevanssi_variables['stopword_table'] . " WHERE stopword=%s", $term);
|
374 |
$success = $wpdb->query($q);
|
375 |
-
|
376 |
if ($success) {
|
377 |
-
printf(__("<div id='message' class='updated fade'><p>Term '%s' removed from stopwords! Re-index to get it back to index.</p></div>", "relevanssi"), $term);
|
378 |
}
|
379 |
else {
|
380 |
-
printf(__("<div id='message' class='updated fade'><p>Couldn't remove term '%s' from stopwords!</p></div>", "relevanssi"), $term);
|
381 |
}
|
382 |
}
|
383 |
|
384 |
function relevanssi_common_words() {
|
385 |
global $wpdb, $relevanssi_variables, $wp_version;
|
386 |
-
|
387 |
RELEVANSSI_PREMIUM ? $plugin = 'relevanssi-premium' : $plugin = 'relevanssi';
|
388 |
-
|
389 |
echo "<div style='float:left; width: 45%'>";
|
390 |
-
|
391 |
echo "<h3>" . __("25 most common words in the index", 'relevanssi') . "</h3>";
|
392 |
-
|
393 |
echo "<p>" . __("These words are excellent stopword material. A word that appears in most of the posts in the database is quite pointless when searching. This is also an easy way to create a completely new stopword list, if one isn't available in your language. Click the icon after the word to add the word to the stopword list. The word will also be removed from the index, so rebuilding the index is not necessary.", 'relevanssi') . "</p>";
|
394 |
-
|
395 |
$words = $wpdb->get_results("SELECT COUNT(DISTINCT(doc)) as cnt, term
|
396 |
FROM " . $relevanssi_variables['relevanssi_table'] . " GROUP BY term ORDER BY cnt DESC LIMIT 25");
|
397 |
|
@@ -414,22 +416,24 @@ function relevanssi_common_words() {
|
|
414 |
// We can't check, so let's assume something sensible
|
415 |
$src = '/wp-content/plugins/' . $plugin . '/delete.png';
|
416 |
}
|
417 |
-
|
418 |
foreach ($words as $word) {
|
419 |
$stop = __('Add to stopwords', 'relevanssi');
|
420 |
printf('<li>%s (%d) <input style="padding: 0; margin: 0" type="image" src="%s" alt="%s" name="term" value="%s"/></li>', $word->term, $word->cnt, $src, $stop, $word->term);
|
421 |
}
|
422 |
echo "</ul>\n</form>";
|
423 |
-
|
424 |
echo "</div>";
|
425 |
}
|
426 |
|
427 |
function relevanssi_query_log() {
|
428 |
global $wpdb;
|
429 |
|
|
|
|
|
430 |
echo '<h3>' . __("Total Searches", 'relevanssi') . '</h3>';
|
431 |
|
432 |
-
echo "<div style='width: 30%; float: left; margin-right: 2
|
433 |
relevanssi_total_queries( __("Totals", 'relevanssi') );
|
434 |
echo '</div>';
|
435 |
|
@@ -438,37 +442,37 @@ function relevanssi_query_log() {
|
|
438 |
echo '<h3>' . __("Common Queries", 'relevanssi') . '</h3>';
|
439 |
|
440 |
$limit = apply_filters('relevanssi_user_searches_limit', 20);
|
441 |
-
$lead = __("Here you can see the $limit most common user search queries, how many times those
|
442 |
queries were made and how many results were found for those queries.", 'relevanssi');
|
443 |
|
444 |
echo "<p>$lead</p>";
|
445 |
-
|
446 |
-
echo "<div style='width: 30%; float: left; margin-right: 2
|
447 |
relevanssi_date_queries(1, __("Today and yesterday", 'relevanssi'));
|
448 |
echo '</div>';
|
449 |
|
450 |
-
echo "<div style='width: 30%; float: left; margin-right: 2
|
451 |
relevanssi_date_queries(7, __("Last 7 days", 'relevanssi'));
|
452 |
echo '</div>';
|
453 |
|
454 |
-
echo "<div style='width: 30%; float: left; margin-right: 2
|
455 |
-
relevanssi_date_queries(
|
456 |
echo '</div>';
|
457 |
|
458 |
echo '<div style="clear: both"></div>';
|
459 |
-
|
460 |
echo '<h3>' . __("Unsuccessful Queries", 'relevanssi') . '</h3>';
|
461 |
|
462 |
-
echo "<div style='width: 30%; float: left; margin-right: 2
|
463 |
relevanssi_date_queries(1, __("Today and yesterday", 'relevanssi'), 'bad');
|
464 |
echo '</div>';
|
465 |
|
466 |
-
echo "<div style='width: 30%; float: left; margin-right: 2
|
467 |
relevanssi_date_queries(7, __("Last 7 days", 'relevanssi'), 'bad');
|
468 |
echo '</div>';
|
469 |
|
470 |
-
echo "<div style='width: 30%; float: left; margin-right: 2
|
471 |
-
relevanssi_date_queries(
|
472 |
echo '</div>';
|
473 |
|
474 |
if ( current_user_can('manage_options') ) {
|
@@ -508,9 +512,9 @@ function relevanssi_total_queries( $title ) {
|
|
508 |
function relevanssi_date_queries($d, $title, $version = 'good') {
|
509 |
global $wpdb, $relevanssi_variables;
|
510 |
$log_table = $relevanssi_variables['log_table'];
|
511 |
-
|
512 |
$limit = apply_filters('relevanssi_user_searches_limit', 20);
|
513 |
-
|
514 |
if ($version == 'good')
|
515 |
$queries = $wpdb->get_results("SELECT COUNT(DISTINCT(id)) as cnt, query, hits
|
516 |
FROM $log_table
|
@@ -518,7 +522,7 @@ function relevanssi_date_queries($d, $title, $version = 'good') {
|
|
518 |
GROUP BY query
|
519 |
ORDER BY cnt DESC
|
520 |
LIMIT $limit");
|
521 |
-
|
522 |
if ($version == 'bad')
|
523 |
$queries = $wpdb->get_results("SELECT COUNT(DISTINCT(id)) as cnt, query, hits
|
524 |
FROM $log_table
|
@@ -541,7 +545,7 @@ function relevanssi_date_queries($d, $title, $version = 'good') {
|
|
541 |
|
542 |
function relevanssi_options_form() {
|
543 |
global $relevanssi_variables, $wpdb;
|
544 |
-
|
545 |
wp_enqueue_style('dashboard');
|
546 |
wp_print_styles('dashboard');
|
547 |
wp_enqueue_script('dashboard');
|
@@ -550,9 +554,9 @@ function relevanssi_options_form() {
|
|
550 |
$docs_count = $wpdb->get_var("SELECT COUNT(DISTINCT doc) FROM " . $relevanssi_variables['relevanssi_table']);
|
551 |
$terms_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $relevanssi_variables['relevanssi_table']);
|
552 |
$biggest_doc = $wpdb->get_var("SELECT doc FROM " . $relevanssi_variables['relevanssi_table'] . " ORDER BY doc DESC LIMIT 1");
|
553 |
-
|
554 |
$serialize_options = array();
|
555 |
-
|
556 |
$title_boost = get_option('relevanssi_title_boost');
|
557 |
$serialize_options['relevanssi_title_boost'] = $title_boost;
|
558 |
$comment_boost = get_option('relevanssi_comment_boost');
|
@@ -577,7 +581,7 @@ function relevanssi_options_form() {
|
|
577 |
else {
|
578 |
$excerpts = '';
|
579 |
}
|
580 |
-
|
581 |
$excerpt_length = get_option('relevanssi_excerpt_length');
|
582 |
$serialize_options['relevanssi_excerpt_length'] = $excerpt_length;
|
583 |
$excerpt_type = get_option('relevanssi_excerpt_type');
|
@@ -613,7 +617,7 @@ function relevanssi_options_form() {
|
|
613 |
$log_queries_with_ip = '';
|
614 |
}
|
615 |
|
616 |
-
$hide_branding = get_option('relevanssi_hide_branding');
|
617 |
$serialize_options['relevanssi_hide_branding'] = $hide_branding;
|
618 |
if ('on' == $hide_branding) {
|
619 |
$hide_branding = 'checked="checked"';
|
@@ -621,7 +625,7 @@ function relevanssi_options_form() {
|
|
621 |
else {
|
622 |
$hide_branding = '';
|
623 |
}
|
624 |
-
|
625 |
$highlight = get_option('relevanssi_highlight');
|
626 |
$serialize_options['relevanssi_highlight'] = $highlight;
|
627 |
$highlight_none = "";
|
@@ -658,7 +662,7 @@ function relevanssi_options_form() {
|
|
658 |
$highlight_class = 'selected="selected"';
|
659 |
break;
|
660 |
}
|
661 |
-
|
662 |
$index_fields = get_option('relevanssi_index_fields');
|
663 |
$serialize_options['relevanssi_index_fields'] = $index_fields;
|
664 |
|
@@ -670,14 +674,14 @@ function relevanssi_options_form() {
|
|
670 |
$serialize_options['relevanssi_css'] = $css;
|
671 |
$class = get_option('relevanssi_class');
|
672 |
$serialize_options['relevanssi_class'] = $class;
|
673 |
-
|
674 |
$cat = get_option('relevanssi_cat');
|
675 |
$serialize_options['relevanssi_cat'] = $cat;
|
676 |
$excat = get_option('relevanssi_excat');
|
677 |
$serialize_options['relevanssi_excat'] = $excat;
|
678 |
$extag = get_option('relevanssi_extag');
|
679 |
$serialize_options['relevanssi_extag'] = $extag;
|
680 |
-
|
681 |
$fuzzy = get_option('relevanssi_fuzzy');
|
682 |
$serialize_options['relevanssi_fuzzy'] = $fuzzy;
|
683 |
$fuzzy_sometimes = ('sometimes' == $fuzzy ? 'selected="selected"' : '');
|
@@ -702,15 +706,15 @@ function relevanssi_options_form() {
|
|
702 |
|
703 |
$omit_from_logs = get_option('relevanssi_omit_from_logs');
|
704 |
$serialize_options['relevanssi_omit_from_logs'] = $omit_from_logs;
|
705 |
-
|
706 |
$synonyms = get_option('relevanssi_synonyms');
|
707 |
$serialize_options['relevanssi_synonyms'] = $synonyms;
|
708 |
isset($synonyms) ? $synonyms = str_replace(';', "\n", $synonyms) : $synonyms = "";
|
709 |
-
|
710 |
//Added by OdditY ->
|
711 |
-
$expst = get_option('relevanssi_exclude_posts');
|
712 |
$serialize_options['relevanssi_exclude_posts'] = $expst;
|
713 |
-
$hititle = ('on' == get_option('relevanssi_hilite_title') ? 'checked="checked"' : '');
|
714 |
$serialize_options['relevanssi_hilite_title'] = get_option('relevanssi_hilite_title');
|
715 |
$incom_type = get_option('relevanssi_index_comments');
|
716 |
$serialize_options['relevanssi_index_comments'] = $incom_type;
|
@@ -729,31 +733,31 @@ function relevanssi_options_form() {
|
|
729 |
break;
|
730 |
}//added by OdditY END <-
|
731 |
|
732 |
-
$highlight_docs = ('on' == get_option('relevanssi_highlight_docs') ? 'checked="checked"' : '');
|
733 |
-
$highlight_coms = ('on' == get_option('relevanssi_highlight_comments') ? 'checked="checked"' : '');
|
734 |
$serialize_options['relevanssi_highlight_docs'] = get_option('relevanssi_highlight_docs');
|
735 |
$serialize_options['relevanssi_highlight_comments'] = get_option('relevanssi_highlight_comments');
|
736 |
|
737 |
-
$respect_exclude = ('on' == get_option('relevanssi_respect_exclude') ? 'checked="checked"' : '');
|
738 |
$serialize_options['relevanssi_respect_exclude'] = get_option('relevanssi_respect_exclude');
|
739 |
|
740 |
$min_word_length = get_option('relevanssi_min_word_length');
|
741 |
$serialize_options['relevanssi_min_word_length'] = $min_word_length;
|
742 |
|
743 |
-
$index_author = ('on' == get_option('relevanssi_index_author') ? 'checked="checked"' : '');
|
744 |
$serialize_options['relevanssi_index_author'] = get_option('relevanssi_index_author');
|
745 |
-
$index_excerpt = ('on' == get_option('relevanssi_index_excerpt') ? 'checked="checked"' : '');
|
746 |
$serialize_options['relevanssi_index_excerpt'] = get_option('relevanssi_index_excerpt');
|
747 |
-
|
748 |
$show_matches = ('on' == get_option('relevanssi_show_matches') ? 'checked="checked"' : '');
|
749 |
$serialize_options['relevanssi_show_matches'] = get_option('relevanssi_show_matches');
|
750 |
$show_matches_text = stripslashes(get_option('relevanssi_show_matches_text'));
|
751 |
$serialize_options['relevanssi_show_matches_text'] = get_option('relevanssi_show_matches_text');
|
752 |
-
|
753 |
-
$wpml_only_current = ('on' == get_option('relevanssi_wpml_only_current') ? 'checked="checked"' : '');
|
754 |
$serialize_options['relevanssi_wpml_only_current'] = get_option('relevanssi_wpml_only_current');
|
755 |
|
756 |
-
$word_boundaries = ('on' == get_option('relevanssi_word_boundaries') ? 'checked="checked"' : '');
|
757 |
$serialize_options['relevanssi_word_boundaries'] = get_option('relevanssi_word_boundaries');
|
758 |
|
759 |
$post_type_weights = get_option('relevanssi_post_type_weights');
|
@@ -771,8 +775,8 @@ function relevanssi_options_form() {
|
|
771 |
$serialize_options['relevanssi_default_orderby'] = $orderby;
|
772 |
$orderby_relevance = ('relevance' == $orderby ? 'selected="selected"' : '');
|
773 |
$orderby_date = ('post_date' == $orderby ? 'selected="selected"' : '');
|
774 |
-
|
775 |
-
if (RELEVANSSI_PREMIUM) {
|
776 |
$api_key = get_option('relevanssi_api_key');
|
777 |
$serialize_options['relevanssi_api_key'] = $api_key;
|
778 |
|
@@ -785,42 +789,42 @@ function relevanssi_options_form() {
|
|
785 |
$intlinks_nostrip = ('nostrip' == $intlinks ? 'selected="selected"' : '');
|
786 |
$intlinks_noindex = ('noindex' == $intlinks ? 'selected="selected"' : '');
|
787 |
|
788 |
-
$highlight_docs_ext = ('on' == get_option('relevanssi_highlight_docs_external') ? 'checked="checked"' : '');
|
789 |
$serialize_options['relevanssi_highlight_docs_external'] = get_option('relevanssi_highlight_docs_external');
|
790 |
-
|
791 |
$thousand_separator = get_option('relevanssi_thousand_separator');
|
792 |
$serialize_options['relevanssi_thousand_separator'] = $thousand_separator;
|
793 |
|
794 |
$disable_shortcodes = get_option('relevanssi_disable_shortcodes');
|
795 |
$serialize_options['relevanssi_disable_shortcodes'] = $disable_shortcodes;
|
796 |
-
|
797 |
-
$index_users = ('on' == get_option('relevanssi_index_users') ? 'checked="checked"' : '');
|
798 |
$serialize_options['relevanssi_index_users'] = get_option('relevanssi_index_users');
|
799 |
-
|
800 |
$index_user_fields = get_option('relevanssi_index_user_fields');
|
801 |
$serialize_options['relevanssi_index_user_fields'] = $index_user_fields;
|
802 |
-
|
803 |
-
$index_subscribers = ('on' == get_option('relevanssi_index_subscribers') ? 'checked="checked"' : '');
|
804 |
$serialize_options['relevanssi_index_subscribers'] = get_option('relevanssi_index_subscribers');
|
805 |
|
806 |
-
$index_synonyms = ('on' == get_option('relevanssi_index_synonyms') ? 'checked="checked"' : '');
|
807 |
$serialize_options['relevanssi_index_synonyms'] = get_option('relevanssi_index_synonyms');
|
808 |
-
|
809 |
-
$index_taxonomies = ('on' == get_option('relevanssi_index_taxonomies') ? 'checked="checked"' : '');
|
810 |
$serialize_options['relevanssi_index_taxonomies'] = get_option('relevanssi_index_taxonomies');
|
811 |
|
812 |
$index_terms = get_option('relevanssi_index_terms');
|
813 |
if (empty($index_terms)) $index_terms = array();
|
814 |
$serialize_options['relevanssi_index_terms'] = $index_terms;
|
815 |
-
|
816 |
-
$hide_post_controls = ('on' == get_option('relevanssi_hide_post_controls') ? 'checked="checked"' : '');
|
817 |
$serialize_options['relevanssi_hide_post_controls'] = get_option('relevanssi_hide_post_controls');
|
818 |
|
819 |
$recency_bonus_array = get_option('relevanssi_recency_bonus');
|
820 |
$serialize_options['recency_bonus'] = $recency_bonus_array;
|
821 |
$recency_bonus = $recency_bonus_array['bonus'];
|
822 |
$recency_bonus_days = $recency_bonus_array['days'];
|
823 |
-
|
824 |
$mysql_columns = get_option('relevanssi_mysql_columns');
|
825 |
$serialize_options['relevanssi_mysql_columns'] = $mysql_columns;
|
826 |
|
@@ -829,15 +833,15 @@ function relevanssi_options_form() {
|
|
829 |
|
830 |
echo "<div class='postbox-container' style='width:70%;'>";
|
831 |
|
832 |
-
if (RELEVANSSI_PREMIUM) {
|
833 |
echo "<form method='post' action='options-general.php?page=relevanssi-premium/relevanssi.php'>";
|
834 |
}
|
835 |
else {
|
836 |
echo "<form method='post'>";
|
837 |
}
|
838 |
-
|
839 |
wp_nonce_field(plugin_basename($relevanssi_variables['file']), 'relevanssi_options'); ?>
|
840 |
-
|
841 |
<p><a href="#basic"><?php _e("Basic options", "relevanssi"); ?></a> |
|
842 |
<a href="#weights"><?php _e("Weights", "relevanssi"); ?></a> |
|
843 |
<a href="#logs"><?php _e("Logs", "relevanssi"); ?></a> |
|
@@ -877,7 +881,7 @@ function relevanssi_options_form() {
|
|
877 |
<?php _e("Terms in the index", "relevanssi"); ?>: <strong><?php echo $terms_count ?></strong><br />
|
878 |
<?php _e("Highest post ID indexed", "relevanssi"); ?>: <strong><?php echo $biggest_doc ?></strong>
|
879 |
</p>
|
880 |
-
|
881 |
<h3 id="basic"><?php _e("Basic options", "relevanssi"); ?></h3>
|
882 |
|
883 |
<?php
|
@@ -896,7 +900,7 @@ function relevanssi_options_form() {
|
|
896 |
<option value='OR' <?php echo $implicit_or ?>><?php _e("OR - any term present is enough", "relevanssi"); ?></option>
|
897 |
</select></label><br />
|
898 |
<small><?php _e("If you choose AND and the search finds no matches, it will automatically do an OR search.", "relevanssi"); ?></small>
|
899 |
-
|
900 |
<br /><br />
|
901 |
|
902 |
<label for='relevanssi_disable_or_fallback'><?php _e("Disable OR fallback:", "relevanssi"); ?>
|
@@ -911,7 +915,7 @@ function relevanssi_options_form() {
|
|
911 |
<option value='post_date' <?php echo $orderby_date ?>><?php _e("Post date", "relevanssi"); ?></option>
|
912 |
</select></label><br />
|
913 |
<small><?php _e("If you want date-based results, see the recent post bonus in the Weights section.", "relevanssi"); ?></small>
|
914 |
-
|
915 |
<br /><br />
|
916 |
|
917 |
<label for='relevanssi_fuzzy'><?php _e('When to use fuzzy matching?', 'relevanssi'); ?>
|
@@ -927,7 +931,7 @@ function relevanssi_options_form() {
|
|
927 |
<?php
|
928 |
if (function_exists('relevanssi_form_internal_links')) relevanssi_form_internal_links($intlinks_noindex, $intlinks_strip, $intlinks_nostrip);
|
929 |
?>
|
930 |
-
|
931 |
<label for='relevanssi_throttle'><?php _e("Limit searches:", "relevanssi"); ?>
|
932 |
<input type='checkbox' name='relevanssi_throttle' id='relevanssi_throttle' <?php echo $throttle ?> /></label><br />
|
933 |
<small><?php _e("If this option is checked, Relevanssi will limit search results to at most 500 results per term. This will improve performance, but may cause some relevant documents to go unfound. However, Relevanssi tries to prioritize the most relevant documents. <strong>This does not work well when sorting results by date.</strong> The throttle can end up cutting off recent posts to favour more relevant posts.", 'relevanssi'); ?></small>
|
@@ -939,15 +943,15 @@ function relevanssi_options_form() {
|
|
939 |
<small><?php printf(__("For better performance, adjust the limit to a smaller number. Adjusting the limit to 100 or 200 should be safe for good results, and might bring a boost in search speed. DO NOT use this feature to limit the number of search results on search results pages, as that will lead to problems. For adjusting the number of search results displayed, see <a href='%s'>this knowledge base entry</a>.", 'relevanssi'), 'http://www.relevanssi.com/knowledge-base/posts-per-page/'); ?></small>
|
940 |
|
941 |
<br /><br />
|
942 |
-
|
943 |
<?php
|
944 |
if (function_exists('relevanssi_form_hide_post_controls')) relevanssi_form_hide_post_controls($hide_post_controls);
|
945 |
?>
|
946 |
-
|
947 |
<h3 id="weights"><?php _e('Weights', 'relevanssi'); ?></h3>
|
948 |
|
949 |
<p><?php _e('These values affect the weights of the documents. These are all multipliers, so 1 means no change in weight, less than 1 means less weight, and more than 1 means more weight. Setting something to zero makes that worthless. For example, if title weight is more than 1, words in titles are more significant than words elsewhere. If title weight is 0, words in titles won\'t make any difference to the search results.', 'relevanssi'); ?></p>
|
950 |
-
|
951 |
<table class="widefat">
|
952 |
<thead>
|
953 |
<tr>
|
@@ -970,7 +974,7 @@ function relevanssi_options_form() {
|
|
970 |
<?php if (function_exists('relevanssi_form_link_weight')) relevanssi_form_link_weight($link_boost); ?>
|
971 |
<tr>
|
972 |
<td>
|
973 |
-
<?php _e('Comment text', 'relevanssi'); ?>
|
974 |
</td>
|
975 |
<td>
|
976 |
<input type='text' name='relevanssi_comment_boost' id='relevanssi_comment_boost' size='4' value='<?php echo $comment_boost ?>' />
|
@@ -989,18 +993,18 @@ function relevanssi_options_form() {
|
|
989 |
<br /><br />
|
990 |
|
991 |
<?php if (function_exists('relevanssi_form_recency')) relevanssi_form_recency($recency_bonus, $recency_bonus_days); ?>
|
992 |
-
|
993 |
<?php if (function_exists('icl_object_id')) : ?>
|
994 |
<h3 id="wpml"><?php _e('WPML/Polylang compatibility', 'relevanssi'); ?></h3>
|
995 |
-
|
996 |
<label for='relevanssi_wpml_only_current'><?php _e("Limit results to current language:", "relevanssi"); ?>
|
997 |
<input type='checkbox' name='relevanssi_wpml_only_current' id='relevanssi_wpml_only_current' <?php echo $wpml_only_current ?> /></label>
|
998 |
<small><?php _e("If this option is checked, Relevanssi will only return results in the current active language. Otherwise results will include posts in every language.", "relevanssi");?></small>
|
999 |
-
|
1000 |
<?php endif; ?>
|
1001 |
-
|
1002 |
<h3 id="logs"><?php _e('Logs', 'relevanssi'); ?></h3>
|
1003 |
-
|
1004 |
<label for='relevanssi_log_queries'><?php _e("Keep a log of user queries:", "relevanssi"); ?>
|
1005 |
<input type='checkbox' name='relevanssi_log_queries' id='relevanssi_log_queries' <?php echo $log_queries ?> /></label>
|
1006 |
<small><?php _e("If checked, Relevanssi will log user queries. The log appears in 'User searches' on the Dashboard admin menu.", 'relevanssi'); ?></small>
|
@@ -1029,7 +1033,7 @@ function relevanssi_options_form() {
|
|
1029 |
<?php if (function_exists('relevanssi_form_hide_branding')) relevanssi_form_hide_branding($hide_branding); ?>
|
1030 |
|
1031 |
<h3 id="exclusions"><?php _e("Exclusions and restrictions", "relevanssi"); ?></h3>
|
1032 |
-
|
1033 |
<label for='relevanssi_cat'><?php _e('Restrict search to these categories and tags:', 'relevanssi'); ?>
|
1034 |
<input type='text' name='relevanssi_cat' id='relevanssi_cat' size='20' value='<?php echo esc_attr($cat); ?>' /></label><br />
|
1035 |
<small><?php _e("Enter a comma-separated list of category and tag IDs to restrict search to those categories or tags. You can also use <code><input type='hidden' name='cats' value='list of cats and tags' /></code> in your search form. The input field will overrun this setting.", 'relevanssi'); ?></small>
|
@@ -1066,13 +1070,13 @@ function relevanssi_options_form() {
|
|
1066 |
<small><?php _e("If checked, Relevanssi won't display posts of custom post types that have 'exclude_from_search' set to true. If not checked, Relevanssi will display anything that is indexed.", 'relevanssi'); ?></small>
|
1067 |
|
1068 |
<h3 id="excerpts"><?php _e("Custom excerpts/snippets", "relevanssi"); ?></h3>
|
1069 |
-
|
1070 |
<label for='relevanssi_excerpts'><?php _e("Create custom search result snippets:", "relevanssi"); ?>
|
1071 |
<input type='checkbox' name='relevanssi_excerpts' id='relevanssi_excerpts' <?php echo $excerpts ?> /></label><br />
|
1072 |
<small><?php _e("If checked, Relevanssi will create excerpts that contain the search term hits. To make them work, make sure your search result template uses the_excerpt() to display post excerpts.", 'relevanssi'); ?></small>
|
1073 |
-
|
1074 |
<p><?php _e('Note: Building custom excerpts can be slow. If you are not actually using the excerpts, make sure you disable the option.', 'relevanssi'); ?></p>
|
1075 |
-
|
1076 |
<label for='relevanssi_excerpt_length'><?php _e("Length of the snippet:", "relevanssi"); ?>
|
1077 |
<input type='text' name='relevanssi_excerpt_length' id='relevanssi_excerpt_length' size='4' value='<?php echo esc_attr($excerpt_length); ?>' /></label>
|
1078 |
<select name='relevanssi_excerpt_type' id='relevanssi_excerpt_type'>
|
@@ -1117,7 +1121,7 @@ function relevanssi_options_form() {
|
|
1117 |
<option value='class' <?php echo $highlight_class ?>><?php _e("CSS Class", 'relevanssi'); ?></option>
|
1118 |
</select></label>
|
1119 |
<small><?php _e("Highlighting isn't available unless you use custom snippets", 'relevanssi'); ?></small>
|
1120 |
-
|
1121 |
<br />
|
1122 |
|
1123 |
<label for='relevanssi_hilite_title'><?php _e("Highlight query terms in result titles too:", 'relevanssi'); ?>
|
@@ -1133,57 +1137,57 @@ function relevanssi_options_form() {
|
|
1133 |
<br />
|
1134 |
|
1135 |
<?php if (function_exists('relevanssi_form_highlight_external')) relevanssi_form_highlight_external($highlight_docs_ext); ?>
|
1136 |
-
|
1137 |
<label for='relevanssi_highlight_comments'><?php _e("Highlight query terms in comments:", 'relevanssi'); ?>
|
1138 |
<input type='checkbox' name='relevanssi_highlight_comments' id='relevanssi_highlight_comments' <?php echo $highlight_coms ?> /></label>
|
1139 |
<small><?php _e("Highlights hits in comments when user opens the post from search results.", "relevanssi"); ?></small>
|
1140 |
|
1141 |
<br />
|
1142 |
-
|
1143 |
<label for='relevanssi_word_boundaries'><?php _e("Uncheck this if you use non-ASCII characters:", 'relevanssi'); ?>
|
1144 |
<input type='checkbox' name='relevanssi_word_boundaries' id='relevanssi_word_boundaries' <?php echo $word_boundaries ?> /></label>
|
1145 |
<small><?php _e("If you use non-ASCII characters (like Cyrillic alphabet) and the highlights don't work, uncheck this option to make highlights work.", "relevanssi"); ?></small>
|
1146 |
|
1147 |
<br /><br />
|
1148 |
</div>
|
1149 |
-
|
1150 |
<?php _e("Then adjust the settings for your chosen type:", "relevanssi"); ?><br />
|
1151 |
|
1152 |
<div style='margin-left: 2em'>
|
1153 |
-
|
1154 |
<label for='relevanssi_txt_col'><?php _e("Text color for highlights:", "relevanssi"); ?>
|
1155 |
<input type='text' name='relevanssi_txt_col' id='relevanssi_txt_col' size='7' value='<?php echo esc_attr($txt_col); ?>' /></label>
|
1156 |
<small><?php _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi"); ?></small>
|
1157 |
|
1158 |
<br />
|
1159 |
-
|
1160 |
<label for='relevanssi_bg_col'><?php _e("Background color for highlights:", "relevanssi"); ?>
|
1161 |
<input type='text' name='relevanssi_bg_col' id='relevanssi_bg_col' size='7' value='<?php echo esc_attr($bg_col); ?>' /></label>
|
1162 |
<small><?php _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi"); ?></small>
|
1163 |
|
1164 |
<br />
|
1165 |
-
|
1166 |
<label for='relevanssi_css'><?php _e("CSS style for highlights:", "relevanssi"); ?>
|
1167 |
<input type='text' name='relevanssi_css' id='relevanssi_css' size='30' value='<?php echo esc_attr($css); ?>' /></label>
|
1168 |
<small><?php _e("You can use any CSS styling here, style will be inserted with a <span>", "relevanssi"); ?></small>
|
1169 |
|
1170 |
<br />
|
1171 |
-
|
1172 |
<label for='relevanssi_class'><?php _e("CSS class for highlights:", "relevanssi"); ?>
|
1173 |
<input type='text' name='relevanssi_class' id='relevanssi_class' size='10' value='<?php echo esc_attr($class); ?>' /></label>
|
1174 |
<small><?php _e("Name a class here, search results will be wrapped in a <span> with the class", "relevanssi"); ?></small>
|
1175 |
|
1176 |
</div>
|
1177 |
-
|
1178 |
<br />
|
1179 |
<br />
|
1180 |
-
|
1181 |
<input type='submit' name='submit' value='<?php esc_attr_e('Save the options', 'relevanssi'); ?>' class='button button-primary' />
|
1182 |
|
1183 |
<h3 id="indexing"><?php _e('Indexing options', 'relevanssi'); ?></h3>
|
1184 |
|
1185 |
<p><?php _e('Choose post types to index:', 'relevanssi'); ?></p>
|
1186 |
-
|
1187 |
<table class="widefat" id="index_post_types_table">
|
1188 |
<thead>
|
1189 |
<tr>
|
@@ -1196,7 +1200,7 @@ function relevanssi_options_form() {
|
|
1196 |
$pt_1 = get_post_types(array('exclude_from_search' => '0'));
|
1197 |
$pt_2 = get_post_types(array('exclude_from_search' => false));
|
1198 |
$public_types = array_merge($pt_1, $pt_2);
|
1199 |
-
$post_types = get_post_types();
|
1200 |
foreach ($post_types as $type) {
|
1201 |
if ('nav_menu_item' == $type) continue;
|
1202 |
if ('revision' == $type) continue;
|
@@ -1208,11 +1212,11 @@ function relevanssi_options_form() {
|
|
1208 |
}
|
1209 |
$label = sprintf(__("%s", 'relevanssi'), $type);
|
1210 |
in_array($type, $public_types) ? $public = __('yes', 'relevanssi') : $public = __('no', 'relevanssi');
|
1211 |
-
|
1212 |
echo <<<EOH
|
1213 |
<tr>
|
1214 |
<td>
|
1215 |
-
$label
|
1216 |
</td>
|
1217 |
<td>
|
1218 |
<input type='checkbox' name='relevanssi_index_type_$type' id='relevanssi_index_type_$type' $checked />
|
@@ -1236,11 +1240,11 @@ EOH;
|
|
1236 |
</td>
|
1237 |
</tr>
|
1238 |
</table>
|
1239 |
-
|
1240 |
<br /><br />
|
1241 |
|
1242 |
<p><?php _e('Choose taxonomies to index:', 'relevanssi'); ?></p>
|
1243 |
-
|
1244 |
<table class="widefat" id="custom_taxonomies_table">
|
1245 |
<thead>
|
1246 |
<tr>
|
@@ -1263,11 +1267,11 @@ EOH;
|
|
1263 |
$label = sprintf(__("%s", 'relevanssi'), $taxonomy->name);
|
1264 |
$taxonomy->public ? $public = __('yes', 'relevanssi') : $public = __('no', 'relevanssi');
|
1265 |
$type = $taxonomy->name;
|
1266 |
-
|
1267 |
echo <<<EOH
|
1268 |
<tr>
|
1269 |
<td>
|
1270 |
-
$label
|
1271 |
</td>
|
1272 |
<td>
|
1273 |
<input type='checkbox' name='relevanssi_index_taxonomy_$type' id='relevanssi_index_taxonomy_$type' $checked />
|
@@ -1280,11 +1284,11 @@ EOH;
|
|
1280 |
}
|
1281 |
?>
|
1282 |
</table>
|
1283 |
-
|
1284 |
<p><?php _e('If you check a taxonomy here, the terms for that taxonomy are indexed with the posts. If you for example choose "post_tag", searching for tags will find all posts that have the tag.', 'relevanssi'); ?>
|
1285 |
-
|
1286 |
<br /><br />
|
1287 |
-
|
1288 |
<label for='relevanssi_min_word_length'><?php _e("Minimum word length to index", "relevanssi"); ?>:
|
1289 |
<input type='text' name='relevanssi_min_word_length' id='relevanssi_min_word_length' size='30' value='<?php echo esc_attr($min_word_length); ?>' /></label><br />
|
1290 |
<small><?php _e("Words shorter than this number will not be indexed.", "relevanssi"); ?></small>
|
@@ -1312,7 +1316,7 @@ EOH;
|
|
1312 |
<small><?php _e("If checked, Relevanssi will also index and search the excerpts of your posts.Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>
|
1313 |
|
1314 |
<br /><br />
|
1315 |
-
|
1316 |
<label for='relevanssi_index_comments'><?php _e("Index and search these comments:", "relevanssi"); ?>
|
1317 |
<select name='relevanssi_index_comments' id='relevanssi_index_comments'>
|
1318 |
<option value='none' <?php echo $incom_type_none ?>><?php _e("none", "relevanssi"); ?></option>
|
@@ -1340,21 +1344,21 @@ EOH;
|
|
1340 |
<input type='submit' name='index_extend' value='<?php esc_attr_e("Continue indexing", 'relevanssi'); ?>' class='button' />
|
1341 |
|
1342 |
<h3 id="synonyms"><?php _e("Synonyms", "relevanssi"); ?></h3>
|
1343 |
-
|
1344 |
<p><textarea name='relevanssi_synonyms' id='relevanssi_synonyms' rows='9' cols='60'><?php echo htmlspecialchars($synonyms); ?></textarea></p>
|
1345 |
|
1346 |
<p><small><?php _e("Add synonyms here in 'key = value' format. When searching with the OR operator, any search of 'key' will be expanded to include 'value' as well. Using phrases is possible. The key-value pairs work in one direction only, but you can of course repeat the same pair reversed.", "relevanssi"); ?></small></p>
|
1347 |
|
1348 |
-
<?php if (function_exists('relevanssi_form_index_synonyms')) relevanssi_form_index_synonyms($index_synonyms); ?>
|
1349 |
|
1350 |
<input type='submit' name='submit' value='<?php esc_attr_e('Save the options', 'relevanssi'); ?>' class='button' />
|
1351 |
|
1352 |
<h3 id="stopwords"><?php _e("Stopwords", "relevanssi"); ?></h3>
|
1353 |
-
|
1354 |
<?php relevanssi_show_stopwords(); ?>
|
1355 |
|
1356 |
-
<?php if (function_exists('relevanssi_form_importexport')) relevanssi_form_importexport($serialized_options); ?>
|
1357 |
-
|
1358 |
</form>
|
1359 |
</div>
|
1360 |
|
@@ -1388,23 +1392,23 @@ function relevanssi_show_stopwords() {
|
|
1388 |
// We can't check, so let's assume something sensible
|
1389 |
$src = '/wp-content/plugins/' . $plugin . '/delete.png';
|
1390 |
}
|
1391 |
-
|
1392 |
echo "<ul>";
|
1393 |
$results = $wpdb->get_results("SELECT * FROM " . $relevanssi_variables['stopword_table']);
|
1394 |
$exportlist = array();
|
1395 |
foreach ($results as $stopword) {
|
1396 |
-
$sw = $stopword->stopword;
|
1397 |
printf('<li style="display: inline;"><input type="submit" name="removestopword" value="%s"/></li>', esc_attr($sw));
|
1398 |
array_push($exportlist, $sw);
|
1399 |
}
|
1400 |
echo "</ul>";
|
1401 |
-
|
1402 |
?>
|
1403 |
<p><input type="submit" name="removeallstopwords" value="<?php esc_attr_e('Remove all stopwords', 'relevanssi'); ?>" class='button' /></p>
|
1404 |
<?php
|
1405 |
|
1406 |
$exportlist = htmlspecialchars(implode(", ", $exportlist));
|
1407 |
-
|
1408 |
?>
|
1409 |
<p><?php _e("Here's a list of stopwords you can use to export the stopwords to another blog.", "relevanssi"); ?></p>
|
1410 |
|
@@ -1412,4 +1416,4 @@ function relevanssi_show_stopwords() {
|
|
1412 |
<?php
|
1413 |
|
1414 |
}
|
1415 |
-
?>
|
15 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
16 |
update_relevanssi_options();
|
17 |
}
|
18 |
+
|
19 |
if (isset($_REQUEST['index'])) {
|
20 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
21 |
update_relevanssi_options();
|
22 |
relevanssi_build_index();
|
23 |
}
|
24 |
+
|
25 |
if (isset($_REQUEST['index_extend'])) {
|
26 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
27 |
update_relevanssi_options();
|
35 |
relevanssi_import_options($options);
|
36 |
}
|
37 |
}
|
38 |
+
|
39 |
if (isset($_REQUEST['search'])) {
|
40 |
relevanssi_search($_REQUEST['q']);
|
41 |
}
|
42 |
+
|
43 |
if (isset($_REQUEST['dowhat'])) {
|
44 |
if ("add_stopword" == $_REQUEST['dowhat']) {
|
45 |
if (isset($_REQUEST['term'])) {
|
48 |
}
|
49 |
}
|
50 |
}
|
51 |
+
|
52 |
if (isset($_REQUEST['addstopword'])) {
|
53 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
54 |
relevanssi_add_stopword($_REQUEST['addstopword']);
|
55 |
}
|
56 |
+
|
57 |
if (isset($_REQUEST['removestopword'])) {
|
58 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
59 |
relevanssi_remove_stopword($_REQUEST['removestopword']);
|
60 |
}
|
61 |
+
|
62 |
if (isset($_REQUEST['removeallstopwords'])) {
|
63 |
check_admin_referer(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
|
64 |
relevanssi_remove_all_stopwords();
|
65 |
}
|
66 |
}
|
67 |
relevanssi_options_form();
|
68 |
+
|
69 |
+
if (apply_filters('relevanssi_display_common_words', true))
|
70 |
relevanssi_common_words();
|
71 |
+
|
72 |
echo "<div style='clear:both'></div>";
|
73 |
+
|
74 |
echo "</div>";
|
75 |
}
|
76 |
|
110 |
else {
|
111 |
echo "<p>" . __('Enable query logging to see stats here.', 'relevanssi') . "</p>";
|
112 |
}
|
113 |
+
|
114 |
echo "</div>";
|
115 |
+
|
116 |
if ('on' != $relevanssi_hide_branding )
|
117 |
relevanssi_sidebar();
|
118 |
}
|
119 |
|
120 |
function relevanssi_truncate_logs() {
|
121 |
global $wpdb, $relevanssi_variables;
|
122 |
+
|
123 |
$query = "TRUNCATE " . $relevanssi_variables['log_table'];
|
124 |
$wpdb->query($query);
|
125 |
+
|
126 |
echo "<div id='relevanssi-warning' class='updated fade'>" . __('Logs clear!', 'relevanssi') . "</div>";
|
127 |
}
|
128 |
|
213 |
update_option('relevanssi_excerpt_length', $value);
|
214 |
}
|
215 |
}
|
216 |
+
|
217 |
if (isset($_REQUEST['relevanssi_synonyms'])) {
|
218 |
$linefeeds = array("\r\n", "\n", "\r");
|
219 |
$value = str_replace($linefeeds, ";", $_REQUEST['relevanssi_synonyms']);
|
250 |
if ('on' == $value) $index_terms_list[$type] = true;
|
251 |
}
|
252 |
}
|
253 |
+
|
254 |
if (count($post_type_weights) > 0) {
|
255 |
update_option('relevanssi_post_type_weights', $post_type_weights);
|
256 |
}
|
263 |
if (RELEVANSSI_PREMIUM) update_option('relevanssi_index_terms', array_keys($index_terms_list));
|
264 |
|
265 |
if (isset($_REQUEST['relevanssi_admin_search'])) update_option('relevanssi_admin_search', $_REQUEST['relevanssi_admin_search']);
|
266 |
+
if (isset($_REQUEST['relevanssi_excerpts'])) update_option('relevanssi_excerpts', $_REQUEST['relevanssi_excerpts']);
|
267 |
+
if (isset($_REQUEST['relevanssi_excerpt_type'])) update_option('relevanssi_excerpt_type', $_REQUEST['relevanssi_excerpt_type']);
|
268 |
if (isset($_REQUEST['relevanssi_excerpt_allowable_tags'])) update_option('relevanssi_excerpt_allowable_tags', $_REQUEST['relevanssi_excerpt_allowable_tags']);
|
269 |
+
if (isset($_REQUEST['relevanssi_log_queries'])) update_option('relevanssi_log_queries', $_REQUEST['relevanssi_log_queries']);
|
270 |
+
if (isset($_REQUEST['relevanssi_log_queries_with_ip'])) update_option('relevanssi_log_queries_with_ip', $_REQUEST['relevanssi_log_queries_with_ip']);
|
271 |
if (isset($_REQUEST['relevanssi_highlight'])) update_option('relevanssi_highlight', $_REQUEST['relevanssi_highlight']);
|
272 |
if (isset($_REQUEST['relevanssi_highlight_docs'])) update_option('relevanssi_highlight_docs', $_REQUEST['relevanssi_highlight_docs']);
|
273 |
if (isset($_REQUEST['relevanssi_highlight_comments'])) update_option('relevanssi_highlight_comments', $_REQUEST['relevanssi_highlight_comments']);
|
280 |
if (isset($_REQUEST['relevanssi_extag'])) update_option('relevanssi_extag', $_REQUEST['relevanssi_extag']);
|
281 |
if (isset($_REQUEST['relevanssi_index_fields'])) update_option('relevanssi_index_fields', $_REQUEST['relevanssi_index_fields']);
|
282 |
if (isset($_REQUEST['relevanssi_expst'])) update_option('relevanssi_exclude_posts', $_REQUEST['relevanssi_expst']); //added by OdditY
|
283 |
+
if (isset($_REQUEST['relevanssi_hilite_title'])) update_option('relevanssi_hilite_title', $_REQUEST['relevanssi_hilite_title']); //added by OdditY
|
284 |
+
if (isset($_REQUEST['relevanssi_index_comments'])) update_option('relevanssi_index_comments', $_REQUEST['relevanssi_index_comments']); //added by OdditY
|
285 |
if (isset($_REQUEST['relevanssi_index_author'])) update_option('relevanssi_index_author', $_REQUEST['relevanssi_index_author']);
|
286 |
if (isset($_REQUEST['relevanssi_index_excerpt'])) update_option('relevanssi_index_excerpt', $_REQUEST['relevanssi_index_excerpt']);
|
287 |
if (isset($_REQUEST['relevanssi_fuzzy'])) update_option('relevanssi_fuzzy', $_REQUEST['relevanssi_fuzzy']);
|
305 |
function relevanssi_add_stopword($term) {
|
306 |
global $wpdb;
|
307 |
if ('' == $term) return; // do not add empty $term to stopwords - added by renaissancehack
|
308 |
+
|
309 |
$n = 0;
|
310 |
$s = 0;
|
311 |
+
|
312 |
$terms = explode(',', $term);
|
313 |
if (count($terms) > 1) {
|
314 |
foreach($terms as $term) {
|
322 |
else {
|
323 |
// add to stopwords
|
324 |
$success = relevanssi_add_single_stopword($term);
|
325 |
+
|
326 |
if ($success) {
|
327 |
+
printf(__("<div id='message' class='updated fade'><p>Term '%s' added to stopwords!</p></div>", "relevanssi"), stripslashes($term));
|
328 |
}
|
329 |
else {
|
330 |
+
printf(__("<div id='message' class='updated fade'><p>Couldn't add term '%s' to stopwords!</p></div>", "relevanssi"), stripslashes($term));
|
331 |
}
|
332 |
}
|
333 |
}
|
336 |
global $wpdb, $relevanssi_variables;
|
337 |
if ('' == $term) return;
|
338 |
|
339 |
+
$term = stripslashes($term);
|
340 |
+
|
341 |
if (method_exists($wpdb, 'esc_like')) {
|
342 |
+
$term = esc_sql($wpdb->esc_like($term));
|
343 |
}
|
344 |
else {
|
345 |
// Compatibility for pre-4.0 WordPress
|
346 |
+
$term = esc_sql(like_escape($term));
|
347 |
}
|
348 |
|
349 |
$q = $wpdb->prepare("INSERT INTO " . $relevanssi_variables['stopword_table'] . " (stopword) VALUES (%s)", $term);
|
350 |
// Clean: escaped.
|
351 |
$success = $wpdb->query($q);
|
352 |
+
|
353 |
if ($success) {
|
354 |
// remove from index
|
355 |
$q = $wpdb->prepare("DELETE FROM " . $relevanssi_variables['relevanssi_table'] . " WHERE term=%s", $term);
|
363 |
|
364 |
function relevanssi_remove_all_stopwords() {
|
365 |
global $wpdb, $relevanssi_variables;
|
366 |
+
|
367 |
$success = $wpdb->query("TRUNCATE " . $relevanssi_variables['stopword_table']);
|
368 |
+
|
369 |
printf(__("<div id='message' class='updated fade'><p>Stopwords removed! Remember to re-index.</p></div>", "relevanssi"), $term);
|
370 |
}
|
371 |
|
372 |
function relevanssi_remove_stopword($term) {
|
373 |
global $wpdb, $relevanssi_variables;
|
374 |
+
|
375 |
$q = $wpdb->prepare("DELETE FROM " . $relevanssi_variables['stopword_table'] . " WHERE stopword=%s", $term);
|
376 |
$success = $wpdb->query($q);
|
377 |
+
|
378 |
if ($success) {
|
379 |
+
printf(__("<div id='message' class='updated fade'><p>Term '%s' removed from stopwords! Re-index to get it back to index.</p></div>", "relevanssi"), stripslashes($term));
|
380 |
}
|
381 |
else {
|
382 |
+
printf(__("<div id='message' class='updated fade'><p>Couldn't remove term '%s' from stopwords!</p></div>", "relevanssi"), stripslashes($term));
|
383 |
}
|
384 |
}
|
385 |
|
386 |
function relevanssi_common_words() {
|
387 |
global $wpdb, $relevanssi_variables, $wp_version;
|
388 |
+
|
389 |
RELEVANSSI_PREMIUM ? $plugin = 'relevanssi-premium' : $plugin = 'relevanssi';
|
390 |
+
|
391 |
echo "<div style='float:left; width: 45%'>";
|
392 |
+
|
393 |
echo "<h3>" . __("25 most common words in the index", 'relevanssi') . "</h3>";
|
394 |
+
|
395 |
echo "<p>" . __("These words are excellent stopword material. A word that appears in most of the posts in the database is quite pointless when searching. This is also an easy way to create a completely new stopword list, if one isn't available in your language. Click the icon after the word to add the word to the stopword list. The word will also be removed from the index, so rebuilding the index is not necessary.", 'relevanssi') . "</p>";
|
396 |
+
|
397 |
$words = $wpdb->get_results("SELECT COUNT(DISTINCT(doc)) as cnt, term
|
398 |
FROM " . $relevanssi_variables['relevanssi_table'] . " GROUP BY term ORDER BY cnt DESC LIMIT 25");
|
399 |
|
416 |
// We can't check, so let's assume something sensible
|
417 |
$src = '/wp-content/plugins/' . $plugin . '/delete.png';
|
418 |
}
|
419 |
+
|
420 |
foreach ($words as $word) {
|
421 |
$stop = __('Add to stopwords', 'relevanssi');
|
422 |
printf('<li>%s (%d) <input style="padding: 0; margin: 0" type="image" src="%s" alt="%s" name="term" value="%s"/></li>', $word->term, $word->cnt, $src, $stop, $word->term);
|
423 |
}
|
424 |
echo "</ul>\n</form>";
|
425 |
+
|
426 |
echo "</div>";
|
427 |
}
|
428 |
|
429 |
function relevanssi_query_log() {
|
430 |
global $wpdb;
|
431 |
|
432 |
+
$days30 = apply_filters('relevanssi_30days', 30);
|
433 |
+
|
434 |
echo '<h3>' . __("Total Searches", 'relevanssi') . '</h3>';
|
435 |
|
436 |
+
echo "<div style='width: 30%; float: left; margin-right: 2%; overflow: scroll'>";
|
437 |
relevanssi_total_queries( __("Totals", 'relevanssi') );
|
438 |
echo '</div>';
|
439 |
|
442 |
echo '<h3>' . __("Common Queries", 'relevanssi') . '</h3>';
|
443 |
|
444 |
$limit = apply_filters('relevanssi_user_searches_limit', 20);
|
445 |
+
$lead = __("Here you can see the $limit most common user search queries, how many times those
|
446 |
queries were made and how many results were found for those queries.", 'relevanssi');
|
447 |
|
448 |
echo "<p>$lead</p>";
|
449 |
+
|
450 |
+
echo "<div style='width: 30%; float: left; margin-right: 2%; overflow: scroll'>";
|
451 |
relevanssi_date_queries(1, __("Today and yesterday", 'relevanssi'));
|
452 |
echo '</div>';
|
453 |
|
454 |
+
echo "<div style='width: 30%; float: left; margin-right: 2%; overflow: scroll'>";
|
455 |
relevanssi_date_queries(7, __("Last 7 days", 'relevanssi'));
|
456 |
echo '</div>';
|
457 |
|
458 |
+
echo "<div style='width: 30%; float: left; margin-right: 2%; overflow: scroll'>";
|
459 |
+
relevanssi_date_queries($days30, sprintf(__("Last %d days", 'relevanssi'), $days30));
|
460 |
echo '</div>';
|
461 |
|
462 |
echo '<div style="clear: both"></div>';
|
463 |
+
|
464 |
echo '<h3>' . __("Unsuccessful Queries", 'relevanssi') . '</h3>';
|
465 |
|
466 |
+
echo "<div style='width: 30%; float: left; margin-right: 2%; overflow: scroll'>";
|
467 |
relevanssi_date_queries(1, __("Today and yesterday", 'relevanssi'), 'bad');
|
468 |
echo '</div>';
|
469 |
|
470 |
+
echo "<div style='width: 30%; float: left; margin-right: 2%; overflow: scroll'>";
|
471 |
relevanssi_date_queries(7, __("Last 7 days", 'relevanssi'), 'bad');
|
472 |
echo '</div>';
|
473 |
|
474 |
+
echo "<div style='width: 30%; float: left; margin-right: 2%; overflow: scroll'>";
|
475 |
+
relevanssi_date_queries($days30, sprintf(__("Last %d days", 'relevanssi'), $days30), 'bad');
|
476 |
echo '</div>';
|
477 |
|
478 |
if ( current_user_can('manage_options') ) {
|
512 |
function relevanssi_date_queries($d, $title, $version = 'good') {
|
513 |
global $wpdb, $relevanssi_variables;
|
514 |
$log_table = $relevanssi_variables['log_table'];
|
515 |
+
|
516 |
$limit = apply_filters('relevanssi_user_searches_limit', 20);
|
517 |
+
|
518 |
if ($version == 'good')
|
519 |
$queries = $wpdb->get_results("SELECT COUNT(DISTINCT(id)) as cnt, query, hits
|
520 |
FROM $log_table
|
522 |
GROUP BY query
|
523 |
ORDER BY cnt DESC
|
524 |
LIMIT $limit");
|
525 |
+
|
526 |
if ($version == 'bad')
|
527 |
$queries = $wpdb->get_results("SELECT COUNT(DISTINCT(id)) as cnt, query, hits
|
528 |
FROM $log_table
|
545 |
|
546 |
function relevanssi_options_form() {
|
547 |
global $relevanssi_variables, $wpdb;
|
548 |
+
|
549 |
wp_enqueue_style('dashboard');
|
550 |
wp_print_styles('dashboard');
|
551 |
wp_enqueue_script('dashboard');
|
554 |
$docs_count = $wpdb->get_var("SELECT COUNT(DISTINCT doc) FROM " . $relevanssi_variables['relevanssi_table']);
|
555 |
$terms_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $relevanssi_variables['relevanssi_table']);
|
556 |
$biggest_doc = $wpdb->get_var("SELECT doc FROM " . $relevanssi_variables['relevanssi_table'] . " ORDER BY doc DESC LIMIT 1");
|
557 |
+
|
558 |
$serialize_options = array();
|
559 |
+
|
560 |
$title_boost = get_option('relevanssi_title_boost');
|
561 |
$serialize_options['relevanssi_title_boost'] = $title_boost;
|
562 |
$comment_boost = get_option('relevanssi_comment_boost');
|
581 |
else {
|
582 |
$excerpts = '';
|
583 |
}
|
584 |
+
|
585 |
$excerpt_length = get_option('relevanssi_excerpt_length');
|
586 |
$serialize_options['relevanssi_excerpt_length'] = $excerpt_length;
|
587 |
$excerpt_type = get_option('relevanssi_excerpt_type');
|
617 |
$log_queries_with_ip = '';
|
618 |
}
|
619 |
|
620 |
+
$hide_branding = get_option('relevanssi_hide_branding');
|
621 |
$serialize_options['relevanssi_hide_branding'] = $hide_branding;
|
622 |
if ('on' == $hide_branding) {
|
623 |
$hide_branding = 'checked="checked"';
|
625 |
else {
|
626 |
$hide_branding = '';
|
627 |
}
|
628 |
+
|
629 |
$highlight = get_option('relevanssi_highlight');
|
630 |
$serialize_options['relevanssi_highlight'] = $highlight;
|
631 |
$highlight_none = "";
|
662 |
$highlight_class = 'selected="selected"';
|
663 |
break;
|
664 |
}
|
665 |
+
|
666 |
$index_fields = get_option('relevanssi_index_fields');
|
667 |
$serialize_options['relevanssi_index_fields'] = $index_fields;
|
668 |
|
674 |
$serialize_options['relevanssi_css'] = $css;
|
675 |
$class = get_option('relevanssi_class');
|
676 |
$serialize_options['relevanssi_class'] = $class;
|
677 |
+
|
678 |
$cat = get_option('relevanssi_cat');
|
679 |
$serialize_options['relevanssi_cat'] = $cat;
|
680 |
$excat = get_option('relevanssi_excat');
|
681 |
$serialize_options['relevanssi_excat'] = $excat;
|
682 |
$extag = get_option('relevanssi_extag');
|
683 |
$serialize_options['relevanssi_extag'] = $extag;
|
684 |
+
|
685 |
$fuzzy = get_option('relevanssi_fuzzy');
|
686 |
$serialize_options['relevanssi_fuzzy'] = $fuzzy;
|
687 |
$fuzzy_sometimes = ('sometimes' == $fuzzy ? 'selected="selected"' : '');
|
706 |
|
707 |
$omit_from_logs = get_option('relevanssi_omit_from_logs');
|
708 |
$serialize_options['relevanssi_omit_from_logs'] = $omit_from_logs;
|
709 |
+
|
710 |
$synonyms = get_option('relevanssi_synonyms');
|
711 |
$serialize_options['relevanssi_synonyms'] = $synonyms;
|
712 |
isset($synonyms) ? $synonyms = str_replace(';', "\n", $synonyms) : $synonyms = "";
|
713 |
+
|
714 |
//Added by OdditY ->
|
715 |
+
$expst = get_option('relevanssi_exclude_posts');
|
716 |
$serialize_options['relevanssi_exclude_posts'] = $expst;
|
717 |
+
$hititle = ('on' == get_option('relevanssi_hilite_title') ? 'checked="checked"' : '');
|
718 |
$serialize_options['relevanssi_hilite_title'] = get_option('relevanssi_hilite_title');
|
719 |
$incom_type = get_option('relevanssi_index_comments');
|
720 |
$serialize_options['relevanssi_index_comments'] = $incom_type;
|
733 |
break;
|
734 |
}//added by OdditY END <-
|
735 |
|
736 |
+
$highlight_docs = ('on' == get_option('relevanssi_highlight_docs') ? 'checked="checked"' : '');
|
737 |
+
$highlight_coms = ('on' == get_option('relevanssi_highlight_comments') ? 'checked="checked"' : '');
|
738 |
$serialize_options['relevanssi_highlight_docs'] = get_option('relevanssi_highlight_docs');
|
739 |
$serialize_options['relevanssi_highlight_comments'] = get_option('relevanssi_highlight_comments');
|
740 |
|
741 |
+
$respect_exclude = ('on' == get_option('relevanssi_respect_exclude') ? 'checked="checked"' : '');
|
742 |
$serialize_options['relevanssi_respect_exclude'] = get_option('relevanssi_respect_exclude');
|
743 |
|
744 |
$min_word_length = get_option('relevanssi_min_word_length');
|
745 |
$serialize_options['relevanssi_min_word_length'] = $min_word_length;
|
746 |
|
747 |
+
$index_author = ('on' == get_option('relevanssi_index_author') ? 'checked="checked"' : '');
|
748 |
$serialize_options['relevanssi_index_author'] = get_option('relevanssi_index_author');
|
749 |
+
$index_excerpt = ('on' == get_option('relevanssi_index_excerpt') ? 'checked="checked"' : '');
|
750 |
$serialize_options['relevanssi_index_excerpt'] = get_option('relevanssi_index_excerpt');
|
751 |
+
|
752 |
$show_matches = ('on' == get_option('relevanssi_show_matches') ? 'checked="checked"' : '');
|
753 |
$serialize_options['relevanssi_show_matches'] = get_option('relevanssi_show_matches');
|
754 |
$show_matches_text = stripslashes(get_option('relevanssi_show_matches_text'));
|
755 |
$serialize_options['relevanssi_show_matches_text'] = get_option('relevanssi_show_matches_text');
|
756 |
+
|
757 |
+
$wpml_only_current = ('on' == get_option('relevanssi_wpml_only_current') ? 'checked="checked"' : '');
|
758 |
$serialize_options['relevanssi_wpml_only_current'] = get_option('relevanssi_wpml_only_current');
|
759 |
|
760 |
+
$word_boundaries = ('on' == get_option('relevanssi_word_boundaries') ? 'checked="checked"' : '');
|
761 |
$serialize_options['relevanssi_word_boundaries'] = get_option('relevanssi_word_boundaries');
|
762 |
|
763 |
$post_type_weights = get_option('relevanssi_post_type_weights');
|
775 |
$serialize_options['relevanssi_default_orderby'] = $orderby;
|
776 |
$orderby_relevance = ('relevance' == $orderby ? 'selected="selected"' : '');
|
777 |
$orderby_date = ('post_date' == $orderby ? 'selected="selected"' : '');
|
778 |
+
|
779 |
+
if (RELEVANSSI_PREMIUM) {
|
780 |
$api_key = get_option('relevanssi_api_key');
|
781 |
$serialize_options['relevanssi_api_key'] = $api_key;
|
782 |
|
789 |
$intlinks_nostrip = ('nostrip' == $intlinks ? 'selected="selected"' : '');
|
790 |
$intlinks_noindex = ('noindex' == $intlinks ? 'selected="selected"' : '');
|
791 |
|
792 |
+
$highlight_docs_ext = ('on' == get_option('relevanssi_highlight_docs_external') ? 'checked="checked"' : '');
|
793 |
$serialize_options['relevanssi_highlight_docs_external'] = get_option('relevanssi_highlight_docs_external');
|
794 |
+
|
795 |
$thousand_separator = get_option('relevanssi_thousand_separator');
|
796 |
$serialize_options['relevanssi_thousand_separator'] = $thousand_separator;
|
797 |
|
798 |
$disable_shortcodes = get_option('relevanssi_disable_shortcodes');
|
799 |
$serialize_options['relevanssi_disable_shortcodes'] = $disable_shortcodes;
|
800 |
+
|
801 |
+
$index_users = ('on' == get_option('relevanssi_index_users') ? 'checked="checked"' : '');
|
802 |
$serialize_options['relevanssi_index_users'] = get_option('relevanssi_index_users');
|
803 |
+
|
804 |
$index_user_fields = get_option('relevanssi_index_user_fields');
|
805 |
$serialize_options['relevanssi_index_user_fields'] = $index_user_fields;
|
806 |
+
|
807 |
+
$index_subscribers = ('on' == get_option('relevanssi_index_subscribers') ? 'checked="checked"' : '');
|
808 |
$serialize_options['relevanssi_index_subscribers'] = get_option('relevanssi_index_subscribers');
|
809 |
|
810 |
+
$index_synonyms = ('on' == get_option('relevanssi_index_synonyms') ? 'checked="checked"' : '');
|
811 |
$serialize_options['relevanssi_index_synonyms'] = get_option('relevanssi_index_synonyms');
|
812 |
+
|
813 |
+
$index_taxonomies = ('on' == get_option('relevanssi_index_taxonomies') ? 'checked="checked"' : '');
|
814 |
$serialize_options['relevanssi_index_taxonomies'] = get_option('relevanssi_index_taxonomies');
|
815 |
|
816 |
$index_terms = get_option('relevanssi_index_terms');
|
817 |
if (empty($index_terms)) $index_terms = array();
|
818 |
$serialize_options['relevanssi_index_terms'] = $index_terms;
|
819 |
+
|
820 |
+
$hide_post_controls = ('on' == get_option('relevanssi_hide_post_controls') ? 'checked="checked"' : '');
|
821 |
$serialize_options['relevanssi_hide_post_controls'] = get_option('relevanssi_hide_post_controls');
|
822 |
|
823 |
$recency_bonus_array = get_option('relevanssi_recency_bonus');
|
824 |
$serialize_options['recency_bonus'] = $recency_bonus_array;
|
825 |
$recency_bonus = $recency_bonus_array['bonus'];
|
826 |
$recency_bonus_days = $recency_bonus_array['days'];
|
827 |
+
|
828 |
$mysql_columns = get_option('relevanssi_mysql_columns');
|
829 |
$serialize_options['relevanssi_mysql_columns'] = $mysql_columns;
|
830 |
|
833 |
|
834 |
echo "<div class='postbox-container' style='width:70%;'>";
|
835 |
|
836 |
+
if (RELEVANSSI_PREMIUM) {
|
837 |
echo "<form method='post' action='options-general.php?page=relevanssi-premium/relevanssi.php'>";
|
838 |
}
|
839 |
else {
|
840 |
echo "<form method='post'>";
|
841 |
}
|
842 |
+
|
843 |
wp_nonce_field(plugin_basename($relevanssi_variables['file']), 'relevanssi_options'); ?>
|
844 |
+
|
845 |
<p><a href="#basic"><?php _e("Basic options", "relevanssi"); ?></a> |
|
846 |
<a href="#weights"><?php _e("Weights", "relevanssi"); ?></a> |
|
847 |
<a href="#logs"><?php _e("Logs", "relevanssi"); ?></a> |
|
881 |
<?php _e("Terms in the index", "relevanssi"); ?>: <strong><?php echo $terms_count ?></strong><br />
|
882 |
<?php _e("Highest post ID indexed", "relevanssi"); ?>: <strong><?php echo $biggest_doc ?></strong>
|
883 |
</p>
|
884 |
+
|
885 |
<h3 id="basic"><?php _e("Basic options", "relevanssi"); ?></h3>
|
886 |
|
887 |
<?php
|
900 |
<option value='OR' <?php echo $implicit_or ?>><?php _e("OR - any term present is enough", "relevanssi"); ?></option>
|
901 |
</select></label><br />
|
902 |
<small><?php _e("If you choose AND and the search finds no matches, it will automatically do an OR search.", "relevanssi"); ?></small>
|
903 |
+
|
904 |
<br /><br />
|
905 |
|
906 |
<label for='relevanssi_disable_or_fallback'><?php _e("Disable OR fallback:", "relevanssi"); ?>
|
915 |
<option value='post_date' <?php echo $orderby_date ?>><?php _e("Post date", "relevanssi"); ?></option>
|
916 |
</select></label><br />
|
917 |
<small><?php _e("If you want date-based results, see the recent post bonus in the Weights section.", "relevanssi"); ?></small>
|
918 |
+
|
919 |
<br /><br />
|
920 |
|
921 |
<label for='relevanssi_fuzzy'><?php _e('When to use fuzzy matching?', 'relevanssi'); ?>
|
931 |
<?php
|
932 |
if (function_exists('relevanssi_form_internal_links')) relevanssi_form_internal_links($intlinks_noindex, $intlinks_strip, $intlinks_nostrip);
|
933 |
?>
|
934 |
+
|
935 |
<label for='relevanssi_throttle'><?php _e("Limit searches:", "relevanssi"); ?>
|
936 |
<input type='checkbox' name='relevanssi_throttle' id='relevanssi_throttle' <?php echo $throttle ?> /></label><br />
|
937 |
<small><?php _e("If this option is checked, Relevanssi will limit search results to at most 500 results per term. This will improve performance, but may cause some relevant documents to go unfound. However, Relevanssi tries to prioritize the most relevant documents. <strong>This does not work well when sorting results by date.</strong> The throttle can end up cutting off recent posts to favour more relevant posts.", 'relevanssi'); ?></small>
|
943 |
<small><?php printf(__("For better performance, adjust the limit to a smaller number. Adjusting the limit to 100 or 200 should be safe for good results, and might bring a boost in search speed. DO NOT use this feature to limit the number of search results on search results pages, as that will lead to problems. For adjusting the number of search results displayed, see <a href='%s'>this knowledge base entry</a>.", 'relevanssi'), 'http://www.relevanssi.com/knowledge-base/posts-per-page/'); ?></small>
|
944 |
|
945 |
<br /><br />
|
946 |
+
|
947 |
<?php
|
948 |
if (function_exists('relevanssi_form_hide_post_controls')) relevanssi_form_hide_post_controls($hide_post_controls);
|
949 |
?>
|
950 |
+
|
951 |
<h3 id="weights"><?php _e('Weights', 'relevanssi'); ?></h3>
|
952 |
|
953 |
<p><?php _e('These values affect the weights of the documents. These are all multipliers, so 1 means no change in weight, less than 1 means less weight, and more than 1 means more weight. Setting something to zero makes that worthless. For example, if title weight is more than 1, words in titles are more significant than words elsewhere. If title weight is 0, words in titles won\'t make any difference to the search results.', 'relevanssi'); ?></p>
|
954 |
+
|
955 |
<table class="widefat">
|
956 |
<thead>
|
957 |
<tr>
|
974 |
<?php if (function_exists('relevanssi_form_link_weight')) relevanssi_form_link_weight($link_boost); ?>
|
975 |
<tr>
|
976 |
<td>
|
977 |
+
<?php _e('Comment text', 'relevanssi'); ?>
|
978 |
</td>
|
979 |
<td>
|
980 |
<input type='text' name='relevanssi_comment_boost' id='relevanssi_comment_boost' size='4' value='<?php echo $comment_boost ?>' />
|
993 |
<br /><br />
|
994 |
|
995 |
<?php if (function_exists('relevanssi_form_recency')) relevanssi_form_recency($recency_bonus, $recency_bonus_days); ?>
|
996 |
+
|
997 |
<?php if (function_exists('icl_object_id')) : ?>
|
998 |
<h3 id="wpml"><?php _e('WPML/Polylang compatibility', 'relevanssi'); ?></h3>
|
999 |
+
|
1000 |
<label for='relevanssi_wpml_only_current'><?php _e("Limit results to current language:", "relevanssi"); ?>
|
1001 |
<input type='checkbox' name='relevanssi_wpml_only_current' id='relevanssi_wpml_only_current' <?php echo $wpml_only_current ?> /></label>
|
1002 |
<small><?php _e("If this option is checked, Relevanssi will only return results in the current active language. Otherwise results will include posts in every language.", "relevanssi");?></small>
|
1003 |
+
|
1004 |
<?php endif; ?>
|
1005 |
+
|
1006 |
<h3 id="logs"><?php _e('Logs', 'relevanssi'); ?></h3>
|
1007 |
+
|
1008 |
<label for='relevanssi_log_queries'><?php _e("Keep a log of user queries:", "relevanssi"); ?>
|
1009 |
<input type='checkbox' name='relevanssi_log_queries' id='relevanssi_log_queries' <?php echo $log_queries ?> /></label>
|
1010 |
<small><?php _e("If checked, Relevanssi will log user queries. The log appears in 'User searches' on the Dashboard admin menu.", 'relevanssi'); ?></small>
|
1033 |
<?php if (function_exists('relevanssi_form_hide_branding')) relevanssi_form_hide_branding($hide_branding); ?>
|
1034 |
|
1035 |
<h3 id="exclusions"><?php _e("Exclusions and restrictions", "relevanssi"); ?></h3>
|
1036 |
+
|
1037 |
<label for='relevanssi_cat'><?php _e('Restrict search to these categories and tags:', 'relevanssi'); ?>
|
1038 |
<input type='text' name='relevanssi_cat' id='relevanssi_cat' size='20' value='<?php echo esc_attr($cat); ?>' /></label><br />
|
1039 |
<small><?php _e("Enter a comma-separated list of category and tag IDs to restrict search to those categories or tags. You can also use <code><input type='hidden' name='cats' value='list of cats and tags' /></code> in your search form. The input field will overrun this setting.", 'relevanssi'); ?></small>
|
1070 |
<small><?php _e("If checked, Relevanssi won't display posts of custom post types that have 'exclude_from_search' set to true. If not checked, Relevanssi will display anything that is indexed.", 'relevanssi'); ?></small>
|
1071 |
|
1072 |
<h3 id="excerpts"><?php _e("Custom excerpts/snippets", "relevanssi"); ?></h3>
|
1073 |
+
|
1074 |
<label for='relevanssi_excerpts'><?php _e("Create custom search result snippets:", "relevanssi"); ?>
|
1075 |
<input type='checkbox' name='relevanssi_excerpts' id='relevanssi_excerpts' <?php echo $excerpts ?> /></label><br />
|
1076 |
<small><?php _e("If checked, Relevanssi will create excerpts that contain the search term hits. To make them work, make sure your search result template uses the_excerpt() to display post excerpts.", 'relevanssi'); ?></small>
|
1077 |
+
|
1078 |
<p><?php _e('Note: Building custom excerpts can be slow. If you are not actually using the excerpts, make sure you disable the option.', 'relevanssi'); ?></p>
|
1079 |
+
|
1080 |
<label for='relevanssi_excerpt_length'><?php _e("Length of the snippet:", "relevanssi"); ?>
|
1081 |
<input type='text' name='relevanssi_excerpt_length' id='relevanssi_excerpt_length' size='4' value='<?php echo esc_attr($excerpt_length); ?>' /></label>
|
1082 |
<select name='relevanssi_excerpt_type' id='relevanssi_excerpt_type'>
|
1121 |
<option value='class' <?php echo $highlight_class ?>><?php _e("CSS Class", 'relevanssi'); ?></option>
|
1122 |
</select></label>
|
1123 |
<small><?php _e("Highlighting isn't available unless you use custom snippets", 'relevanssi'); ?></small>
|
1124 |
+
|
1125 |
<br />
|
1126 |
|
1127 |
<label for='relevanssi_hilite_title'><?php _e("Highlight query terms in result titles too:", 'relevanssi'); ?>
|
1137 |
<br />
|
1138 |
|
1139 |
<?php if (function_exists('relevanssi_form_highlight_external')) relevanssi_form_highlight_external($highlight_docs_ext); ?>
|
1140 |
+
|
1141 |
<label for='relevanssi_highlight_comments'><?php _e("Highlight query terms in comments:", 'relevanssi'); ?>
|
1142 |
<input type='checkbox' name='relevanssi_highlight_comments' id='relevanssi_highlight_comments' <?php echo $highlight_coms ?> /></label>
|
1143 |
<small><?php _e("Highlights hits in comments when user opens the post from search results.", "relevanssi"); ?></small>
|
1144 |
|
1145 |
<br />
|
1146 |
+
|
1147 |
<label for='relevanssi_word_boundaries'><?php _e("Uncheck this if you use non-ASCII characters:", 'relevanssi'); ?>
|
1148 |
<input type='checkbox' name='relevanssi_word_boundaries' id='relevanssi_word_boundaries' <?php echo $word_boundaries ?> /></label>
|
1149 |
<small><?php _e("If you use non-ASCII characters (like Cyrillic alphabet) and the highlights don't work, uncheck this option to make highlights work.", "relevanssi"); ?></small>
|
1150 |
|
1151 |
<br /><br />
|
1152 |
</div>
|
1153 |
+
|
1154 |
<?php _e("Then adjust the settings for your chosen type:", "relevanssi"); ?><br />
|
1155 |
|
1156 |
<div style='margin-left: 2em'>
|
1157 |
+
|
1158 |
<label for='relevanssi_txt_col'><?php _e("Text color for highlights:", "relevanssi"); ?>
|
1159 |
<input type='text' name='relevanssi_txt_col' id='relevanssi_txt_col' size='7' value='<?php echo esc_attr($txt_col); ?>' /></label>
|
1160 |
<small><?php _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi"); ?></small>
|
1161 |
|
1162 |
<br />
|
1163 |
+
|
1164 |
<label for='relevanssi_bg_col'><?php _e("Background color for highlights:", "relevanssi"); ?>
|
1165 |
<input type='text' name='relevanssi_bg_col' id='relevanssi_bg_col' size='7' value='<?php echo esc_attr($bg_col); ?>' /></label>
|
1166 |
<small><?php _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi"); ?></small>
|
1167 |
|
1168 |
<br />
|
1169 |
+
|
1170 |
<label for='relevanssi_css'><?php _e("CSS style for highlights:", "relevanssi"); ?>
|
1171 |
<input type='text' name='relevanssi_css' id='relevanssi_css' size='30' value='<?php echo esc_attr($css); ?>' /></label>
|
1172 |
<small><?php _e("You can use any CSS styling here, style will be inserted with a <span>", "relevanssi"); ?></small>
|
1173 |
|
1174 |
<br />
|
1175 |
+
|
1176 |
<label for='relevanssi_class'><?php _e("CSS class for highlights:", "relevanssi"); ?>
|
1177 |
<input type='text' name='relevanssi_class' id='relevanssi_class' size='10' value='<?php echo esc_attr($class); ?>' /></label>
|
1178 |
<small><?php _e("Name a class here, search results will be wrapped in a <span> with the class", "relevanssi"); ?></small>
|
1179 |
|
1180 |
</div>
|
1181 |
+
|
1182 |
<br />
|
1183 |
<br />
|
1184 |
+
|
1185 |
<input type='submit' name='submit' value='<?php esc_attr_e('Save the options', 'relevanssi'); ?>' class='button button-primary' />
|
1186 |
|
1187 |
<h3 id="indexing"><?php _e('Indexing options', 'relevanssi'); ?></h3>
|
1188 |
|
1189 |
<p><?php _e('Choose post types to index:', 'relevanssi'); ?></p>
|
1190 |
+
|
1191 |
<table class="widefat" id="index_post_types_table">
|
1192 |
<thead>
|
1193 |
<tr>
|
1200 |
$pt_1 = get_post_types(array('exclude_from_search' => '0'));
|
1201 |
$pt_2 = get_post_types(array('exclude_from_search' => false));
|
1202 |
$public_types = array_merge($pt_1, $pt_2);
|
1203 |
+
$post_types = get_post_types();
|
1204 |
foreach ($post_types as $type) {
|
1205 |
if ('nav_menu_item' == $type) continue;
|
1206 |
if ('revision' == $type) continue;
|
1212 |
}
|
1213 |
$label = sprintf(__("%s", 'relevanssi'), $type);
|
1214 |
in_array($type, $public_types) ? $public = __('yes', 'relevanssi') : $public = __('no', 'relevanssi');
|
1215 |
+
|
1216 |
echo <<<EOH
|
1217 |
<tr>
|
1218 |
<td>
|
1219 |
+
$label
|
1220 |
</td>
|
1221 |
<td>
|
1222 |
<input type='checkbox' name='relevanssi_index_type_$type' id='relevanssi_index_type_$type' $checked />
|
1240 |
</td>
|
1241 |
</tr>
|
1242 |
</table>
|
1243 |
+
|
1244 |
<br /><br />
|
1245 |
|
1246 |
<p><?php _e('Choose taxonomies to index:', 'relevanssi'); ?></p>
|
1247 |
+
|
1248 |
<table class="widefat" id="custom_taxonomies_table">
|
1249 |
<thead>
|
1250 |
<tr>
|
1267 |
$label = sprintf(__("%s", 'relevanssi'), $taxonomy->name);
|
1268 |
$taxonomy->public ? $public = __('yes', 'relevanssi') : $public = __('no', 'relevanssi');
|
1269 |
$type = $taxonomy->name;
|
1270 |
+
|
1271 |
echo <<<EOH
|
1272 |
<tr>
|
1273 |
<td>
|
1274 |
+
$label
|
1275 |
</td>
|
1276 |
<td>
|
1277 |
<input type='checkbox' name='relevanssi_index_taxonomy_$type' id='relevanssi_index_taxonomy_$type' $checked />
|
1284 |
}
|
1285 |
?>
|
1286 |
</table>
|
1287 |
+
|
1288 |
<p><?php _e('If you check a taxonomy here, the terms for that taxonomy are indexed with the posts. If you for example choose "post_tag", searching for tags will find all posts that have the tag.', 'relevanssi'); ?>
|
1289 |
+
|
1290 |
<br /><br />
|
1291 |
+
|
1292 |
<label for='relevanssi_min_word_length'><?php _e("Minimum word length to index", "relevanssi"); ?>:
|
1293 |
<input type='text' name='relevanssi_min_word_length' id='relevanssi_min_word_length' size='30' value='<?php echo esc_attr($min_word_length); ?>' /></label><br />
|
1294 |
<small><?php _e("Words shorter than this number will not be indexed.", "relevanssi"); ?></small>
|
1316 |
<small><?php _e("If checked, Relevanssi will also index and search the excerpts of your posts.Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>
|
1317 |
|
1318 |
<br /><br />
|
1319 |
+
|
1320 |
<label for='relevanssi_index_comments'><?php _e("Index and search these comments:", "relevanssi"); ?>
|
1321 |
<select name='relevanssi_index_comments' id='relevanssi_index_comments'>
|
1322 |
<option value='none' <?php echo $incom_type_none ?>><?php _e("none", "relevanssi"); ?></option>
|
1344 |
<input type='submit' name='index_extend' value='<?php esc_attr_e("Continue indexing", 'relevanssi'); ?>' class='button' />
|
1345 |
|
1346 |
<h3 id="synonyms"><?php _e("Synonyms", "relevanssi"); ?></h3>
|
1347 |
+
|
1348 |
<p><textarea name='relevanssi_synonyms' id='relevanssi_synonyms' rows='9' cols='60'><?php echo htmlspecialchars($synonyms); ?></textarea></p>
|
1349 |
|
1350 |
<p><small><?php _e("Add synonyms here in 'key = value' format. When searching with the OR operator, any search of 'key' will be expanded to include 'value' as well. Using phrases is possible. The key-value pairs work in one direction only, but you can of course repeat the same pair reversed.", "relevanssi"); ?></small></p>
|
1351 |
|
1352 |
+
<?php if (function_exists('relevanssi_form_index_synonyms')) relevanssi_form_index_synonyms($index_synonyms); ?>
|
1353 |
|
1354 |
<input type='submit' name='submit' value='<?php esc_attr_e('Save the options', 'relevanssi'); ?>' class='button' />
|
1355 |
|
1356 |
<h3 id="stopwords"><?php _e("Stopwords", "relevanssi"); ?></h3>
|
1357 |
+
|
1358 |
<?php relevanssi_show_stopwords(); ?>
|
1359 |
|
1360 |
+
<?php if (function_exists('relevanssi_form_importexport')) relevanssi_form_importexport($serialized_options); ?>
|
1361 |
+
|
1362 |
</form>
|
1363 |
</div>
|
1364 |
|
1392 |
// We can't check, so let's assume something sensible
|
1393 |
$src = '/wp-content/plugins/' . $plugin . '/delete.png';
|
1394 |
}
|
1395 |
+
|
1396 |
echo "<ul>";
|
1397 |
$results = $wpdb->get_results("SELECT * FROM " . $relevanssi_variables['stopword_table']);
|
1398 |
$exportlist = array();
|
1399 |
foreach ($results as $stopword) {
|
1400 |
+
$sw = stripslashes($stopword->stopword);
|
1401 |
printf('<li style="display: inline;"><input type="submit" name="removestopword" value="%s"/></li>', esc_attr($sw));
|
1402 |
array_push($exportlist, $sw);
|
1403 |
}
|
1404 |
echo "</ul>";
|
1405 |
+
|
1406 |
?>
|
1407 |
<p><input type="submit" name="removeallstopwords" value="<?php esc_attr_e('Remove all stopwords', 'relevanssi'); ?>" class='button' /></p>
|
1408 |
<?php
|
1409 |
|
1410 |
$exportlist = htmlspecialchars(implode(", ", $exportlist));
|
1411 |
+
|
1412 |
?>
|
1413 |
<p><?php _e("Here's a list of stopwords you can use to export the stopwords to another blog.", "relevanssi"); ?></p>
|
1414 |
|
1416 |
<?php
|
1417 |
|
1418 |
}
|
1419 |
+
?>
|
lib/search.php
CHANGED
@@ -32,7 +32,7 @@ function relevanssi_query($posts, $query = false) {
|
|
32 |
}
|
33 |
|
34 |
$search_ok = apply_filters('relevanssi_search_ok', $search_ok);
|
35 |
-
|
36 |
if ($relevanssi_active) {
|
37 |
$search_ok = false; // Relevanssi is already in action
|
38 |
}
|
@@ -41,7 +41,7 @@ function relevanssi_query($posts, $query = false) {
|
|
41 |
$wp_query = apply_filters('relevanssi_modify_wp_query', $wp_query);
|
42 |
$posts = relevanssi_do_query($wp_query);
|
43 |
}
|
44 |
-
|
45 |
return $posts;
|
46 |
}
|
47 |
|
@@ -49,20 +49,20 @@ function relevanssi_query($posts, $query = false) {
|
|
49 |
function relevanssi_search($args) {
|
50 |
global $wpdb, $relevanssi_variables;
|
51 |
$relevanssi_table = $relevanssi_variables['relevanssi_table'];
|
52 |
-
|
53 |
$filtered_args = apply_filters( 'relevanssi_search_filters', $args );
|
54 |
extract($filtered_args);
|
55 |
-
|
56 |
$hits = array();
|
57 |
|
58 |
$query_restrictions = "";
|
59 |
if (!isset($tax_query_relation)) $tax_query_relation = "or";
|
60 |
$tax_query_relation = strtolower($tax_query_relation);
|
61 |
$term_tax_id = array();
|
62 |
-
$term_tax_ids = array();
|
63 |
-
$not_term_tax_ids = array();
|
64 |
$and_term_tax_ids = array();
|
65 |
-
|
66 |
if (is_array($tax_query)) {
|
67 |
foreach ($tax_query as $row) {
|
68 |
$using_term_tax_id = false;
|
@@ -173,18 +173,18 @@ function relevanssi_search($args) {
|
|
173 |
if (!empty($term_tax_id)) {
|
174 |
$n = count($term_tax_id);
|
175 |
$term_tax_id = implode(',', $term_tax_id);
|
176 |
-
|
177 |
$tq_operator = 'IN';
|
178 |
if (isset($row['operator'])) $tq_operator = strtoupper($row['operator']);
|
179 |
if ($tq_operator != 'IN' && $tq_operator != 'NOT IN' && $tq_operator != 'AND') $tq_operator = 'IN';
|
180 |
if ($tax_query_relation == 'and') {
|
181 |
if ($tq_operator == 'AND') {
|
182 |
$query_restrictions .= " AND relevanssi.doc IN (
|
183 |
-
SELECT ID FROM $wpdb->posts WHERE 1=1
|
184 |
AND (
|
185 |
-
SELECT COUNT(1)
|
186 |
FROM $wpdb->term_relationships AS tr
|
187 |
-
WHERE tr.term_taxonomy_id IN ($term_tax_id)
|
188 |
AND tr.object_id = $wpdb->posts.ID ) = $n
|
189 |
)";
|
190 |
// Clean: $term_tax_id and $n are Relevanssi-generated
|
@@ -224,18 +224,18 @@ function relevanssi_search($args) {
|
|
224 |
$and_term_tax_ids = implode(',', $and_term_tax_ids);
|
225 |
$n = count(explode(',', $and_term_tax_ids));
|
226 |
$query_restrictions .= " AND relevanssi.doc IN (
|
227 |
-
SELECT ID FROM $wpdb->posts WHERE 1=1
|
228 |
AND (
|
229 |
-
SELECT COUNT(1)
|
230 |
FROM $wpdb->term_relationships AS tr
|
231 |
-
WHERE tr.term_taxonomy_id IN ($and_term_tax_ids)
|
232 |
AND tr.object_id = $wpdb->posts.ID ) = $n
|
233 |
)";
|
234 |
// Clean: all variables are Relevanssi-generated
|
235 |
}
|
236 |
}
|
237 |
}
|
238 |
-
|
239 |
if (is_array($post_query)) {
|
240 |
if (!empty($post_query['in'])) {
|
241 |
$valid_values = array();
|
@@ -256,7 +256,7 @@ function relevanssi_search($args) {
|
|
256 |
// Clean: $posts is checked to be integers
|
257 |
}
|
258 |
}
|
259 |
-
|
260 |
if (is_array($parent_query)) {
|
261 |
if (!empty($parent_query['parent in'])) {
|
262 |
$valid_values = array();
|
@@ -265,7 +265,7 @@ function relevanssi_search($args) {
|
|
265 |
}
|
266 |
$posts = implode(',', $valid_values);
|
267 |
if (!empty($posts)) $query_restrictions .= " AND relevanssi.doc IN (SELECT ID FROM $wpdb->posts WHERE post_parent IN ($posts))";
|
268 |
-
// Clean: $posts is checked to be integers
|
269 |
}
|
270 |
if (!empty($parent_query['parent not in'])) {
|
271 |
$valid_values = array();
|
@@ -274,7 +274,7 @@ function relevanssi_search($args) {
|
|
274 |
}
|
275 |
$posts = implode(',', $valid_values);
|
276 |
if (!empty($posts)) $query_restrictions .= " AND relevanssi.doc NOT IN (SELECT ID FROM $wpdb->posts WHERE post_parent IN ($posts))";
|
277 |
-
// Clean: $posts is checked to be integers
|
278 |
}
|
279 |
}
|
280 |
|
@@ -298,7 +298,7 @@ function relevanssi_search($args) {
|
|
298 |
|
299 |
if (!empty($date_query)) {
|
300 |
if (is_object($date_query) && method_exists($date_query, 'get_sql')) {
|
301 |
-
$sql = $date_query->get_sql(); // AND ( the query itself )
|
302 |
$query_restrictions .= " AND relevanssi.doc IN ( SELECT DISTINCT(ID) FROM $wpdb->posts WHERE 1 $sql )";
|
303 |
// Clean: $sql generated by $date_query->get_sql() query
|
304 |
}
|
@@ -345,7 +345,7 @@ function relevanssi_search($args) {
|
|
345 |
$postex .= " AND relevanssi.doc != '$exid'";
|
346 |
// Clean: escaped
|
347 |
}
|
348 |
-
}
|
349 |
}
|
350 |
// <- OdditY End
|
351 |
|
@@ -363,7 +363,7 @@ function relevanssi_search($args) {
|
|
363 |
else {
|
364 |
$negative_terms = false;
|
365 |
}
|
366 |
-
|
367 |
if (function_exists('relevanssi_recognize_positives')) {
|
368 |
$positive_terms = relevanssi_recognize_positives($q);
|
369 |
}
|
@@ -379,13 +379,13 @@ function relevanssi_search($args) {
|
|
379 |
}
|
380 |
$terms = array_keys($terms); // don't care about tf in query
|
381 |
|
382 |
-
if ($negative_terms) {
|
383 |
$terms = array_diff($terms, $negative_terms);
|
384 |
/* if (count($terms) < 1) {
|
385 |
return $hits;
|
386 |
}
|
387 |
*/ }
|
388 |
-
|
389 |
// Go get the count from the options table, but keep running the full query if it's not available
|
390 |
$D = get_option('relevanssi_doc_count');
|
391 |
if (!$D || $D < 1) {
|
@@ -393,9 +393,9 @@ function relevanssi_search($args) {
|
|
393 |
// Clean: no external inputs
|
394 |
update_option('relevanssi_doc_count', $D);
|
395 |
}
|
396 |
-
|
397 |
$total_hits = 0;
|
398 |
-
|
399 |
$title_matches = array();
|
400 |
$tag_matches = array();
|
401 |
$comment_matches = array();
|
@@ -408,7 +408,7 @@ function relevanssi_search($args) {
|
|
408 |
|
409 |
$fuzzy = get_option('relevanssi_fuzzy');
|
410 |
|
411 |
-
if (function_exists('relevanssi_negatives_positives')) {
|
412 |
$query_restrictions .= relevanssi_negatives_positives($negative_terms, $positive_terms, $relevanssi_table);
|
413 |
// Clean: escaped in the function
|
414 |
}
|
@@ -438,7 +438,7 @@ function relevanssi_search($args) {
|
|
438 |
// Clean: $authors is always just numbers
|
439 |
}
|
440 |
}
|
441 |
-
|
442 |
if ($post_type) {
|
443 |
global $wp_query;
|
444 |
if ($wp_query->is_admin) {
|
@@ -466,7 +466,7 @@ function relevanssi_search($args) {
|
|
466 |
}
|
467 |
// Clean: $post_status is escaped
|
468 |
}
|
469 |
-
|
470 |
if ($phrases) {
|
471 |
$query_restrictions .= " $phrases";
|
472 |
// Clean: $phrases is escaped earlier
|
@@ -517,7 +517,7 @@ function relevanssi_search($args) {
|
|
517 |
else {
|
518 |
$o_term_cond = " relevanssi.term = '#term#' ";
|
519 |
}
|
520 |
-
|
521 |
if (count($terms) < 1) {
|
522 |
$o_term_cond = " relevanssi.term = relevanssi.term ";
|
523 |
$terms[] = "term";
|
@@ -555,19 +555,19 @@ function relevanssi_search($args) {
|
|
555 |
$term = like_escape($term);
|
556 |
}
|
557 |
}
|
558 |
-
|
559 |
-
$term_cond = str_replace('#term#', $term, $o_term_cond);
|
560 |
-
|
561 |
!empty($post_type_weights['post_tag']) ? $tag = $post_type_weights['post_tag'] : $tag = $relevanssi_variables['post_type_weight_defaults']['post_tag'];
|
562 |
!empty($post_type_weights['category']) ? $cat = $post_type_weights['category'] : $cat = $relevanssi_variables['post_type_weight_defaults']['category'];
|
563 |
|
564 |
-
$query = "SELECT relevanssi.*, relevanssi.title * $title_boost + relevanssi.content + relevanssi.comment * $comment_boost + relevanssi.tag * $tag + relevanssi.link * $link_boost + relevanssi.author + relevanssi.category * $cat + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf
|
565 |
FROM $relevanssi_table AS relevanssi $query_join WHERE $term_cond $query_restrictions";
|
566 |
// Clean: $query_restrictions is escaped, $term_cond is escaped
|
567 |
-
|
568 |
$query = apply_filters('relevanssi_query_filter', $query);
|
569 |
$matches = $wpdb->get_results($query);
|
570 |
-
|
571 |
if (count($matches) < 1) {
|
572 |
continue;
|
573 |
}
|
@@ -580,25 +580,25 @@ function relevanssi_search($args) {
|
|
580 |
$existing_ids[] = $match->doc;
|
581 |
}
|
582 |
$existing_ids = implode(',', $existing_ids);
|
583 |
-
$query = "SELECT relevanssi.*, relevanssi.title * $title_boost + relevanssi.content + relevanssi.comment * $comment_boost + relevanssi.tag * $tag + relevanssi.link * $link_boost + relevanssi.author + relevanssi.category * $cat + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf
|
584 |
FROM $relevanssi_table AS relevanssi WHERE relevanssi.doc IN ($post_ids_to_add) AND relevanssi.doc NOT IN ($existing_ids) AND $term_cond";
|
585 |
// Clean: no unescaped user inputs
|
586 |
$matches_to_add = $wpdb->get_results($query);
|
587 |
$matches = array_merge($matches, $matches_to_add);
|
588 |
}
|
589 |
}
|
590 |
-
|
591 |
relevanssi_populate_array($matches);
|
592 |
global $relevanssi_post_types;
|
593 |
|
594 |
$total_hits += count($matches);
|
595 |
-
|
596 |
$query = "SELECT COUNT(DISTINCT(relevanssi.doc)) FROM $relevanssi_table AS relevanssi $query_join WHERE $term_cond $query_restrictions";
|
597 |
// Clean: $query_restrictions is escaped, $term_cond is escaped
|
598 |
$query = apply_filters('relevanssi_df_query_filter', $query);
|
599 |
-
|
600 |
$df = $wpdb->get_var($query);
|
601 |
-
|
602 |
if ($df < 1 && "sometimes" == $fuzzy) {
|
603 |
$query = "SELECT COUNT(DISTINCT(relevanssi.doc)) FROM $relevanssi_table AS relevanssi $query_join
|
604 |
WHERE (relevanssi.term LIKE '$term%' OR relevanssi.term_reverse LIKE CONCAT(REVERSE('$term), %')) $query_restrictions";
|
@@ -606,9 +606,10 @@ function relevanssi_search($args) {
|
|
606 |
$query = apply_filters('relevanssi_df_query_filter', $query);
|
607 |
$df = $wpdb->get_var($query);
|
608 |
}
|
609 |
-
|
610 |
$idf = log($D + 1 / (1 + $df));
|
611 |
$idf = $idf * $idf;
|
|
|
612 |
foreach ($matches as $match) {
|
613 |
if ('user' == $match->type) {
|
614 |
$match->doc = 'u_' . $match->item;
|
@@ -634,7 +635,7 @@ function relevanssi_search($args) {
|
|
634 |
}
|
635 |
}
|
636 |
}
|
637 |
-
|
638 |
$match->tf =
|
639 |
$match->title * $title_boost +
|
640 |
$match->content +
|
@@ -660,7 +661,7 @@ function relevanssi_search($args) {
|
|
660 |
$match->mysqlcolumn;
|
661 |
|
662 |
$match->weight = $match->tf * $idf;
|
663 |
-
|
664 |
if ($recency_bonus) {
|
665 |
$post = relevanssi_get_post($match->doc);
|
666 |
if (strtotime($post->post_date) > $recency_cutoff_date)
|
@@ -674,7 +675,7 @@ function relevanssi_search($args) {
|
|
674 |
isset($category_matches[$match->doc]) ? $category_matches[$match->doc] += $match->category : $category_matches[$match->doc] = $match->category;
|
675 |
isset($taxonomy_matches[$match->doc]) ? $taxonomy_matches[$match->doc] += $match->taxonomy : $taxonomy_matches[$match->doc] = $match->taxonomy;
|
676 |
isset($comment_matches[$match->doc]) ? $comment_matches[$match->doc] += $match->comment : $comment_matches[$match->doc] = $match->comment;
|
677 |
-
|
678 |
isset($relevanssi_post_types[$match->doc]) ? $type = $relevanssi_post_types[$match->doc] : $type = null;
|
679 |
if (!empty($post_type_weights[$type])) {
|
680 |
$match->weight = $match->weight * $post_type_weights[$type];
|
@@ -686,7 +687,7 @@ function relevanssi_search($args) {
|
|
686 |
|
687 |
$post_ok = true;
|
688 |
$post_ok = apply_filters('relevanssi_post_ok', $post_ok, $match->doc);
|
689 |
-
|
690 |
if ($post_ok) {
|
691 |
$doc_terms[$match->doc][$term] = true; // count how many terms are matched to a doc
|
692 |
isset($doc_weight[$match->doc]) ? $doc_weight[$match->doc] += $match->weight : $doc_weight[$match->doc] = $match->weight;
|
@@ -717,7 +718,7 @@ function relevanssi_search($args) {
|
|
717 |
$search_again = false;
|
718 |
}
|
719 |
} while ($search_again);
|
720 |
-
|
721 |
$strip_stops = true;
|
722 |
$temp_terms_without_stops = array_keys(relevanssi_tokenize(implode(' ', $terms), $strip_stops));
|
723 |
$terms_without_stops = array();
|
@@ -739,7 +740,7 @@ function relevanssi_search($args) {
|
|
739 |
// doc didn't match all terms, so it's discarded
|
740 |
continue;
|
741 |
}
|
742 |
-
|
743 |
if (!empty($fields)) {
|
744 |
if ($fields == 'ids') {
|
745 |
$hits[intval($i)] = $doc;
|
@@ -748,7 +749,7 @@ function relevanssi_search($args) {
|
|
748 |
$object = new StdClass();
|
749 |
$object->ID = $doc;
|
750 |
$object->post_parent = wp_get_post_parent_id($doc);
|
751 |
-
|
752 |
$hits[intval($i)] = $object;
|
753 |
}
|
754 |
}
|
@@ -770,7 +771,7 @@ function relevanssi_search($args) {
|
|
770 |
}
|
771 |
}
|
772 |
|
773 |
-
global $wp;
|
774 |
$default_order = get_option('relevanssi_default_orderby', 'relevance');
|
775 |
if (empty($orderby)) $orderby = $default_order;
|
776 |
// the sorting function checks for non-existing keys, cannot whitelist here
|
@@ -779,15 +780,15 @@ function relevanssi_search($args) {
|
|
779 |
$order = strtolower($order);
|
780 |
$order_accepted_values = array('asc', 'desc');
|
781 |
if (!in_array($order, $order_accepted_values)) $order = 'desc';
|
782 |
-
|
783 |
$orderby = apply_filters('relevanssi_orderby', $orderby);
|
784 |
$order = apply_filters('relevanssi_order', $order);
|
785 |
-
|
786 |
if ($orderby != 'relevance')
|
787 |
relevanssi_object_sort($hits, $orderby, $order);
|
788 |
|
789 |
$return = array('hits' => $hits, 'body_matches' => $body_matches, 'title_matches' => $title_matches,
|
790 |
-
'tag_matches' => $tag_matches, 'category_matches' => $category_matches, 'taxonomy_matches' => $taxonomy_matches,
|
791 |
'comment_matches' => $comment_matches, 'scores' => $scores,
|
792 |
'term_hits' => $term_hits, 'query' => $q, 'link_matches' => $link_matches);
|
793 |
|
@@ -811,7 +812,7 @@ function relevanssi_do_query(&$query) {
|
|
811 |
if (isset($query->query_vars['searchblogs']) && (string) get_current_blog_id() != $query->query_vars['searchblogs']) {
|
812 |
$search_multisite = true;
|
813 |
}
|
814 |
-
|
815 |
if (isset($query->query_vars['searchblogs']) && $search_multisite) {
|
816 |
$multi_args['search_blogs'] = $query->query_vars['searchblogs'];
|
817 |
$multi_args['q'] = $q;
|
@@ -946,14 +947,14 @@ function relevanssi_do_query(&$query) {
|
|
946 |
if (isset($extag) && $extag != 0) {
|
947 |
$tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $extag, 'operator' => 'NOT IN');
|
948 |
}
|
949 |
-
|
950 |
if (isset($query->query_vars["taxonomy"])) {
|
951 |
if (function_exists('relevanssi_process_taxonomies')) {
|
952 |
$tax_query = relevanssi_process_taxonomies($query->query_vars["taxonomy"], $query->query_vars["term"], $tax_query);
|
953 |
}
|
954 |
else {
|
955 |
if (!empty($query->query_vars["term"])) $term = $query->query_vars["term"];
|
956 |
-
|
957 |
$tax_query[] = array('taxonomy' => $query->query_vars["taxonomy"], 'field' => 'slug', 'terms' => $term);
|
958 |
}
|
959 |
}
|
@@ -967,7 +968,7 @@ function relevanssi_do_query(&$query) {
|
|
967 |
$author_object = get_user_by('slug', $query->query_vars["author_name"]);
|
968 |
$author[] = $author_object->ID;
|
969 |
}
|
970 |
-
|
971 |
$post_query = array();
|
972 |
if (!empty($query->query_vars['p'])) {
|
973 |
$post_query = array('in' => array($query->query_vars['p']));
|
@@ -981,7 +982,7 @@ function relevanssi_do_query(&$query) {
|
|
981 |
if (!empty($query->query_vars['post__not_in'])) {
|
982 |
$post_query = array('not in' => $query->query_vars['post__not_in']);
|
983 |
}
|
984 |
-
|
985 |
$parent_query = array();
|
986 |
if (!empty($query->query_vars['post_parent'])) {
|
987 |
$parent_query = array('parent in' => array($query->query_vars['post_parent']));
|
@@ -1013,20 +1014,20 @@ function relevanssi_do_query(&$query) {
|
|
1013 |
$meta_query[] = array('key' => $query->query_vars["meta_key"], 'value' => $value, 'compare' => $compare);
|
1014 |
}
|
1015 |
|
1016 |
-
$date_query = false;
|
1017 |
-
if (!empty($query->date_query)) {
|
1018 |
-
if (is_object($query->date_query) && get_class($query->date_query) == 'WP_Date_Query') { // there is no is_WP_Date_Query_Object() function
|
1019 |
-
$date_query = $query->date_query;
|
1020 |
-
} else {
|
1021 |
-
$date_query = new WP_Date_Query($query->date_query);
|
1022 |
-
}
|
1023 |
}
|
1024 |
|
1025 |
$search_blogs = false;
|
1026 |
if (isset($query->query_vars["search_blogs"])) {
|
1027 |
$search_blogs = $query->query_vars["search_blogs"];
|
1028 |
}
|
1029 |
-
|
1030 |
$post_type = false;
|
1031 |
if (isset($query->query_vars["post_type"]) && $query->query_vars["post_type"] != 'any') {
|
1032 |
$post_type = $query->query_vars["post_type"];
|
@@ -1034,16 +1035,16 @@ function relevanssi_do_query(&$query) {
|
|
1034 |
if (isset($query->query_vars["post_types"]) && $query->query_vars["post_types"] != 'any') {
|
1035 |
$post_type = $query->query_vars["post_types"];
|
1036 |
}
|
1037 |
-
|
1038 |
if ($post_type == -1) $post_type = false;
|
1039 |
|
1040 |
-
$post_status = false;
|
1041 |
if (isset($query->query_vars["post_status"]) && $query->query_vars["post_status"] != 'any') {
|
1042 |
$post_status = $query->query_vars["post_status"];
|
1043 |
}
|
1044 |
|
1045 |
$expost = get_option("relevanssi_exclude_posts");
|
1046 |
-
|
1047 |
// In admin (and when not AJAX), search everything
|
1048 |
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
|
1049 |
$excat = null;
|
@@ -1057,7 +1058,7 @@ function relevanssi_do_query(&$query) {
|
|
1057 |
$operator = strtoupper($operator); // just in case
|
1058 |
}
|
1059 |
if ($operator != "OR" && $operator != "AND") $operator = get_option("relevanssi_implicit_operator");
|
1060 |
-
|
1061 |
isset($query->query_vars['orderby']) ? $orderby = $query->query_vars['orderby'] : $orderby = null;
|
1062 |
isset($query->query_vars['order']) ? $order = $query->query_vars['order'] : $order = null;
|
1063 |
|
@@ -1070,21 +1071,21 @@ function relevanssi_do_query(&$query) {
|
|
1070 |
$fields = 'id=>parent';
|
1071 |
}
|
1072 |
}
|
1073 |
-
|
1074 |
// Add synonyms
|
1075 |
// This is done here so the new terms will get highlighting
|
1076 |
if ("OR" == $operator) {
|
1077 |
// Synonyms are only used in OR queries
|
1078 |
$q = relevanssi_add_synonyms($q);
|
1079 |
}
|
1080 |
-
|
1081 |
$search_params = array(
|
1082 |
'q' => $q,
|
1083 |
'tax_query' => $tax_query,
|
1084 |
-
'tax_query_relation' => $tax_query_relation,
|
1085 |
'post_query' => $post_query,
|
1086 |
'parent_query' => $parent_query,
|
1087 |
-
'meta_query' => $meta_query,
|
1088 |
'date_query' => $date_query,
|
1089 |
'expost' => $expost,
|
1090 |
'post_type' => $post_type,
|
@@ -1095,7 +1096,7 @@ function relevanssi_do_query(&$query) {
|
|
1095 |
'orderby' => $orderby,
|
1096 |
'order' => $order,
|
1097 |
'fields' => $fields);
|
1098 |
-
|
1099 |
$return = relevanssi_search($search_params);
|
1100 |
}
|
1101 |
|
@@ -1159,8 +1160,8 @@ function relevanssi_do_query(&$query) {
|
|
1159 |
// apparently sometimes you can get a null object
|
1160 |
continue;
|
1161 |
}
|
1162 |
-
|
1163 |
-
//Added by OdditY - Highlight Result Title too ->
|
1164 |
if("on" == get_option('relevanssi_hilite_title')){
|
1165 |
if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
|
1166 |
$post->post_highlighted_title = strip_tags(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title));
|
@@ -1176,12 +1177,12 @@ function relevanssi_do_query(&$query) {
|
|
1176 |
}
|
1177 |
}
|
1178 |
// OdditY end <-
|
1179 |
-
|
1180 |
if ('on' == $make_excerpts && empty($fields)) {
|
1181 |
$post->original_excerpt = $post->post_excerpt;
|
1182 |
$post->post_excerpt = relevanssi_do_excerpt($post, $q);
|
1183 |
}
|
1184 |
-
|
1185 |
if ('on' == get_option('relevanssi_show_matches') && empty($fields)) {
|
1186 |
$post_id = $post->ID;
|
1187 |
if ($post->post_type == 'user') {
|
@@ -1192,15 +1193,15 @@ function relevanssi_do_query(&$query) {
|
|
1192 |
}
|
1193 |
$post->post_excerpt .= relevanssi_show_matches($return, $post_id);
|
1194 |
}
|
1195 |
-
|
1196 |
if (empty($fields) && isset($return['scores'][$post->ID])) $post->relevance_score = round($return['scores'][$post->ID], 2);
|
1197 |
-
|
1198 |
$posts[] = $post;
|
1199 |
}
|
1200 |
|
1201 |
$query->posts = $posts;
|
1202 |
$query->post_count = count($posts);
|
1203 |
-
|
1204 |
return $posts;
|
1205 |
}
|
1206 |
|
@@ -1216,4 +1217,4 @@ function relevanssi_limit_filter($query) {
|
|
1216 |
}
|
1217 |
}
|
1218 |
|
1219 |
-
?>
|
32 |
}
|
33 |
|
34 |
$search_ok = apply_filters('relevanssi_search_ok', $search_ok);
|
35 |
+
|
36 |
if ($relevanssi_active) {
|
37 |
$search_ok = false; // Relevanssi is already in action
|
38 |
}
|
41 |
$wp_query = apply_filters('relevanssi_modify_wp_query', $wp_query);
|
42 |
$posts = relevanssi_do_query($wp_query);
|
43 |
}
|
44 |
+
|
45 |
return $posts;
|
46 |
}
|
47 |
|
49 |
function relevanssi_search($args) {
|
50 |
global $wpdb, $relevanssi_variables;
|
51 |
$relevanssi_table = $relevanssi_variables['relevanssi_table'];
|
52 |
+
|
53 |
$filtered_args = apply_filters( 'relevanssi_search_filters', $args );
|
54 |
extract($filtered_args);
|
55 |
+
|
56 |
$hits = array();
|
57 |
|
58 |
$query_restrictions = "";
|
59 |
if (!isset($tax_query_relation)) $tax_query_relation = "or";
|
60 |
$tax_query_relation = strtolower($tax_query_relation);
|
61 |
$term_tax_id = array();
|
62 |
+
$term_tax_ids = array();
|
63 |
+
$not_term_tax_ids = array();
|
64 |
$and_term_tax_ids = array();
|
65 |
+
|
66 |
if (is_array($tax_query)) {
|
67 |
foreach ($tax_query as $row) {
|
68 |
$using_term_tax_id = false;
|
173 |
if (!empty($term_tax_id)) {
|
174 |
$n = count($term_tax_id);
|
175 |
$term_tax_id = implode(',', $term_tax_id);
|
176 |
+
|
177 |
$tq_operator = 'IN';
|
178 |
if (isset($row['operator'])) $tq_operator = strtoupper($row['operator']);
|
179 |
if ($tq_operator != 'IN' && $tq_operator != 'NOT IN' && $tq_operator != 'AND') $tq_operator = 'IN';
|
180 |
if ($tax_query_relation == 'and') {
|
181 |
if ($tq_operator == 'AND') {
|
182 |
$query_restrictions .= " AND relevanssi.doc IN (
|
183 |
+
SELECT ID FROM $wpdb->posts WHERE 1=1
|
184 |
AND (
|
185 |
+
SELECT COUNT(1)
|
186 |
FROM $wpdb->term_relationships AS tr
|
187 |
+
WHERE tr.term_taxonomy_id IN ($term_tax_id)
|
188 |
AND tr.object_id = $wpdb->posts.ID ) = $n
|
189 |
)";
|
190 |
// Clean: $term_tax_id and $n are Relevanssi-generated
|
224 |
$and_term_tax_ids = implode(',', $and_term_tax_ids);
|
225 |
$n = count(explode(',', $and_term_tax_ids));
|
226 |
$query_restrictions .= " AND relevanssi.doc IN (
|
227 |
+
SELECT ID FROM $wpdb->posts WHERE 1=1
|
228 |
AND (
|
229 |
+
SELECT COUNT(1)
|
230 |
FROM $wpdb->term_relationships AS tr
|
231 |
+
WHERE tr.term_taxonomy_id IN ($and_term_tax_ids)
|
232 |
AND tr.object_id = $wpdb->posts.ID ) = $n
|
233 |
)";
|
234 |
// Clean: all variables are Relevanssi-generated
|
235 |
}
|
236 |
}
|
237 |
}
|
238 |
+
|
239 |
if (is_array($post_query)) {
|
240 |
if (!empty($post_query['in'])) {
|
241 |
$valid_values = array();
|
256 |
// Clean: $posts is checked to be integers
|
257 |
}
|
258 |
}
|
259 |
+
|
260 |
if (is_array($parent_query)) {
|
261 |
if (!empty($parent_query['parent in'])) {
|
262 |
$valid_values = array();
|
265 |
}
|
266 |
$posts = implode(',', $valid_values);
|
267 |
if (!empty($posts)) $query_restrictions .= " AND relevanssi.doc IN (SELECT ID FROM $wpdb->posts WHERE post_parent IN ($posts))";
|
268 |
+
// Clean: $posts is checked to be integers
|
269 |
}
|
270 |
if (!empty($parent_query['parent not in'])) {
|
271 |
$valid_values = array();
|
274 |
}
|
275 |
$posts = implode(',', $valid_values);
|
276 |
if (!empty($posts)) $query_restrictions .= " AND relevanssi.doc NOT IN (SELECT ID FROM $wpdb->posts WHERE post_parent IN ($posts))";
|
277 |
+
// Clean: $posts is checked to be integers
|
278 |
}
|
279 |
}
|
280 |
|
298 |
|
299 |
if (!empty($date_query)) {
|
300 |
if (is_object($date_query) && method_exists($date_query, 'get_sql')) {
|
301 |
+
$sql = $date_query->get_sql(); // AND ( the query itself )
|
302 |
$query_restrictions .= " AND relevanssi.doc IN ( SELECT DISTINCT(ID) FROM $wpdb->posts WHERE 1 $sql )";
|
303 |
// Clean: $sql generated by $date_query->get_sql() query
|
304 |
}
|
345 |
$postex .= " AND relevanssi.doc != '$exid'";
|
346 |
// Clean: escaped
|
347 |
}
|
348 |
+
}
|
349 |
}
|
350 |
// <- OdditY End
|
351 |
|
363 |
else {
|
364 |
$negative_terms = false;
|
365 |
}
|
366 |
+
|
367 |
if (function_exists('relevanssi_recognize_positives')) {
|
368 |
$positive_terms = relevanssi_recognize_positives($q);
|
369 |
}
|
379 |
}
|
380 |
$terms = array_keys($terms); // don't care about tf in query
|
381 |
|
382 |
+
if ($negative_terms) {
|
383 |
$terms = array_diff($terms, $negative_terms);
|
384 |
/* if (count($terms) < 1) {
|
385 |
return $hits;
|
386 |
}
|
387 |
*/ }
|
388 |
+
|
389 |
// Go get the count from the options table, but keep running the full query if it's not available
|
390 |
$D = get_option('relevanssi_doc_count');
|
391 |
if (!$D || $D < 1) {
|
393 |
// Clean: no external inputs
|
394 |
update_option('relevanssi_doc_count', $D);
|
395 |
}
|
396 |
+
|
397 |
$total_hits = 0;
|
398 |
+
|
399 |
$title_matches = array();
|
400 |
$tag_matches = array();
|
401 |
$comment_matches = array();
|
408 |
|
409 |
$fuzzy = get_option('relevanssi_fuzzy');
|
410 |
|
411 |
+
if (function_exists('relevanssi_negatives_positives')) {
|
412 |
$query_restrictions .= relevanssi_negatives_positives($negative_terms, $positive_terms, $relevanssi_table);
|
413 |
// Clean: escaped in the function
|
414 |
}
|
438 |
// Clean: $authors is always just numbers
|
439 |
}
|
440 |
}
|
441 |
+
|
442 |
if ($post_type) {
|
443 |
global $wp_query;
|
444 |
if ($wp_query->is_admin) {
|
466 |
}
|
467 |
// Clean: $post_status is escaped
|
468 |
}
|
469 |
+
|
470 |
if ($phrases) {
|
471 |
$query_restrictions .= " $phrases";
|
472 |
// Clean: $phrases is escaped earlier
|
517 |
else {
|
518 |
$o_term_cond = " relevanssi.term = '#term#' ";
|
519 |
}
|
520 |
+
|
521 |
if (count($terms) < 1) {
|
522 |
$o_term_cond = " relevanssi.term = relevanssi.term ";
|
523 |
$terms[] = "term";
|
555 |
$term = like_escape($term);
|
556 |
}
|
557 |
}
|
558 |
+
|
559 |
+
$term_cond = str_replace('#term#', $term, $o_term_cond);
|
560 |
+
|
561 |
!empty($post_type_weights['post_tag']) ? $tag = $post_type_weights['post_tag'] : $tag = $relevanssi_variables['post_type_weight_defaults']['post_tag'];
|
562 |
!empty($post_type_weights['category']) ? $cat = $post_type_weights['category'] : $cat = $relevanssi_variables['post_type_weight_defaults']['category'];
|
563 |
|
564 |
+
$query = "SELECT relevanssi.*, relevanssi.title * $title_boost + relevanssi.content + relevanssi.comment * $comment_boost + relevanssi.tag * $tag + relevanssi.link * $link_boost + relevanssi.author + relevanssi.category * $cat + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf
|
565 |
FROM $relevanssi_table AS relevanssi $query_join WHERE $term_cond $query_restrictions";
|
566 |
// Clean: $query_restrictions is escaped, $term_cond is escaped
|
567 |
+
|
568 |
$query = apply_filters('relevanssi_query_filter', $query);
|
569 |
$matches = $wpdb->get_results($query);
|
570 |
+
|
571 |
if (count($matches) < 1) {
|
572 |
continue;
|
573 |
}
|
580 |
$existing_ids[] = $match->doc;
|
581 |
}
|
582 |
$existing_ids = implode(',', $existing_ids);
|
583 |
+
$query = "SELECT relevanssi.*, relevanssi.title * $title_boost + relevanssi.content + relevanssi.comment * $comment_boost + relevanssi.tag * $tag + relevanssi.link * $link_boost + relevanssi.author + relevanssi.category * $cat + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf
|
584 |
FROM $relevanssi_table AS relevanssi WHERE relevanssi.doc IN ($post_ids_to_add) AND relevanssi.doc NOT IN ($existing_ids) AND $term_cond";
|
585 |
// Clean: no unescaped user inputs
|
586 |
$matches_to_add = $wpdb->get_results($query);
|
587 |
$matches = array_merge($matches, $matches_to_add);
|
588 |
}
|
589 |
}
|
590 |
+
|
591 |
relevanssi_populate_array($matches);
|
592 |
global $relevanssi_post_types;
|
593 |
|
594 |
$total_hits += count($matches);
|
595 |
+
|
596 |
$query = "SELECT COUNT(DISTINCT(relevanssi.doc)) FROM $relevanssi_table AS relevanssi $query_join WHERE $term_cond $query_restrictions";
|
597 |
// Clean: $query_restrictions is escaped, $term_cond is escaped
|
598 |
$query = apply_filters('relevanssi_df_query_filter', $query);
|
599 |
+
|
600 |
$df = $wpdb->get_var($query);
|
601 |
+
|
602 |
if ($df < 1 && "sometimes" == $fuzzy) {
|
603 |
$query = "SELECT COUNT(DISTINCT(relevanssi.doc)) FROM $relevanssi_table AS relevanssi $query_join
|
604 |
WHERE (relevanssi.term LIKE '$term%' OR relevanssi.term_reverse LIKE CONCAT(REVERSE('$term), %')) $query_restrictions";
|
606 |
$query = apply_filters('relevanssi_df_query_filter', $query);
|
607 |
$df = $wpdb->get_var($query);
|
608 |
}
|
609 |
+
|
610 |
$idf = log($D + 1 / (1 + $df));
|
611 |
$idf = $idf * $idf;
|
612 |
+
if ($idf < 1) $idf = 1;
|
613 |
foreach ($matches as $match) {
|
614 |
if ('user' == $match->type) {
|
615 |
$match->doc = 'u_' . $match->item;
|
635 |
}
|
636 |
}
|
637 |
}
|
638 |
+
|
639 |
$match->tf =
|
640 |
$match->title * $title_boost +
|
641 |
$match->content +
|
661 |
$match->mysqlcolumn;
|
662 |
|
663 |
$match->weight = $match->tf * $idf;
|
664 |
+
|
665 |
if ($recency_bonus) {
|
666 |
$post = relevanssi_get_post($match->doc);
|
667 |
if (strtotime($post->post_date) > $recency_cutoff_date)
|
675 |
isset($category_matches[$match->doc]) ? $category_matches[$match->doc] += $match->category : $category_matches[$match->doc] = $match->category;
|
676 |
isset($taxonomy_matches[$match->doc]) ? $taxonomy_matches[$match->doc] += $match->taxonomy : $taxonomy_matches[$match->doc] = $match->taxonomy;
|
677 |
isset($comment_matches[$match->doc]) ? $comment_matches[$match->doc] += $match->comment : $comment_matches[$match->doc] = $match->comment;
|
678 |
+
|
679 |
isset($relevanssi_post_types[$match->doc]) ? $type = $relevanssi_post_types[$match->doc] : $type = null;
|
680 |
if (!empty($post_type_weights[$type])) {
|
681 |
$match->weight = $match->weight * $post_type_weights[$type];
|
687 |
|
688 |
$post_ok = true;
|
689 |
$post_ok = apply_filters('relevanssi_post_ok', $post_ok, $match->doc);
|
690 |
+
|
691 |
if ($post_ok) {
|
692 |
$doc_terms[$match->doc][$term] = true; // count how many terms are matched to a doc
|
693 |
isset($doc_weight[$match->doc]) ? $doc_weight[$match->doc] += $match->weight : $doc_weight[$match->doc] = $match->weight;
|
718 |
$search_again = false;
|
719 |
}
|
720 |
} while ($search_again);
|
721 |
+
|
722 |
$strip_stops = true;
|
723 |
$temp_terms_without_stops = array_keys(relevanssi_tokenize(implode(' ', $terms), $strip_stops));
|
724 |
$terms_without_stops = array();
|
740 |
// doc didn't match all terms, so it's discarded
|
741 |
continue;
|
742 |
}
|
743 |
+
|
744 |
if (!empty($fields)) {
|
745 |
if ($fields == 'ids') {
|
746 |
$hits[intval($i)] = $doc;
|
749 |
$object = new StdClass();
|
750 |
$object->ID = $doc;
|
751 |
$object->post_parent = wp_get_post_parent_id($doc);
|
752 |
+
|
753 |
$hits[intval($i)] = $object;
|
754 |
}
|
755 |
}
|
771 |
}
|
772 |
}
|
773 |
|
774 |
+
global $wp;
|
775 |
$default_order = get_option('relevanssi_default_orderby', 'relevance');
|
776 |
if (empty($orderby)) $orderby = $default_order;
|
777 |
// the sorting function checks for non-existing keys, cannot whitelist here
|
780 |
$order = strtolower($order);
|
781 |
$order_accepted_values = array('asc', 'desc');
|
782 |
if (!in_array($order, $order_accepted_values)) $order = 'desc';
|
783 |
+
|
784 |
$orderby = apply_filters('relevanssi_orderby', $orderby);
|
785 |
$order = apply_filters('relevanssi_order', $order);
|
786 |
+
|
787 |
if ($orderby != 'relevance')
|
788 |
relevanssi_object_sort($hits, $orderby, $order);
|
789 |
|
790 |
$return = array('hits' => $hits, 'body_matches' => $body_matches, 'title_matches' => $title_matches,
|
791 |
+
'tag_matches' => $tag_matches, 'category_matches' => $category_matches, 'taxonomy_matches' => $taxonomy_matches,
|
792 |
'comment_matches' => $comment_matches, 'scores' => $scores,
|
793 |
'term_hits' => $term_hits, 'query' => $q, 'link_matches' => $link_matches);
|
794 |
|
812 |
if (isset($query->query_vars['searchblogs']) && (string) get_current_blog_id() != $query->query_vars['searchblogs']) {
|
813 |
$search_multisite = true;
|
814 |
}
|
815 |
+
|
816 |
if (isset($query->query_vars['searchblogs']) && $search_multisite) {
|
817 |
$multi_args['search_blogs'] = $query->query_vars['searchblogs'];
|
818 |
$multi_args['q'] = $q;
|
947 |
if (isset($extag) && $extag != 0) {
|
948 |
$tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $extag, 'operator' => 'NOT IN');
|
949 |
}
|
950 |
+
|
951 |
if (isset($query->query_vars["taxonomy"])) {
|
952 |
if (function_exists('relevanssi_process_taxonomies')) {
|
953 |
$tax_query = relevanssi_process_taxonomies($query->query_vars["taxonomy"], $query->query_vars["term"], $tax_query);
|
954 |
}
|
955 |
else {
|
956 |
if (!empty($query->query_vars["term"])) $term = $query->query_vars["term"];
|
957 |
+
|
958 |
$tax_query[] = array('taxonomy' => $query->query_vars["taxonomy"], 'field' => 'slug', 'terms' => $term);
|
959 |
}
|
960 |
}
|
968 |
$author_object = get_user_by('slug', $query->query_vars["author_name"]);
|
969 |
$author[] = $author_object->ID;
|
970 |
}
|
971 |
+
|
972 |
$post_query = array();
|
973 |
if (!empty($query->query_vars['p'])) {
|
974 |
$post_query = array('in' => array($query->query_vars['p']));
|
982 |
if (!empty($query->query_vars['post__not_in'])) {
|
983 |
$post_query = array('not in' => $query->query_vars['post__not_in']);
|
984 |
}
|
985 |
+
|
986 |
$parent_query = array();
|
987 |
if (!empty($query->query_vars['post_parent'])) {
|
988 |
$parent_query = array('parent in' => array($query->query_vars['post_parent']));
|
1014 |
$meta_query[] = array('key' => $query->query_vars["meta_key"], 'value' => $value, 'compare' => $compare);
|
1015 |
}
|
1016 |
|
1017 |
+
$date_query = false;
|
1018 |
+
if (!empty($query->date_query)) {
|
1019 |
+
if (is_object($query->date_query) && get_class($query->date_query) == 'WP_Date_Query') { // there is no is_WP_Date_Query_Object() function
|
1020 |
+
$date_query = $query->date_query;
|
1021 |
+
} else {
|
1022 |
+
$date_query = new WP_Date_Query($query->date_query);
|
1023 |
+
}
|
1024 |
}
|
1025 |
|
1026 |
$search_blogs = false;
|
1027 |
if (isset($query->query_vars["search_blogs"])) {
|
1028 |
$search_blogs = $query->query_vars["search_blogs"];
|
1029 |
}
|
1030 |
+
|
1031 |
$post_type = false;
|
1032 |
if (isset($query->query_vars["post_type"]) && $query->query_vars["post_type"] != 'any') {
|
1033 |
$post_type = $query->query_vars["post_type"];
|
1035 |
if (isset($query->query_vars["post_types"]) && $query->query_vars["post_types"] != 'any') {
|
1036 |
$post_type = $query->query_vars["post_types"];
|
1037 |
}
|
1038 |
+
|
1039 |
if ($post_type == -1) $post_type = false;
|
1040 |
|
1041 |
+
$post_status = false;
|
1042 |
if (isset($query->query_vars["post_status"]) && $query->query_vars["post_status"] != 'any') {
|
1043 |
$post_status = $query->query_vars["post_status"];
|
1044 |
}
|
1045 |
|
1046 |
$expost = get_option("relevanssi_exclude_posts");
|
1047 |
+
|
1048 |
// In admin (and when not AJAX), search everything
|
1049 |
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
|
1050 |
$excat = null;
|
1058 |
$operator = strtoupper($operator); // just in case
|
1059 |
}
|
1060 |
if ($operator != "OR" && $operator != "AND") $operator = get_option("relevanssi_implicit_operator");
|
1061 |
+
|
1062 |
isset($query->query_vars['orderby']) ? $orderby = $query->query_vars['orderby'] : $orderby = null;
|
1063 |
isset($query->query_vars['order']) ? $order = $query->query_vars['order'] : $order = null;
|
1064 |
|
1071 |
$fields = 'id=>parent';
|
1072 |
}
|
1073 |
}
|
1074 |
+
|
1075 |
// Add synonyms
|
1076 |
// This is done here so the new terms will get highlighting
|
1077 |
if ("OR" == $operator) {
|
1078 |
// Synonyms are only used in OR queries
|
1079 |
$q = relevanssi_add_synonyms($q);
|
1080 |
}
|
1081 |
+
|
1082 |
$search_params = array(
|
1083 |
'q' => $q,
|
1084 |
'tax_query' => $tax_query,
|
1085 |
+
'tax_query_relation' => $tax_query_relation,
|
1086 |
'post_query' => $post_query,
|
1087 |
'parent_query' => $parent_query,
|
1088 |
+
'meta_query' => $meta_query,
|
1089 |
'date_query' => $date_query,
|
1090 |
'expost' => $expost,
|
1091 |
'post_type' => $post_type,
|
1096 |
'orderby' => $orderby,
|
1097 |
'order' => $order,
|
1098 |
'fields' => $fields);
|
1099 |
+
|
1100 |
$return = relevanssi_search($search_params);
|
1101 |
}
|
1102 |
|
1160 |
// apparently sometimes you can get a null object
|
1161 |
continue;
|
1162 |
}
|
1163 |
+
|
1164 |
+
//Added by OdditY - Highlight Result Title too ->
|
1165 |
if("on" == get_option('relevanssi_hilite_title')){
|
1166 |
if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
|
1167 |
$post->post_highlighted_title = strip_tags(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title));
|
1177 |
}
|
1178 |
}
|
1179 |
// OdditY end <-
|
1180 |
+
|
1181 |
if ('on' == $make_excerpts && empty($fields)) {
|
1182 |
$post->original_excerpt = $post->post_excerpt;
|
1183 |
$post->post_excerpt = relevanssi_do_excerpt($post, $q);
|
1184 |
}
|
1185 |
+
|
1186 |
if ('on' == get_option('relevanssi_show_matches') && empty($fields)) {
|
1187 |
$post_id = $post->ID;
|
1188 |
if ($post->post_type == 'user') {
|
1193 |
}
|
1194 |
$post->post_excerpt .= relevanssi_show_matches($return, $post_id);
|
1195 |
}
|
1196 |
+
|
1197 |
if (empty($fields) && isset($return['scores'][$post->ID])) $post->relevance_score = round($return['scores'][$post->ID], 2);
|
1198 |
+
|
1199 |
$posts[] = $post;
|
1200 |
}
|
1201 |
|
1202 |
$query->posts = $posts;
|
1203 |
$query->post_count = count($posts);
|
1204 |
+
|
1205 |
return $posts;
|
1206 |
}
|
1207 |
|
1217 |
}
|
1218 |
}
|
1219 |
|
1220 |
+
?>
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: msaari
|
|
3 |
Donate link: http://www.relevanssi.com/buy-premium/
|
4 |
Tags: search, relevance, better search
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 3.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -99,14 +99,14 @@ important Relevanssi debugging trick](http://www.relevanssi.com/knowledge-base/q
|
|
99 |
|
100 |
= How to index =
|
101 |
Check the options to make sure they're to your liking, then click "Save indexing options and
|
102 |
-
build the index". If everything's fine, you'll see the Relevanssi options screen again with a
|
103 |
message "Indexing successful!"
|
104 |
|
105 |
If something fails, usually the result is a blank screen. The most common problem is a timeout:
|
106 |
server ran out of time while indexing. The solution to that is simple: just return to Relevanssi
|
107 |
screen (do not just try to reload the blank page) and click "Continue indexing". Indexing will
|
108 |
continue. Most databases will get indexed in just few clicks of "Continue indexing". You can
|
109 |
-
follow the process in the "State of the Index": if the amount of documents is growing, the
|
110 |
indexing is moving along.
|
111 |
|
112 |
If the indexing gets stuck, something's wrong. I've had trouble with some plugins, for example
|
@@ -147,7 +147,7 @@ for example, won't work with Relevanssi.
|
|
147 |
|
148 |
Some plugins cause problems when indexing documents. These are generally plugins that use shortcodes
|
149 |
to do something somewhat complicated. One such plugin is [MapPress Easy Google Maps](http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/).
|
150 |
-
When indexing, you'll get a white screen. To fix the problem, disable either the offending plugin
|
151 |
or shortcode expansion in Relevanssi while indexing. After indexing, you can activate the plugin
|
152 |
again.
|
153 |
|
@@ -157,7 +157,7 @@ again.
|
|
157 |
You can find solutions and answers at the [Relevanssi Knowledge Base](http://www.relevanssi.com/category/knowledge-base/).
|
158 |
|
159 |
= Relevanssi doesn't work =
|
160 |
-
If you the results don't change after installing and activating Relevanssi, the most likely
|
161 |
reason is that you have a call to `query_posts()` on your search results template. This confuses
|
162 |
Relevanssi. Try removing the query_posts call and see what happens.
|
163 |
|
@@ -185,7 +185,7 @@ The various filtering methods work by listing either allowed or forbidden post i
|
|
185 |
query WHERE clause. Using the `relevanssi_where` hook you can add your own restrictions to
|
186 |
the WHERE clause.
|
187 |
|
188 |
-
These restrictions must be in the general format of
|
189 |
` AND doc IN (' . {a list of post ids, which could be a subquery} . ')`
|
190 |
|
191 |
For more details, see where the filter is applied in the `relevanssi_search()` function. This
|
@@ -194,7 +194,7 @@ WHERE clauses and it is possible to break the search results completely by doing
|
|
194 |
here.
|
195 |
|
196 |
There's another filter hook, `relevanssi_hits_filter`, which lets you modify the hits directly.
|
197 |
-
The filter passes an array, where index 0 gives the list of hits in the form of an array of
|
198 |
post objects and index 1 has the search query as a string. The filter expects you to return an
|
199 |
array containing the array of post objects in index 0 (`return array($your_processed_hit_array)`).
|
200 |
|
@@ -314,7 +314,7 @@ to get a widget that can execute PHP code.
|
|
314 |
|
315 |
= Restricting searches with taxonomies =
|
316 |
|
317 |
-
You can use taxonomies to restrict search results to posts and pages tagged with a certain
|
318 |
taxonomy term. If you have a custom taxonomy of "People" and want to search entries tagged
|
319 |
"John" in this taxonomy, just use `?s=keyword&people=John` in the URL. You should be able to use
|
320 |
an input field in the search form to do this, as well - just name the input field with the name
|
@@ -386,6 +386,14 @@ removing those words helps to make the index smaller and searching faster.
|
|
386 |
|
387 |
== Changelog ==
|
388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
= 3.5.3 =
|
390 |
* New filter `relevanssi_user_searches_limit` to adjust the number of user searches shown in the logs.
|
391 |
* Old data check is only done on Relevanssi settings page, not on all admin pages. That should improve admin performance.
|
@@ -401,7 +409,7 @@ removing those words helps to make the index smaller and searching faster.
|
|
401 |
* Fixed an error if the search term was not found in content.
|
402 |
* Fixed an error when building excerpts from posts shorter than the excerpt length.
|
403 |
* Blocked the `[starpro]` shortcode that was causing problems with Relevanssi.
|
404 |
-
* New filter: `relevanssi_remove_stopwords_in_titles` allows you to include stopwords in titles.
|
405 |
* Added support for `term_tax_id` in the `fields` parameter in tax_queries.
|
406 |
* Excerpt-building failed if multibyte string operations were missing. It should work now.
|
407 |
|
@@ -523,7 +531,7 @@ removing those words helps to make the index smaller and searching faster.
|
|
523 |
* Phrases are now matched to excerpts.
|
524 |
* Number of queries Relevanssi generates is much, much lower.
|
525 |
* New filter: `relevanssi_didyoumean_url` lets you modify the URL generated by the did you mean feature.
|
526 |
-
* Better set of Russian stopwords.
|
527 |
* Relevanssi now highlights search query synonyms as well in documents.
|
528 |
|
529 |
= 3.1.9 =
|
@@ -556,7 +564,7 @@ removing those words helps to make the index smaller and searching faster.
|
|
556 |
* When search included user profiles or taxonomy terms, Relevanssi would generate lots of MySQL errors. Not anymore.
|
557 |
* New filter: `relevanssi_valid_status` lets you modify the post statuses Relevanssi indexes.
|
558 |
* New filter: `relevanssi_index_taxonomies_args` lets you modify the arguments passed to get_terms() when indexing taxonomies (for example to set 'hide_empty' to false).
|
559 |
-
* Searching by taxonomy ID could confuse two taxonomies with the same term_id. The search is now checking the taxonomy as well to see it's correct.
|
560 |
* Basic support for Polylang plugin.
|
561 |
* Russian and Italian stopwords are now included, thanks to Flector and Valerio Vendrame.
|
562 |
* Small fix in the way user meta fields are handled.
|
@@ -1110,6 +1118,12 @@ removing those words helps to make the index smaller and searching faster.
|
|
1110 |
|
1111 |
== Upgrade notice ==
|
1112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1113 |
= 3.5.2 =
|
1114 |
* Small fix: Relevanssi now supports term_taxonomy_id parameter in tax_queries
|
1115 |
|
3 |
Donate link: http://www.relevanssi.com/buy-premium/
|
4 |
Tags: search, relevance, better search
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.6
|
7 |
+
Stable tag: 3.5.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
99 |
|
100 |
= How to index =
|
101 |
Check the options to make sure they're to your liking, then click "Save indexing options and
|
102 |
+
build the index". If everything's fine, you'll see the Relevanssi options screen again with a
|
103 |
message "Indexing successful!"
|
104 |
|
105 |
If something fails, usually the result is a blank screen. The most common problem is a timeout:
|
106 |
server ran out of time while indexing. The solution to that is simple: just return to Relevanssi
|
107 |
screen (do not just try to reload the blank page) and click "Continue indexing". Indexing will
|
108 |
continue. Most databases will get indexed in just few clicks of "Continue indexing". You can
|
109 |
+
follow the process in the "State of the Index": if the amount of documents is growing, the
|
110 |
indexing is moving along.
|
111 |
|
112 |
If the indexing gets stuck, something's wrong. I've had trouble with some plugins, for example
|
147 |
|
148 |
Some plugins cause problems when indexing documents. These are generally plugins that use shortcodes
|
149 |
to do something somewhat complicated. One such plugin is [MapPress Easy Google Maps](http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/).
|
150 |
+
When indexing, you'll get a white screen. To fix the problem, disable either the offending plugin
|
151 |
or shortcode expansion in Relevanssi while indexing. After indexing, you can activate the plugin
|
152 |
again.
|
153 |
|
157 |
You can find solutions and answers at the [Relevanssi Knowledge Base](http://www.relevanssi.com/category/knowledge-base/).
|
158 |
|
159 |
= Relevanssi doesn't work =
|
160 |
+
If you the results don't change after installing and activating Relevanssi, the most likely
|
161 |
reason is that you have a call to `query_posts()` on your search results template. This confuses
|
162 |
Relevanssi. Try removing the query_posts call and see what happens.
|
163 |
|
185 |
query WHERE clause. Using the `relevanssi_where` hook you can add your own restrictions to
|
186 |
the WHERE clause.
|
187 |
|
188 |
+
These restrictions must be in the general format of
|
189 |
` AND doc IN (' . {a list of post ids, which could be a subquery} . ')`
|
190 |
|
191 |
For more details, see where the filter is applied in the `relevanssi_search()` function. This
|
194 |
here.
|
195 |
|
196 |
There's another filter hook, `relevanssi_hits_filter`, which lets you modify the hits directly.
|
197 |
+
The filter passes an array, where index 0 gives the list of hits in the form of an array of
|
198 |
post objects and index 1 has the search query as a string. The filter expects you to return an
|
199 |
array containing the array of post objects in index 0 (`return array($your_processed_hit_array)`).
|
200 |
|
314 |
|
315 |
= Restricting searches with taxonomies =
|
316 |
|
317 |
+
You can use taxonomies to restrict search results to posts and pages tagged with a certain
|
318 |
taxonomy term. If you have a custom taxonomy of "People" and want to search entries tagged
|
319 |
"John" in this taxonomy, just use `?s=keyword&people=John` in the URL. You should be able to use
|
320 |
an input field in the search form to do this, as well - just name the input field with the name
|
386 |
|
387 |
== Changelog ==
|
388 |
|
389 |
+
= 3.5.4 =
|
390 |
+
* Relevanssi had a bug that lead to inflated relevancy scores for posts.
|
391 |
+
* Relevanssi can now index the human-readable labels of ACF "select" fields. (Thanks to Raphaël Droz.)
|
392 |
+
* New filter: `relevanssi_30days` can be used to adjust the 30 day logs to a different number of days.
|
393 |
+
* Adding stopwords that contain apostrophes didn't work.
|
394 |
+
* Ensured PHP7 and WP 4.6 compatibility.
|
395 |
+
* Fixed a small glitch that could happen if a highlighted term is next to a starting square bracket.
|
396 |
+
|
397 |
= 3.5.3 =
|
398 |
* New filter `relevanssi_user_searches_limit` to adjust the number of user searches shown in the logs.
|
399 |
* Old data check is only done on Relevanssi settings page, not on all admin pages. That should improve admin performance.
|
409 |
* Fixed an error if the search term was not found in content.
|
410 |
* Fixed an error when building excerpts from posts shorter than the excerpt length.
|
411 |
* Blocked the `[starpro]` shortcode that was causing problems with Relevanssi.
|
412 |
+
* New filter: `relevanssi_remove_stopwords_in_titles` allows you to include stopwords in titles.
|
413 |
* Added support for `term_tax_id` in the `fields` parameter in tax_queries.
|
414 |
* Excerpt-building failed if multibyte string operations were missing. It should work now.
|
415 |
|
531 |
* Phrases are now matched to excerpts.
|
532 |
* Number of queries Relevanssi generates is much, much lower.
|
533 |
* New filter: `relevanssi_didyoumean_url` lets you modify the URL generated by the did you mean feature.
|
534 |
+
* Better set of Russian stopwords.
|
535 |
* Relevanssi now highlights search query synonyms as well in documents.
|
536 |
|
537 |
= 3.1.9 =
|
564 |
* When search included user profiles or taxonomy terms, Relevanssi would generate lots of MySQL errors. Not anymore.
|
565 |
* New filter: `relevanssi_valid_status` lets you modify the post statuses Relevanssi indexes.
|
566 |
* New filter: `relevanssi_index_taxonomies_args` lets you modify the arguments passed to get_terms() when indexing taxonomies (for example to set 'hide_empty' to false).
|
567 |
+
* Searching by taxonomy ID could confuse two taxonomies with the same term_id. The search is now checking the taxonomy as well to see it's correct.
|
568 |
* Basic support for Polylang plugin.
|
569 |
* Russian and Italian stopwords are now included, thanks to Flector and Valerio Vendrame.
|
570 |
* Small fix in the way user meta fields are handled.
|
1118 |
|
1119 |
== Upgrade notice ==
|
1120 |
|
1121 |
+
= 3.5.4 =
|
1122 |
+
* Fix for a small bug that leads to inflated relevancy scores.
|
1123 |
+
|
1124 |
+
= 3.5.3 =
|
1125 |
+
* New filters and a fix for a fatal error.
|
1126 |
+
|
1127 |
= 3.5.2 =
|
1128 |
* Small fix: Relevanssi now supports term_taxonomy_id parameter in tax_queries
|
1129 |
|
relevanssi-de_DE.mo
CHANGED
Binary file
|
relevanssi-de_DE.po
CHANGED
@@ -3,986 +3,959 @@ msgstr ""
|
|
3 |
"Project-Id-Version: Relevanssi v3.1.8\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: \n"
|
6 |
-
"PO-Revision-Date:
|
7 |
-
"Last-Translator:
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
-
"X-Generator:
|
14 |
-
"X-Poedit-Language: German\n"
|
15 |
-
"X-Poedit-Country: GERMANY\n"
|
16 |
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
-
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2
|
18 |
-
"X-
|
19 |
-
"
|
20 |
"X-Poedit-SearchPath-0: .\n"
|
21 |
-
"X-Textdomain-Support: yes"
|
22 |
|
|
|
23 |
#: lib/excerpts-highlights.php:11
|
24 |
-
#@ default
|
25 |
msgid "There is no excerpt because this is a protected post."
|
26 |
msgstr "Es gibt keinen Auszug, da dies eine geschütze Seite ist."
|
27 |
|
|
|
28 |
#: lib/init.php:40
|
29 |
#, php-format
|
30 |
-
#@ default
|
31 |
msgid ""
|
32 |
"Relevanssi needs attention: Remember to build the index (you can do it at <a href=\"%1$s\">the\n"
|
33 |
"\t\t\t settings page</a>), otherwise searching won't work."
|
34 |
msgstr "Relevanssi benötigt Ihre Aufmerksamkeit. Bitte denken Sie daran, den Index aufzubauen. (Unter <a href=\"%1$s\">Einstellungen</a>). Andernfalls funktioniert die Suche nicht."
|
35 |
|
36 |
-
|
37 |
-
#: lib/init.php:85
|
38 |
-
#@ relevanssi
|
39 |
msgid "User searches"
|
40 |
msgstr "Suchanfragen"
|
41 |
|
|
|
42 |
#: lib/interface.php:6
|
43 |
-
#@ relevanssi
|
44 |
msgid "Relevanssi Premium Search Options"
|
45 |
msgstr "Relevanssi Premium Such-Einstellungen"
|
46 |
|
|
|
47 |
#: lib/interface.php:9
|
48 |
-
#@ relevanssi
|
49 |
msgid "Relevanssi Search Options"
|
50 |
msgstr "Relevanssi Such-Einstellungen"
|
51 |
|
|
|
52 |
#: lib/interface.php:86
|
53 |
-
#@ relevanssi
|
54 |
msgid "User Searches"
|
55 |
msgstr "Suchanfragen"
|
56 |
|
|
|
57 |
#: lib/interface.php:88
|
58 |
-
#@ relevanssi
|
59 |
msgid "Relevanssi User Searches"
|
60 |
msgstr "Relevanssi Suchanfragen"
|
61 |
|
|
|
62 |
#: lib/interface.php:335
|
63 |
#, php-format
|
64 |
-
#@ relevanssi
|
65 |
msgid "<div id='message' class='updated fade'><p>Successfully added %d/%d terms to stopwords!</p></div>"
|
66 |
msgstr "<div id='message' class='updated fade'><p>%d/%d erfolgreich zur Stoppwort-Liste hinzugefügt!</p></div>"
|
67 |
|
|
|
68 |
#: lib/interface.php:342
|
69 |
#, php-format
|
70 |
-
#@ relevanssi
|
71 |
msgid "<div id='message' class='updated fade'><p>Term '%s' added to stopwords!</p></div>"
|
72 |
msgstr "<div id='message' class='updated fade'><p>Begriff '%s' zur Stoppwort-Liste hinzugefügt!</p></div>"
|
73 |
|
|
|
74 |
#: lib/interface.php:345
|
75 |
#, php-format
|
76 |
-
#@ relevanssi
|
77 |
msgid "<div id='message' class='updated fade'><p>Couldn't add term '%s' to stopwords!</p></div>"
|
78 |
msgstr "<div id='message' class='updated fade'><p>Konnte Begriff '%s' nicht zur Stoppwort-Liste hinzufügen!</p></div>"
|
79 |
|
|
|
80 |
#: lib/interface.php:374
|
81 |
-
#@ relevanssi
|
82 |
msgid "<div id='message' class='updated fade'><p>Stopwords removed! Remember to re-index.</p></div>"
|
83 |
msgstr "<div id='message' class='updated fade'><p>Stoppwörter entfernt! Bitte den Index neu erstellen.</p></div>"
|
84 |
|
|
|
85 |
#: lib/interface.php:384
|
86 |
#, php-format
|
87 |
-
#@ relevanssi
|
88 |
msgid "<div id='message' class='updated fade'><p>Term '%s' removed from stopwords! Re-index to get it back to index.</p></div>"
|
89 |
msgstr "<div id='message' class='updated fade'><p>Begriff '%s' aus aus der Stoppwort-Liste entfernt! Bitte den Index neu erstellen, um es in den Suchindex aufzunehmen.</p></div>"
|
90 |
|
|
|
91 |
#: lib/interface.php:387
|
92 |
#, php-format
|
93 |
-
#@ relevanssi
|
94 |
msgid "<div id='message' class='updated fade'><p>Couldn't remove term '%s' from stopwords!</p></div>"
|
95 |
msgstr "<div id='message' class='updated fade'><p>Konnte Begriff '%s' nicht aus der Stoppwort-Liste entfernen!</p></div>"
|
96 |
|
|
|
97 |
#: lib/interface.php:398
|
98 |
-
#@ relevanssi
|
99 |
msgid "25 most common words in the index"
|
100 |
msgstr "Die 25 häufigsten Begriffe im Index"
|
101 |
|
|
|
102 |
#: lib/interface.php:400
|
103 |
-
#@ relevanssi
|
104 |
msgid "These words are excellent stopword material. A word that appears in most of the posts in the database is quite pointless when searching. This is also an easy way to create a completely new stopword list, if one isn't available in your language. Click the icon after the word to add the word to the stopword list. The word will also be removed from the index, so rebuilding the index is not necessary."
|
105 |
msgstr "Diese Wörter bilden hervorragendes Stoppwort-Material. Ein Wort, das auf den meisten Ihrer Seiten erscheint, ist für die Suche nutzlos. Auf diese Weise können Sie außerdem eine neue Stoppwort-Liste erstellen, falls in Ihrer Sprache keine solche Liste vorhanden ist. Klicken Sie auf das Icon hinter dem Wort um ein Wort in die Stoppwort-Liste aufzunehmen. Das Wort wird danach auch aus dem Index entfernt, daher müssen Sie den Such-Index nicht neu erstellen."
|
106 |
|
|
|
107 |
#: lib/interface.php:426
|
108 |
-
#@ relevanssi
|
109 |
msgid "Add to stopwords"
|
110 |
msgstr "Zu den Stoppwörtern hinzufügen"
|
111 |
|
|
|
112 |
#: lib/interface.php:437
|
113 |
-
#@ relevanssi
|
114 |
msgid "Total Searches"
|
115 |
msgstr "Alle Suchanfragen"
|
116 |
|
|
|
117 |
#: lib/interface.php:440
|
118 |
-
#@ relevanssi
|
119 |
msgid "Totals"
|
120 |
msgstr "Summe"
|
121 |
|
|
|
122 |
#: lib/interface.php:445
|
123 |
-
#@ relevanssi
|
124 |
msgid "Common Queries"
|
125 |
msgstr "Häufige Suchbegriffe"
|
126 |
|
|
|
127 |
#: lib/interface.php:447
|
128 |
-
#@ relevanssi
|
129 |
msgid ""
|
130 |
"Here you can see the 20 most common user search queries, how many times those \n"
|
131 |
"\t\tqueries were made and how many results were found for those queries."
|
132 |
msgstr "Hier sehen Sie die 20 häufigsten Suchanfragen Ihrer Besucher, wie oft diese ausgeführt wurden, und wieviele Ergebnisse dafür gefunden wurden."
|
133 |
|
134 |
-
|
135 |
-
#: lib/interface.php:469
|
136 |
-
#: lib/interface.php:501
|
137 |
-
#@ relevanssi
|
138 |
msgid "Today and yesterday"
|
139 |
msgstr "Heute und gestern"
|
140 |
|
141 |
-
|
142 |
-
#: lib/interface.php:473
|
143 |
-
#: lib/interface.php:502
|
144 |
-
#@ relevanssi
|
145 |
msgid "Last 7 days"
|
146 |
msgstr "Die letzten 7 Tage"
|
147 |
|
148 |
-
|
149 |
-
#: lib/interface.php:477
|
150 |
-
#: lib/interface.php:503
|
151 |
-
#@ relevanssi
|
152 |
msgid "Last 30 days"
|
153 |
msgstr "Die letzten 30 Tage"
|
154 |
|
|
|
155 |
#: lib/interface.php:466
|
156 |
-
#@ relevanssi
|
157 |
msgid "Unsuccessful Queries"
|
158 |
msgstr "Erfolglose Suchanfragen"
|
159 |
|
|
|
160 |
#: lib/interface.php:484
|
161 |
-
#@ relevanssi
|
162 |
msgid "Reset Logs"
|
163 |
msgstr "Protokoll zurücksetzen"
|
164 |
|
|
|
165 |
#: lib/interface.php:487
|
166 |
#, php-format
|
167 |
-
#@ relevanssi
|
168 |
msgid "To reset the logs, type \"reset\" into the box here %s and click %s"
|
169 |
msgstr "Zum Zurücksetzen der Protokolle bitte \"reset\" in dieses Textfeld %s eintragen und %s klicken."
|
170 |
|
|
|
171 |
#: lib/interface.php:504
|
172 |
-
#@ relevanssi
|
173 |
msgid "Forever"
|
174 |
msgstr "Für immer"
|
175 |
|
|
|
176 |
#: lib/interface.php:506
|
177 |
-
#@ relevanssi
|
178 |
msgid "When"
|
179 |
msgstr "Wenn"
|
180 |
|
|
|
181 |
#: lib/interface.php:506
|
182 |
-
#@ relevanssi
|
183 |
msgid "Searches"
|
184 |
msgstr "Suchanfragen"
|
185 |
|
|
|
186 |
#: lib/interface.php:536
|
187 |
-
#@ relevanssi
|
188 |
msgid "Query"
|
189 |
msgstr "Suchanfrage"
|
190 |
|
|
|
191 |
#: lib/interface.php:536
|
192 |
-
#@ relevanssi
|
193 |
msgid "Hits"
|
194 |
msgstr "Treffer"
|
195 |
|
196 |
-
|
197 |
-
#: lib/interface.php:891
|
198 |
-
#@ relevanssi
|
199 |
msgid "Basic options"
|
200 |
msgstr "Grundeinstellungen"
|
201 |
|
202 |
-
|
203 |
-
#: lib/interface.php:957
|
204 |
-
#@ relevanssi
|
205 |
msgid "Weights"
|
206 |
msgstr "Gewichtungen"
|
207 |
|
208 |
-
|
209 |
-
#: lib/interface.php:1012
|
210 |
-
#@ relevanssi
|
211 |
msgid "Logs"
|
212 |
msgstr "Protokolle"
|
213 |
|
214 |
-
|
215 |
-
#: lib/interface.php:1041
|
216 |
-
#@ relevanssi
|
217 |
msgid "Exclusions and restrictions"
|
218 |
msgstr "Ausschließen oder Beschränkungen"
|
219 |
|
|
|
220 |
#: lib/interface.php:850
|
221 |
-
#@ relevanssi
|
222 |
msgid "Custom excerpts"
|
223 |
msgstr "Eigene Zusammenfassungen"
|
224 |
|
|
|
225 |
#: lib/interface.php:851
|
226 |
-
#@ relevanssi
|
227 |
msgid "Highlighting search results"
|
228 |
msgstr "Suchbegriffe hervorheben"
|
229 |
|
230 |
-
|
231 |
-
#: lib/interface.php:1187
|
232 |
-
#@ relevanssi
|
233 |
msgid "Indexing options"
|
234 |
msgstr "Indizierungs-Einstellungen"
|
235 |
|
236 |
-
|
237 |
-
#: lib/interface.php:1335
|
238 |
-
#@ relevanssi
|
239 |
msgid "Caching"
|
240 |
msgstr "Cache"
|
241 |
|
242 |
-
|
243 |
-
#: lib/interface.php:1358
|
244 |
-
#@ relevanssi
|
245 |
msgid "Synonyms"
|
246 |
msgstr "Synonyme"
|
247 |
|
248 |
-
|
249 |
-
#: lib/interface.php:1366
|
250 |
-
#@ relevanssi
|
251 |
msgid "Stopwords"
|
252 |
msgstr "Stoppwörter"
|
253 |
|
|
|
254 |
#: lib/interface.php:858
|
255 |
-
#@ relevanssi
|
256 |
msgid "Import/export options"
|
257 |
msgstr "Einstellungen importieren/exportieren"
|
258 |
|
|
|
259 |
#: lib/interface.php:861
|
260 |
-
#@ relevanssi
|
261 |
msgid "Buy Relevanssi Premium"
|
262 |
msgstr "Relevanssi Premium kaufen"
|
263 |
|
|
|
264 |
#: lib/interface.php:866
|
265 |
-
#@ relevanssi
|
266 |
msgid "Quick tools"
|
267 |
msgstr "Quick tools"
|
268 |
|
|
|
269 |
#: lib/interface.php:868
|
270 |
-
#@ relevanssi
|
271 |
msgid "Save options"
|
272 |
msgstr "Einstellungen sichern"
|
273 |
|
|
|
274 |
#: lib/interface.php:869
|
275 |
-
#@ relevanssi
|
276 |
msgid "Build the index"
|
277 |
msgstr "Index aufbauen"
|
278 |
|
279 |
-
|
280 |
-
#: lib/interface.php:1333
|
281 |
-
#@ relevanssi
|
282 |
msgid "Continue indexing"
|
283 |
msgstr "Weiter indizieren"
|
284 |
|
|
|
285 |
#: lib/interface.php:870
|
286 |
-
#@ relevanssi
|
287 |
msgid "add"
|
288 |
msgstr "hinzufügen"
|
289 |
|
|
|
290 |
#: lib/interface.php:870
|
291 |
-
#@ relevanssi
|
292 |
msgid "documents."
|
293 |
msgstr "Dokumente."
|
294 |
|
|
|
295 |
#: lib/interface.php:874
|
296 |
-
#@ relevanssi
|
297 |
msgid "WARNING: You've chosen no post types to index. Nothing will be indexed. <a href='#indexing'>Choose some post types to index</a>."
|
298 |
msgstr "WARNUNG: Sie haben keine Post-Typen für die Indizierung bestimmt. Es wird nichts indiziert werden. <a href='#indexing'>Wählen Sie ein paar Post-Typen aus.</a>."
|
299 |
|
|
|
300 |
#: lib/interface.php:878
|
301 |
-
#@ relevanssi
|
302 |
msgid "Use 'Build the index' to build the index with current <a href='#indexing'>indexing options</a>. If you can't finish indexing with one go, use 'Continue indexing' to finish the job. You can change the number of documents to add until you find the largest amount you can add with one go. See 'State of the Index' below to find out how many documents actually go into the index."
|
303 |
msgstr "Klicken Sie 'Index aufbauen' um den Index mit den derzeitigen <a href='#indexing'>Index-Einstellungen</a> zu erzeugen. Wenn es nicht auf Anhieb funktioniert, klicken Sie 'Weiter indizieren' um den Vorgang abzuschließen. Erhöhen Sie die Anzahl der Dokumente bis Sie die größte Anzahl an Dokumenten erreichte haben, die Sie in einem Zug indizieren können. Sehen Sie auch bei 'Zustand des Index' weiter unten nach, um herauszufinden, wie viele Dokumente sich gegenwärtig im Index befinden."
|
304 |
|
|
|
305 |
#: lib/interface.php:880
|
306 |
-
#@ relevanssi
|
307 |
msgid ""
|
308 |
"If Relevanssi doesn't index anything and you have upgraded from a 2.x version, it's likely the changes in\n"
|
309 |
"\tthe database structure haven't gone through in the upgrade. In that case all you need to do is to deactivate the\n"
|
310 |
"\tplugin and then activate it again."
|
311 |
msgstr "Falls Relevanssi nichts indiziert und Sie von einer 2.x-Version upgedated haben, sind wahrscheinlich die Änderungen in der Datenbank nicht durch das Update gegangen. In diesem Fall genügt es, wenn Sie das Plugin einmal deaktivieren, und anschließend wieder aktivieren."
|
312 |
|
|
|
313 |
#: lib/interface.php:884
|
314 |
-
#@ relevanssi
|
315 |
msgid "State of the Index"
|
316 |
msgstr "Zustand des Index"
|
317 |
|
|
|
318 |
#: lib/interface.php:886
|
319 |
-
#@ relevanssi
|
320 |
msgid "Documents in the index"
|
321 |
msgstr "Dokumente im Index"
|
322 |
|
|
|
323 |
#: lib/interface.php:887
|
324 |
-
#@ relevanssi
|
325 |
msgid "Terms in the index"
|
326 |
msgstr "Suchbegriffe im Index"
|
327 |
|
|
|
328 |
#: lib/interface.php:888
|
329 |
-
#@ relevanssi
|
330 |
msgid "Highest post ID indexed"
|
331 |
msgstr "Höchste indizierte Post-ID"
|
332 |
|
|
|
333 |
#: lib/interface.php:897
|
334 |
-
#@ relevanssi
|
335 |
msgid "Use search for admin:"
|
336 |
msgstr "Suchen im Admin-Bereich"
|
337 |
|
|
|
338 |
#: lib/interface.php:899
|
339 |
-
#@ relevanssi
|
340 |
msgid "If checked, Relevanssi will be used for searches in the admin interface"
|
341 |
msgstr "Wenn aktiviert, wird Relevanssi auch für die Suche innerhalb des Admin-Bereichs verwendet."
|
342 |
|
|
|
343 |
#: lib/interface.php:903
|
344 |
-
#@ relevanssi
|
345 |
msgid "Default operator for the search?"
|
346 |
msgstr "Standard-Operator für Suchanfragen?"
|
347 |
|
|
|
348 |
#: lib/interface.php:905
|
349 |
-
#@ relevanssi
|
350 |
msgid "AND - require all terms"
|
351 |
msgstr "AND – Alle Begriffe müssen vorkommen"
|
352 |
|
|
|
353 |
#: lib/interface.php:906
|
354 |
-
#@ relevanssi
|
355 |
msgid "OR - any term present is enough"
|
356 |
msgstr "OR – einer der Begriffe muß vorkommen"
|
357 |
|
|
|
358 |
#: lib/interface.php:908
|
359 |
-
#@ relevanssi
|
360 |
msgid "If you choose AND and the search finds no matches, it will automatically do an OR search."
|
361 |
msgstr "Wenn AND ausgewählt ist, und die Suche ergibt keine Treffer, wird automatisch auf OR umgeschaltet."
|
362 |
|
|
|
363 |
#: lib/interface.php:912
|
364 |
-
#@ relevanssi
|
365 |
msgid "Disable OR fallback:"
|
366 |
msgstr "OR-Fallback deaktivieren"
|
367 |
|
|
|
368 |
#: lib/interface.php:914
|
369 |
-
#@ relevanssi
|
370 |
msgid "If you don't want Relevanssi to fall back to OR search when AND search gets no hits, check this option. For most cases, leave this one unchecked."
|
371 |
msgstr "Wenn Sie nicht möchten, das bei einer erfolglosen AND-Suche auf OR zurückgegriffen wird, aktivieren Sie diese Option. In den meisten Fällen sollten Sie diese Option deaktiviert lassen."
|
372 |
|
|
|
373 |
#: lib/interface.php:918
|
374 |
-
#@ relevanssi
|
375 |
msgid "Default order for results:"
|
376 |
msgstr "Standard-Reihenfolge für Suchergebnisse:"
|
377 |
|
|
|
378 |
#: lib/interface.php:920
|
379 |
-
#@ relevanssi
|
380 |
msgid "Relevance (highly recommended)"
|
381 |
msgstr "Relevanz (Hochgradig empfohlen)"
|
382 |
|
|
|
383 |
#: lib/interface.php:921
|
384 |
-
#@ relevanssi
|
385 |
msgid "Post date"
|
386 |
msgstr "Datum des Beitrags"
|
387 |
|
|
|
388 |
#: lib/interface.php:923
|
389 |
-
#@ relevanssi
|
390 |
msgid "If you want date-based results, see the recent post bonus in the Weights section."
|
391 |
msgstr "Bei Datums-Basierten Suchergebnissen, see the recent post bonus im Abschnitt 'Gewichtung'."
|
392 |
|
|
|
393 |
#: lib/interface.php:927
|
394 |
-
#@ relevanssi
|
395 |
msgid "When to use fuzzy matching?"
|
396 |
msgstr "Wann sollen unscharfe Vergleiche benutzt werden?"
|
397 |
|
|
|
398 |
#: lib/interface.php:929
|
399 |
-
#@ relevanssi
|
400 |
msgid "When straight search gets no hits"
|
401 |
msgstr "Wenn die normale Suche keine Treffer ausgibt"
|
402 |
|
|
|
403 |
#: lib/interface.php:930
|
404 |
-
#@ relevanssi
|
405 |
msgid "Always"
|
406 |
msgstr "Immer"
|
407 |
|
|
|
408 |
#: lib/interface.php:931
|
409 |
-
#@ relevanssi
|
410 |
msgid "Don't use fuzzy search"
|
411 |
msgstr "Unscharfe Vergleiche nicht verwenden"
|
412 |
|
|
|
413 |
#: lib/interface.php:933
|
414 |
-
#@ relevanssi
|
415 |
msgid "Straight search matches just the term. Fuzzy search matches everything that begins or ends with the search term."
|
416 |
msgstr "Die normale Suche sucht nur nach direkten Übereinstimmungen mit dem Suchbegriff. Die unscharfe Suche findet alles, was mit dem Suchbegriff beginnt oder endet."
|
417 |
|
|
|
418 |
#: lib/interface.php:941
|
419 |
-
#@ relevanssi
|
420 |
msgid "Limit searches:"
|
421 |
msgstr "Suchergebnisse begrenzen:"
|
422 |
|
|
|
423 |
#: lib/interface.php:943
|
424 |
-
#@ relevanssi
|
425 |
msgid "If this option is checked, Relevanssi will limit search results to at most 500 results per term. This will improve performance, but may cause some relevant documents to go unfound. However, Relevanssi tries to prioritize the most relevant documents. <strong>This does not work well when sorting results by date.</strong> The throttle can end up cutting off recent posts to favour more relevant posts."
|
426 |
msgstr "Wenn diese Option aktiviert ist, wird Relevanssi die Suchergebnisse auf 500 Treffer pro Suchbegriff begrenzen. Dadurch wird die Leistungsfähigkeit verbessert, kann aber dazu führen, dass einige Relevante Dokumente nicht gefunden werden. Relevanssi wird trotzdem versuchen, die relevantesten Dokumente zu priorisieren. <strong>Dies funktioniert aber nicht besonders gut bei Sortierung nach Datum,</strong> und kann dazu führen dass neuere Dokumente zugunsten relevanterer Dokumente ausgelassen werden."
|
427 |
|
|
|
428 |
#: lib/interface.php:947
|
429 |
-
#@ relevanssi
|
430 |
msgid "Limit:"
|
431 |
msgstr "Begrenzung:"
|
432 |
|
|
|
433 |
#: lib/interface.php:949
|
434 |
-
#@ relevanssi
|
435 |
msgid "For better performance, adjust the limit to a smaller number. Adjusting the limit to 100 - or even lower - should be safe for good results, and might bring a boost in search speed."
|
436 |
msgstr "Zur Erhöhung der Leistungsfähigkeit tragen Sie einer kleinere Zahl ein. Ein Limit von 100 oder weniger sollte noch immer gute Suchergebnisse bringen und die Effizienz einer Suche deutlich erhöhen."
|
437 |
|
|
|
438 |
#: lib/interface.php:959
|
439 |
-
#@ relevanssi
|
440 |
msgid "These values affect the weights of the documents. These are all multipliers, so 1 means no change in weight, less than 1 means less weight, and more than 1 means more weight. Setting something to zero makes that worthless. For example, if title weight is more than 1, words in titles are more significant than words elsewhere. If title weight is 0, words in titles won't make any difference to the search results."
|
441 |
msgstr "Diese Werte betreffen die Gewichtung von Dokumenten. Es sind Faktoren, 1 bedeutet keine Änderung in der Gewichtung, weniger als 1 hat eine geringere Gewichtung zur Folge und mehr als 1 eine höhere. Null macht das Element irrelevant bei der Gewichtung. Wenn zum Beispiel die Gewichtung des Titels mehr als 1 beträgt, dann werden Suchwörter die im Titel auftauchen als aussagekräftiger angesehen als wenn die Wörter woanders auftauche würden. Wenn die Gewichtung des Titels 0 ist, haben Suchbegriffe im Titel keinerlei Auswirkung auf die Gewichtung der Suchergebnisse."
|
442 |
|
|
|
443 |
#: lib/interface.php:964
|
444 |
-
#@ relevanssi
|
445 |
msgid "Element"
|
446 |
msgstr "Element"
|
447 |
|
|
|
448 |
#: lib/interface.php:965
|
449 |
-
#@ relevanssi
|
450 |
msgid "Weight"
|
451 |
msgstr "Gewichtung"
|
452 |
|
|
|
453 |
#: lib/interface.php:966
|
454 |
-
#@ relevanssi
|
455 |
msgid "Default weight"
|
456 |
msgstr "Standard Gewichtung"
|
457 |
|
|
|
458 |
#: lib/interface.php:971
|
459 |
-
#@ relevanssi
|
460 |
msgid "Post titles"
|
461 |
msgstr "Beitrags-Titel"
|
462 |
|
|
|
463 |
#: lib/interface.php:983
|
464 |
-
#@ relevanssi
|
465 |
msgid "Comment text"
|
466 |
msgstr "Kommentar-Texte"
|
467 |
|
|
|
468 |
#: lib/interface.php:1006
|
469 |
-
#@ relevanssi
|
470 |
msgid "Limit results to current language:"
|
471 |
msgstr "Resultate nur auf die gegenwärtige Sprache einschränken"
|
472 |
|
|
|
473 |
#: lib/interface.php:1008
|
474 |
-
#@ relevanssi
|
475 |
msgid "If this option is checked, Relevanssi will only return results in the current active language. Otherwise results will include posts in every language."
|
476 |
msgstr "Wenn diese Option aktiviert ist, zeigt Relevanssi nur Ergebnisse in der aktuell gewählten Sprache an. Andernfalls werden Resultate in allen Sprachen angezeigt."
|
477 |
|
|
|
478 |
#: lib/interface.php:1014
|
479 |
-
#@ relevanssi
|
480 |
msgid "Keep a log of user queries:"
|
481 |
msgstr "Suchanfragen der Besucher protokollieren:"
|
482 |
|
|
|
483 |
#: lib/interface.php:1016
|
484 |
-
#@ relevanssi
|
485 |
msgid "If checked, Relevanssi will log user queries. The log appears in 'User searches' on the Dashboard admin menu."
|
486 |
msgstr "Wenn aktiviert wird Relevanssi die Such-Anfragen Ihrer Besucher protokollieren. Das Protokoll finden Sie unter 'Suchanfragen' im Administrations-Menu Ihres Dashboards. "
|
487 |
|
|
|
488 |
#: lib/interface.php:1020
|
489 |
-
#@ relevanssi
|
490 |
msgid "Log the user's IP with the queries:"
|
491 |
msgstr "Die IP-Adresse der Besucher ebenfalls Protokollieren:"
|
492 |
|
|
|
493 |
#: lib/interface.php:1022
|
494 |
-
#@ relevanssi
|
495 |
msgid "If checked, Relevanssi will log user's IP-Adress with the queries."
|
496 |
msgstr "Wenn aktiviert, speichert Relevanssi die IP-Adressen Ihrer Besucher zusammen mit den Suchanfragen. (Diese Option verstößt gegen mehrere Datenschutzrichtlinien, Sie sollten sie nicht aktivieren)"
|
497 |
|
|
|
498 |
#: lib/interface.php:1026
|
499 |
-
#@ relevanssi
|
500 |
msgid "Don't log queries from these users:"
|
501 |
msgstr "Suchanfragen von diesen Benutzern nicht protokollieren:"
|
502 |
|
|
|
503 |
#: lib/interface.php:1028
|
504 |
-
#@ relevanssi
|
505 |
msgid "Comma-separated list of numeric user IDs or user login names that will not be logged."
|
506 |
msgstr "Komma-getrennte Liste mit numerischen IDs oder Login-Namen der Benutzer, die nicht Protokolliert werden sollen. "
|
507 |
|
|
|
508 |
#: lib/interface.php:1032
|
509 |
-
#@ relevanssi
|
510 |
msgid "If you enable logs, you can see what your users are searching for. You can prevent your own searches from getting in the logs with the omit feature."
|
511 |
msgstr "Durch die Protokollierung können Sie einsehen, was Ihre Besucher auf Ihrer Seite suchen. Durch die Eingabe 'Suchanfragen von...' können Sie Suchanfragen Ihrer eigenen Benutzer von der Protokollierung ausnehmen."
|
512 |
|
|
|
513 |
#: lib/interface.php:1035
|
514 |
-
#@ relevanssi
|
515 |
msgid "If you enable logs, you can see what your users are searching for. Logs are also needed to use the 'Did you mean?' feature. You can prevent your own searches from getting in the logs with the omit feature."
|
516 |
msgstr "Durch die Protokollierung können Sie einsehen, was Ihre Besucher auf Ihrer Seite suchen. Die Protokolle werden ebenso für die 'meinten Sie vielleicht'-Funktion benötigt. Durch die Eingabe 'Suchanfragen von...' können Sie Suchanfragen Ihrer eigenen Benutzer von der Protokollierung ausnehmen."
|
517 |
|
|
|
518 |
#: lib/interface.php:1043
|
519 |
-
#@ relevanssi
|
520 |
msgid "Restrict search to these categories and tags:"
|
521 |
msgstr "Suche nur in diesen Kategorien und Schlagwörtern:"
|
522 |
|
|
|
523 |
#: lib/interface.php:1045
|
524 |
-
#@ relevanssi
|
525 |
msgid "Enter a comma-separated list of category and tag IDs to restrict search to those categories or tags. You can also use <code><input type='hidden' name='cats' value='list of cats and tags' /></code> in your search form. The input field will \toverrun this setting."
|
526 |
msgstr "Tragen Sie eine Komma-getrennte Liste der numerischen Kategorie- oder Schlagwort-IDs ein, auf die Sie die Suche einschränken wollen. Sie können auch <code><input type='hidden' name='cats' value='Liste der Kategorien und Schlagwörter' /></code> in Ihr Suchformular einfügen. Das Eingabefeld wird die hier getätigten Einstelllungen überschreiben."
|
527 |
|
|
|
528 |
#: lib/interface.php:1049
|
529 |
-
#@ relevanssi
|
530 |
msgid "Exclude these categories and tags from search:"
|
531 |
msgstr "Diese Kategorien und Schlagwörter aus der Suche ausschließen:"
|
532 |
|
|
|
533 |
#: lib/interface.php:1051
|
534 |
-
#@ relevanssi
|
535 |
msgid "Enter a comma-separated list of category and tag IDs that are excluded from search results. You can exclude categories with the 'cat' input field by using negative values."
|
536 |
msgstr "Tragen Sie eine Komma-getrennte Liste der numerischen Kategorie- oder Schlagwort-IDs ein, die aus der Suche ausgeschlossen werden sollen. Sie können Kategorien auch durch negative IDs unter 'Suche nur in …' ausschließen."
|
537 |
|
|
|
538 |
#: lib/interface.php:1055
|
539 |
-
#@ relevanssi
|
540 |
msgid "Exclude these posts/pages from search:"
|
541 |
msgstr "Diese Beiträge / Seiten aus der Suche ausschließen:"
|
542 |
|
|
|
543 |
#: lib/interface.php:1059
|
544 |
-
#@ relevanssi
|
545 |
msgid "Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there). You can also use a checkbox on post/page edit pages to remove posts from index."
|
546 |
msgstr "Komma-getrennte Liste von numerischen Seiten- / Beitrags-IDs, die von der Suche ausgenommen werden sollen. Sie können auch die Checkbox beim Bearbeiten eines Beitrags / einer Seite benutzen um Dokumente aus dem Suchindex auszuschließen."
|
547 |
|
|
|
548 |
#: lib/interface.php:1062
|
549 |
-
#@ relevanssi
|
550 |
msgid "Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there)."
|
551 |
msgstr "Komma-Separierte Liste von numerischen Seiten- / Beitrags-IDs, die von der Suche ausgenommen werden sollen."
|
552 |
|
|
|
553 |
#: lib/interface.php:1068
|
554 |
-
#@ relevanssi
|
555 |
msgid "Respect exclude_from_search for custom post types:"
|
556 |
msgstr "exclude_from_search auch auf Benutzerdefinierte Beiträge anwenden:"
|
557 |
|
|
|
558 |
#: lib/interface.php:1070
|
559 |
-
#@ relevanssi
|
560 |
msgid "If checked, Relevanssi won't display posts of custom post types that have 'exclude_from_search' set to true. If not checked, Relevanssi will display anything that is indexed."
|
561 |
msgstr "Wenn aktiviert wird Relevanssi keine Benutzerdefinierten Betrags-Typen anzeigen, bei denen exclude_from_search auf true gesetzt ist. Andernfalls zeigt Relevanssi alles an, was indiziert worden ist."
|
562 |
|
|
|
563 |
#: lib/interface.php:1072
|
564 |
-
#@ relevanssi
|
565 |
msgid "Custom excerpts/snippets"
|
566 |
msgstr "Benutzerdefinierte Auszüge/Snippets"
|
567 |
|
|
|
568 |
#: lib/interface.php:1074
|
569 |
-
#@ relevanssi
|
570 |
msgid "Create custom search result snippets:"
|
571 |
msgstr "Neues Benutzerdefiniertes Suchergebnis-Snippet:"
|
572 |
|
|
|
573 |
#: lib/interface.php:1076
|
574 |
-
#@ relevanssi
|
575 |
msgid "If checked, Relevanssi will create excerpts that contain the search term hits. To make them work, make sure your search result template uses the_excerpt() to display post excerpts."
|
576 |
msgstr "Wenn aktiviert zeigt Relevanssi Auszüge an, in denen der Suchtreffer zu sehen ist. Das funktioniert nur, wenn Ihr Theme die Funktion 'the_excerpt()' benutzt um Textauszüge anzuzeigen."
|
577 |
|
|
|
578 |
#: lib/interface.php:1078
|
579 |
-
#@ relevanssi
|
580 |
msgid "Note: Building custom excerpts can be slow. If you are not actually using the excerpts, make sure you disable the option."
|
581 |
msgstr "Anmerkung: Benutzerdefinierte Auszüge zu erzeugen kann ziemlich lange dauern. Wenn Sie ohnehin keine Textauszüge eintragen, sollten Sie diese Option deaktivieren."
|
582 |
|
|
|
583 |
#: lib/interface.php:1080
|
584 |
-
#@ relevanssi
|
585 |
msgid "Length of the snippet:"
|
586 |
msgstr "Länge des Snippets:"
|
587 |
|
|
|
588 |
#: lib/interface.php:1083
|
589 |
-
#@ relevanssi
|
590 |
msgid "characters"
|
591 |
msgstr "Zeichen"
|
592 |
|
|
|
593 |
#: lib/interface.php:1084
|
594 |
-
#@ relevanssi
|
595 |
msgid "words"
|
596 |
msgstr "Wörter"
|
597 |
|
|
|
598 |
#: lib/interface.php:1086
|
599 |
-
#@ relevanssi
|
600 |
msgid "This must be an integer."
|
601 |
msgstr "Bitte eine ganze Zahl eintragen"
|
602 |
|
|
|
603 |
#: lib/interface.php:1090
|
604 |
-
#@ relevanssi
|
605 |
msgid "Allowable tags in excerpts:"
|
606 |
msgstr "Erlaubte HTML-Tags in Auszügen:"
|
607 |
|
|
|
608 |
#: lib/interface.php:1093
|
609 |
-
#@ relevanssi
|
610 |
msgid "List all tags you want to allow in excerpts, without any whitespace. For example: '<p><a><strong>'."
|
611 |
msgstr "Liste alle HTML-Tags, die Sie in Auszügen erlauben wollen, ohne Leerzeichen dazwischen. Z.B.: '<p><a><strong>'."
|
612 |
|
|
|
613 |
#: lib/interface.php:1097
|
614 |
-
#@ relevanssi
|
615 |
msgid "Show breakdown of search hits in excerpts:"
|
616 |
msgstr "Alle Trefferstellen in den Auszügen anzeigen:"
|
617 |
|
|
|
618 |
#: lib/interface.php:1099
|
619 |
-
#@ relevanssi
|
620 |
msgid "Check this to show more information on where the search hits were made. Requires custom snippets to work."
|
621 |
msgstr "Zeigt mehr Informationen, an welchen Stellen die Suchbegriffe im Text gefunden wurden. Erfordert benutzerdefinierte Snippets."
|
622 |
|
|
|
623 |
#: lib/interface.php:1103
|
624 |
-
#@ relevanssi
|
625 |
msgid "The breakdown format:"
|
626 |
msgstr "Format der Trefferstellen:"
|
627 |
|
|
|
628 |
#: lib/interface.php:1105
|
629 |
#, php-format
|
630 |
-
#@ relevanssi
|
631 |
msgid "Use %body%, %title%, %tags% and %comments% to display the number of hits (in different parts of the post), %total% for total hits, %score% to display the document weight and %terms% to show how many hits each search term got. No double quotes (\") allowed!"
|
632 |
msgstr "Benutzen Sie %body%, %title%, %tags% und %comments% um die Anzahl der Treffen anzuzeigen (in den unterschiedlichen Stellen des Dokuments), %total% für die Gesamte Anzahl an Treffern, %score% für die Gewichtung des Dokuments, %terms% zur Anzeige, wieviele Treffer jeder Suchbegriff erbracht hat. Es sind keine Doppelten Anführungszeichen (\") erlaubt!"
|
633 |
|
|
|
634 |
#: lib/interface.php:1107
|
635 |
-
#@ relevanssi
|
636 |
msgid "Search hit highlighting"
|
637 |
msgstr "Suchergebnis hervorheben"
|
638 |
|
|
|
639 |
#: lib/interface.php:1109
|
640 |
-
#@ relevanssi
|
641 |
msgid "First, choose the type of highlighting used:"
|
642 |
msgstr "Erstens: Art der Hervorhebung auswählen:"
|
643 |
|
|
|
644 |
#: lib/interface.php:1112
|
645 |
-
#@ relevanssi
|
646 |
msgid "Highlight query terms in search results:"
|
647 |
msgstr "Suchbegriffe in den Ergebnissen hervorheben:"
|
648 |
|
|
|
649 |
#: lib/interface.php:1114
|
650 |
-
#@ relevanssi
|
651 |
msgid "No highlighting"
|
652 |
msgstr "Keine Hervorhebung"
|
653 |
|
|
|
654 |
#: lib/interface.php:1118
|
655 |
-
#@ relevanssi
|
656 |
msgid "Text color"
|
657 |
msgstr "Textfarbe"
|
658 |
|
|
|
659 |
#: lib/interface.php:1119
|
660 |
-
#@ relevanssi
|
661 |
msgid "Background color"
|
662 |
msgstr "Hintergrundfarbe"
|
663 |
|
|
|
664 |
#: lib/interface.php:1120
|
665 |
-
#@ relevanssi
|
666 |
msgid "CSS Style"
|
667 |
msgstr "CSS-Style"
|
668 |
|
|
|
669 |
#: lib/interface.php:1121
|
670 |
-
#@ relevanssi
|
671 |
msgid "CSS Class"
|
672 |
msgstr "CSS-Klasse"
|
673 |
|
|
|
674 |
#: lib/interface.php:1123
|
675 |
-
#@ relevanssi
|
676 |
msgid "Highlighting isn't available unless you use custom snippets"
|
677 |
msgstr "Hervorhebung ist ohne Benutzerdefinierte Snippets nicht verfügbar"
|
678 |
|
|
|
679 |
#: lib/interface.php:1127
|
680 |
-
#@ relevanssi
|
681 |
msgid "Highlight query terms in result titles too:"
|
682 |
msgstr "Suchbegriffe im Titel ebenfalls hervorheben:"
|
683 |
|
|
|
684 |
#: lib/interface.php:1133
|
685 |
-
#@ relevanssi
|
686 |
msgid "Highlight query terms in documents from local searches:"
|
687 |
msgstr "Suchbegriffe in aufgerufenen Dokumenten ebenfalls hervorheben:"
|
688 |
|
|
|
689 |
#: lib/interface.php:1135
|
690 |
-
#@ relevanssi
|
691 |
msgid "Highlights hits when user opens the post from search results. This is based on HTTP referrer, so if that's blocked, there'll be no highlights."
|
692 |
msgstr "Hebt die Suchbegriffe hervor, wenn der Besucher ein Dokument aus einem Suchergebnis heraus öffnet. Diese Funktion basiert auf Abfrage des HTTP-Referrers, wenn der blockiert wird, gibt es auch keine Hervorhebung."
|
693 |
|
|
|
694 |
#: lib/interface.php:1141
|
695 |
-
#@ relevanssi
|
696 |
msgid "Highlight query terms in comments:"
|
697 |
msgstr "Suchbegriffe in Kommentaren hervorheben:"
|
698 |
|
|
|
699 |
#: lib/interface.php:1143
|
700 |
-
#@ relevanssi
|
701 |
msgid "Highlights hits in comments when user opens the post from search results."
|
702 |
msgstr "Hebt die Suchbegriffe auch in den Kommentaren hervor, wenn der Besucher eine Seite aus dem Suchergebnis heraus öffnet."
|
703 |
|
|
|
704 |
#: lib/interface.php:1147
|
705 |
-
#@ relevanssi
|
706 |
msgid "Uncheck this if you use non-ASCII characters:"
|
707 |
msgstr "Deaktivieren, wenn Sie nicht-ASCII-Zeichen verwenden."
|
708 |
|
|
|
709 |
#: lib/interface.php:1149
|
710 |
-
#@ relevanssi
|
711 |
msgid "If you use non-ASCII characters (like Cyrillic alphabet) and the highlights don't work, uncheck this option to make highlights work."
|
712 |
msgstr "Wenn Sie Nicht-ASCII-Zeichen verwenden (wie z.B. im kyrillischen Alphabet) und die Hervorhebung nicht funktioniert, deaktivieren Sie diese Option bitte."
|
713 |
|
|
|
714 |
#: lib/interface.php:1154
|
715 |
-
#@ relevanssi
|
716 |
msgid "Then adjust the settings for your chosen type:"
|
717 |
msgstr "Dann: nehmen Sie die Einstellungen für die gewählte Hervorhebung vor"
|
718 |
|
|
|
719 |
#: lib/interface.php:1158
|
720 |
-
#@ relevanssi
|
721 |
msgid "Text color for highlights:"
|
722 |
msgstr "Textfarbe für Hervorhebungen:"
|
723 |
|
724 |
-
|
725 |
-
#: lib/interface.php:1166
|
726 |
-
#@ relevanssi
|
727 |
msgid "Use HTML color codes (#rgb or #rrggbb)"
|
728 |
msgstr "Bitte HTML-Farbcodes verwenden (#rgb oder #rrggbb)"
|
729 |
|
|
|
730 |
#: lib/interface.php:1164
|
731 |
-
#@ relevanssi
|
732 |
msgid "Background color for highlights:"
|
733 |
msgstr "Hintergrundfarbe für Hervorhebungen:"
|
734 |
|
|
|
735 |
#: lib/interface.php:1170
|
736 |
-
#@ relevanssi
|
737 |
msgid "CSS style for highlights:"
|
738 |
msgstr "CSS-Style für Hervorhebungen:"
|
739 |
|
|
|
740 |
#: lib/interface.php:1172
|
741 |
-
#@ relevanssi
|
742 |
msgid "You can use any CSS styling here, style will be inserted with a <span>"
|
743 |
msgstr "Sie können beliebiges CSS eintragen. Die Styles werden durch ein <span> eingefügt."
|
744 |
|
|
|
745 |
#: lib/interface.php:1176
|
746 |
-
#@ relevanssi
|
747 |
msgid "CSS class for highlights:"
|
748 |
msgstr "CSS-Klasse für Hervorhebungen:"
|
749 |
|
|
|
750 |
#: lib/interface.php:1178
|
751 |
-
#@ relevanssi
|
752 |
msgid "Name a class here, search results will be wrapped in a <span> with the class"
|
753 |
msgstr "Benennen Sie hier eine CSS-Klasse. Der Suchbegriff wird von einem <span> mit dieser Klasse umschlossen werden."
|
754 |
|
755 |
-
|
756 |
-
#: lib/interface.php:1364
|
757 |
-
#@ relevanssi
|
758 |
msgid "Save the options"
|
759 |
msgstr "Einstellungen sichern"
|
760 |
|
|
|
761 |
#: lib/interface.php:1189
|
762 |
-
#@ relevanssi
|
763 |
msgid "Choose post types to index:"
|
764 |
msgstr "Welche Beitrags-Typen sollen indiziert werden:"
|
765 |
|
|
|
766 |
#: lib/interface.php:1194
|
767 |
-
#@ relevanssi
|
768 |
msgid "Type"
|
769 |
msgstr "Typ"
|
770 |
|
771 |
-
|
772 |
-
#: lib/interface.php:1241
|
773 |
-
#@ relevanssi
|
774 |
msgid "Index"
|
775 |
msgstr "Index"
|
776 |
|
777 |
-
|
778 |
-
#: lib/interface.php:1242
|
779 |
-
#@ relevanssi
|
780 |
msgid "Public?"
|
781 |
msgstr "Öffentlich?"
|
782 |
|
783 |
-
|
784 |
-
#: lib/interface.php:1256
|
785 |
#, php-format
|
786 |
-
#@ relevanssi
|
787 |
msgid "%s"
|
788 |
msgstr "%s"
|
789 |
|
790 |
-
|
791 |
-
#: lib/interface.php:1257
|
792 |
-
#@ relevanssi
|
793 |
msgid "yes"
|
794 |
msgstr "Ja"
|
795 |
|
796 |
-
|
797 |
-
#: lib/interface.php:1257
|
798 |
-
#@ relevanssi
|
799 |
msgid "no"
|
800 |
msgstr "Nein"
|
801 |
|
|
|
802 |
#: lib/interface.php:1235
|
803 |
-
#@ relevanssi
|
804 |
msgid "Choose taxonomies to index:"
|
805 |
msgstr "Taxonomien für die Indizierung auswählen:"
|
806 |
|
|
|
807 |
#: lib/interface.php:1240
|
808 |
-
#@ relevanssi
|
809 |
msgid "Taxonomy"
|
810 |
msgstr "Taxonomie"
|
811 |
|
|
|
812 |
#: lib/interface.php:1277
|
813 |
-
#@ relevanssi
|
814 |
msgid "If you check a taxonomy here, the terms for that taxonomy are indexed with the posts. If you for example choose \"post_tag\", searching for tags will find all posts that have the tag."
|
815 |
msgstr "Wenn Sie eine Taxonomie hier aktivieren, werden all ihre Begriffe zusammen mit dem Beitrag indiziert. Wenn Sie z.B. \"post_tag\" auswählen, wird die Suche nach einem Tag auch die Beiträge finden, die diesem Tag zugeordnet sind."
|
816 |
|
|
|
817 |
#: lib/interface.php:1281
|
818 |
-
#@ relevanssi
|
819 |
msgid "Minimum word length to index"
|
820 |
msgstr "Mindestlänge von Wörtern im Index"
|
821 |
|
|
|
822 |
#: lib/interface.php:1283
|
823 |
-
#@ relevanssi
|
824 |
msgid "Words shorter than this number will not be indexed."
|
825 |
msgstr "Kürzere Wörter werden nicht indiziert."
|
826 |
|
|
|
827 |
#: lib/interface.php:1289
|
828 |
-
#@ relevanssi
|
829 |
msgid "Expand shortcodes in post content:"
|
830 |
msgstr "Shortcodes im Beitrags-Inhalt ausführen:"
|
831 |
|
|
|
832 |
#: lib/interface.php:1291
|
833 |
-
#@ relevanssi
|
834 |
msgid "If checked, Relevanssi will expand shortcodes in post content before indexing. Otherwise shortcodes will be stripped. If you use shortcodes to include dynamic content, Relevanssi will not keep the index updated, the index will reflect the status of the shortcode content at the moment of indexing."
|
835 |
msgstr "Wenn aktiviert wird Relevanssi die Shortcodes in den Beiträgen ausführen. Z.B. gelangen Bildzuschriften in Galerien dadurch in den Suchindex. Ein nachträgliches aktivieren dieser Option aktualisiert nicht den Suchindex, in dem Fall müssen Sie den Index aktualisieren. "
|
836 |
|
|
|
837 |
#: lib/interface.php:1297
|
838 |
-
#@ relevanssi
|
839 |
msgid "Index and search your posts' authors:"
|
840 |
msgstr "Beitrags-Autoren indizieren und suchen:"
|
841 |
|
|
|
842 |
#: lib/interface.php:1299
|
843 |
-
#@ relevanssi
|
844 |
msgid "If checked, Relevanssi will also index and search the authors of your posts. Author display name will be indexed. Remember to rebuild the index if you change this option!"
|
845 |
msgstr "Wenn aktiviert wird Relavanssi auch auf den Autorenseiten suchen. Die Namen der Autoren werden dabei indiziert. Bitte denken Sie daran den Index neu aufzubauen, wenn Sie diese Option aktivieren."
|
846 |
|
|
|
847 |
#: lib/interface.php:1303
|
848 |
-
#@ relevanssi
|
849 |
msgid "Index and search post excerpts:"
|
850 |
msgstr "Auszüge indizieren und durchsuchen:"
|
851 |
|
|
|
852 |
#: lib/interface.php:1305
|
853 |
-
#@ relevanssi
|
854 |
msgid "If checked, Relevanssi will also index and search the excerpts of your posts.Remember to rebuild the index if you change this option!"
|
855 |
msgstr "Wenn aktiviert wird Relavanssi auch auf den Auszügen Ihrer Beiträge. Bitte denken Sie daran den Index neu aufzubauen, wenn Sie diese Option aktivieren."
|
856 |
|
|
|
857 |
#: lib/interface.php:1309
|
858 |
-
#@ relevanssi
|
859 |
msgid "Index and search these comments:"
|
860 |
msgstr "Diese Kommentaren indizieren und durchsuchen:"
|
861 |
|
|
|
862 |
#: lib/interface.php:1311
|
863 |
-
#@ relevanssi
|
864 |
msgid "none"
|
865 |
msgstr "keine"
|
866 |
|
|
|
867 |
#: lib/interface.php:1312
|
868 |
-
#@ relevanssi
|
869 |
msgid "normal"
|
870 |
msgstr "Normal"
|
871 |
|
|
|
872 |
#: lib/interface.php:1313
|
873 |
-
#@ relevanssi
|
874 |
msgid "all"
|
875 |
msgstr "Alle"
|
876 |
|
|
|
877 |
#: lib/interface.php:1315
|
878 |
-
#@ relevanssi
|
879 |
msgid "Relevanssi will index and search ALL (all comments including track- & pingbacks and custom comment types), NONE (no comments) or NORMAL (manually posted comments on your blog).<br />Remember to rebuild the index if you change this option!"
|
880 |
msgstr "Relevanssi wird ALLE (alle Kommentare einschließlich Track- & Pingbacks und Benutzerdefinierte Kommentartype), KEINE (Keine Kommentare) der NORMAL (von Besuchern gepostete Kommentare).<br />Bitte denken Sie daran den Index neu aufzubauen, wenn Sie diese Option aktivieren."
|
881 |
|
|
|
882 |
#: lib/interface.php:1319
|
883 |
-
#@ relevanssi
|
884 |
msgid "Custom fields to index:"
|
885 |
msgstr "Benutzerdefinierte Felder indizieren:"
|
886 |
|
|
|
887 |
#: lib/interface.php:1321
|
888 |
-
#@ relevanssi
|
889 |
msgid "A comma-separated list of custom fields to include in the index. Set to 'visible' to index all visible custom fields and to 'all' to index all custom fields, also those starting with a '_' character."
|
890 |
-
msgstr "Eine Komma-getrennte Liste von Benutzerdefinierten Feldern die in den Index aufgenommen werden sollen. Wählen Sie
|
891 |
|
|
|
892 |
#: lib/interface.php:1331
|
893 |
-
#@ relevanssi
|
894 |
msgid "Save indexing options and build the index"
|
895 |
msgstr "Einstellungen sichern und Index aufbauen"
|
896 |
|
|
|
897 |
#: lib/interface.php:1337
|
898 |
-
#@ relevanssi
|
899 |
msgid ""
|
900 |
"Warning: In many cases caching is not useful, and in some cases can be even harmful. Do not\n"
|
901 |
"\tactivate cache unless you have a good reason to do so."
|
902 |
msgstr "Warnung: In vielen Fällen ist das Caching nicht sehr vorteilhaft und manchen Fälle sogar nachteilig. Aktivieren Sie den Cache bitte nicht ohne einen sehr guten Grund!"
|
903 |
|
|
|
904 |
#: lib/interface.php:1340
|
905 |
-
#@ relevanssi
|
906 |
msgid "Enable result and excerpt caching:"
|
907 |
msgstr "Ergebnis- und Auszugs-Cache aktivieren:"
|
908 |
|
|
|
909 |
#: lib/interface.php:1342
|
910 |
-
#@ relevanssi
|
911 |
msgid "If checked, Relevanssi will cache search results and post excerpts."
|
912 |
msgstr "Wenn aktiviert wird Relevanssi Suchergebnisse und Auszüge cachen."
|
913 |
|
|
|
914 |
#: lib/interface.php:1346
|
915 |
-
#@ relevanssi
|
916 |
msgid "Cache expire (in seconds):"
|
917 |
msgstr "Cache läuft ab (in Sekunden):"
|
918 |
|
|
|
919 |
#: lib/interface.php:1348
|
920 |
-
#@ relevanssi
|
921 |
msgid "86400 = day"
|
922 |
msgstr "86400 = 1 Tag"
|
923 |
|
|
|
924 |
#: lib/interface.php:1352
|
925 |
-
#@ relevanssi
|
926 |
msgid "Entries in the cache"
|
927 |
msgstr "Einträge im Cache"
|
928 |
|
|
|
929 |
#: lib/interface.php:1356
|
930 |
-
#@ relevanssi
|
931 |
msgid "Clear all caches"
|
932 |
msgstr "Cache löschen"
|
933 |
|
|
|
934 |
#: lib/interface.php:1362
|
935 |
-
#@ relevanssi
|
936 |
msgid "Add synonyms here in 'key = value' format. When searching with the OR operator, any search of 'key' will be expanded to include 'value' as well. Using phrases is possible. The key-value pairs work in one direction only, but you can of course repeat the same pair reversed."
|
937 |
msgstr "Synonyme im 'key = value' Format hinzufügen. Wenn mit dem OR-Operator gesucht wird, wird jede Suche nach 'key' auch auf 'value' ausgedehnt. Die Benutzung von Sätzen oder Phrasen ist auch möglich. Die Key-Value-Paare funktionieren nur in eine Richtung, aber Sie können natürlich weitere Paare mit vertauschten Werten eintragen."
|
938 |
|
|
|
939 |
#: lib/interface.php:1385
|
940 |
-
#@ relevanssi
|
941 |
msgid "<p>Enter a word here to add it to the list of stopwords. The word will automatically be removed from the index, so re-indexing is not necessary. You can enter many words at the same time, separate words with commas.</p>"
|
942 |
msgstr "<p>Tragen Sie ein Wort ein um der Liste der Stoppwörter anzufügen. Das Wort wird automatisch aus dem Index gelöscht, daher brauchen Sie den Index nicht erneut aufzubauen. Sie können mehrere Wörter auf einmal durch Kommata getrennt eintragen.</p>"
|
943 |
|
|
|
944 |
#: lib/interface.php:1387
|
945 |
-
#@ relevanssi
|
946 |
msgid "Stopword(s) to add: "
|
947 |
msgstr "Stoppwörter hinzufügen:"
|
948 |
|
|
|
949 |
#: lib/interface.php:1388
|
950 |
-
#@ relevanssi
|
951 |
msgid "Add"
|
952 |
msgstr "Hinzufügen"
|
953 |
|
|
|
954 |
#: lib/interface.php:1391
|
955 |
-
#@ relevanssi
|
956 |
msgid "<p>Here's a list of stopwords in the database. Click a word to remove it from stopwords. Removing stopwords won't automatically return them to index, so you need to re-index all posts after removing stopwords to get those words back to index."
|
957 |
msgstr "Liste der Stoppwörter in der Datenbank. Klicken Sie auf ein Wort um es aus der Stoppwort-Liste zu entfernen. Das Entfernen bringt die Stoppwörter nicht automatisch zurück in den Index, Sie müssen daher nach dem Entfernen der Stoppwörter den Index neu aufbauen.."
|
958 |
|
|
|
959 |
#: lib/interface.php:1417
|
960 |
-
#@ relevanssi
|
961 |
msgid "Remove all stopwords"
|
962 |
msgstr "Alle Stoppwörter entfernen"
|
963 |
|
|
|
964 |
#: lib/interface.php:1423
|
965 |
-
#@ relevanssi
|
966 |
msgid "Here's a list of stopwords you can use to export the stopwords to another blog."
|
967 |
msgstr "Eine Liste von Stoppwörtern zum Export in einen anderen Blog."
|
968 |
|
|
|
969 |
#: lib/uninstall.php:41
|
970 |
-
#@ relevanssi
|
971 |
msgid "Data wiped clean, you can now delete the plugin."
|
972 |
msgstr "Alle Daten sauber gelöscht. Sie können das Plugin jetzt löschen."
|
973 |
|
|
|
974 |
#: relevanssi.php:296
|
975 |
-
#@ relevanssi
|
976 |
msgid "Tag weight:"
|
977 |
msgstr "Schlüsselwort Gewichtung:"
|
978 |
|
|
|
979 |
#: relevanssi.php:311
|
980 |
-
#@ relevanssi
|
981 |
msgid "Category weight:"
|
982 |
msgstr "Kategorie Gewichtung:"
|
983 |
|
|
|
984 |
#: lib/interface.php:1004
|
985 |
-
#@ relevanssi
|
986 |
msgid "WPML/Polylang compatibility"
|
987 |
msgstr "WPML/Polylang Kompatibilität"
|
988 |
-
|
3 |
"Project-Id-Version: Relevanssi v3.1.8\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: \n"
|
6 |
+
"PO-Revision-Date: 2016-05-11 06:11+0300\n"
|
7 |
+
"Last-Translator: Mikko Saari <mikko@mikkosaari.fi>\n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Generator: Poedit 1.8.7\n"
|
|
|
|
|
14 |
"X-Poedit-SourceCharset: utf-8\n"
|
15 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
16 |
+
"X-Textdomain-Support: yes\n"
|
17 |
+
"Language: de_DE\n"
|
18 |
"X-Poedit-SearchPath-0: .\n"
|
|
|
19 |
|
20 |
+
# @ default
|
21 |
#: lib/excerpts-highlights.php:11
|
|
|
22 |
msgid "There is no excerpt because this is a protected post."
|
23 |
msgstr "Es gibt keinen Auszug, da dies eine geschütze Seite ist."
|
24 |
|
25 |
+
# @ default
|
26 |
#: lib/init.php:40
|
27 |
#, php-format
|
|
|
28 |
msgid ""
|
29 |
"Relevanssi needs attention: Remember to build the index (you can do it at <a href=\"%1$s\">the\n"
|
30 |
"\t\t\t settings page</a>), otherwise searching won't work."
|
31 |
msgstr "Relevanssi benötigt Ihre Aufmerksamkeit. Bitte denken Sie daran, den Index aufzubauen. (Unter <a href=\"%1$s\">Einstellungen</a>). Andernfalls funktioniert die Suche nicht."
|
32 |
|
33 |
+
# @ relevanssi
|
34 |
+
#: lib/init.php:84 lib/init.php:85
|
|
|
35 |
msgid "User searches"
|
36 |
msgstr "Suchanfragen"
|
37 |
|
38 |
+
# @ relevanssi
|
39 |
#: lib/interface.php:6
|
|
|
40 |
msgid "Relevanssi Premium Search Options"
|
41 |
msgstr "Relevanssi Premium Such-Einstellungen"
|
42 |
|
43 |
+
# @ relevanssi
|
44 |
#: lib/interface.php:9
|
|
|
45 |
msgid "Relevanssi Search Options"
|
46 |
msgstr "Relevanssi Such-Einstellungen"
|
47 |
|
48 |
+
# @ relevanssi
|
49 |
#: lib/interface.php:86
|
|
|
50 |
msgid "User Searches"
|
51 |
msgstr "Suchanfragen"
|
52 |
|
53 |
+
# @ relevanssi
|
54 |
#: lib/interface.php:88
|
|
|
55 |
msgid "Relevanssi User Searches"
|
56 |
msgstr "Relevanssi Suchanfragen"
|
57 |
|
58 |
+
# @ relevanssi
|
59 |
#: lib/interface.php:335
|
60 |
#, php-format
|
|
|
61 |
msgid "<div id='message' class='updated fade'><p>Successfully added %d/%d terms to stopwords!</p></div>"
|
62 |
msgstr "<div id='message' class='updated fade'><p>%d/%d erfolgreich zur Stoppwort-Liste hinzugefügt!</p></div>"
|
63 |
|
64 |
+
# @ relevanssi
|
65 |
#: lib/interface.php:342
|
66 |
#, php-format
|
|
|
67 |
msgid "<div id='message' class='updated fade'><p>Term '%s' added to stopwords!</p></div>"
|
68 |
msgstr "<div id='message' class='updated fade'><p>Begriff '%s' zur Stoppwort-Liste hinzugefügt!</p></div>"
|
69 |
|
70 |
+
# @ relevanssi
|
71 |
#: lib/interface.php:345
|
72 |
#, php-format
|
|
|
73 |
msgid "<div id='message' class='updated fade'><p>Couldn't add term '%s' to stopwords!</p></div>"
|
74 |
msgstr "<div id='message' class='updated fade'><p>Konnte Begriff '%s' nicht zur Stoppwort-Liste hinzufügen!</p></div>"
|
75 |
|
76 |
+
# @ relevanssi
|
77 |
#: lib/interface.php:374
|
|
|
78 |
msgid "<div id='message' class='updated fade'><p>Stopwords removed! Remember to re-index.</p></div>"
|
79 |
msgstr "<div id='message' class='updated fade'><p>Stoppwörter entfernt! Bitte den Index neu erstellen.</p></div>"
|
80 |
|
81 |
+
# @ relevanssi
|
82 |
#: lib/interface.php:384
|
83 |
#, php-format
|
|
|
84 |
msgid "<div id='message' class='updated fade'><p>Term '%s' removed from stopwords! Re-index to get it back to index.</p></div>"
|
85 |
msgstr "<div id='message' class='updated fade'><p>Begriff '%s' aus aus der Stoppwort-Liste entfernt! Bitte den Index neu erstellen, um es in den Suchindex aufzunehmen.</p></div>"
|
86 |
|
87 |
+
# @ relevanssi
|
88 |
#: lib/interface.php:387
|
89 |
#, php-format
|
|
|
90 |
msgid "<div id='message' class='updated fade'><p>Couldn't remove term '%s' from stopwords!</p></div>"
|
91 |
msgstr "<div id='message' class='updated fade'><p>Konnte Begriff '%s' nicht aus der Stoppwort-Liste entfernen!</p></div>"
|
92 |
|
93 |
+
# @ relevanssi
|
94 |
#: lib/interface.php:398
|
|
|
95 |
msgid "25 most common words in the index"
|
96 |
msgstr "Die 25 häufigsten Begriffe im Index"
|
97 |
|
98 |
+
# @ relevanssi
|
99 |
#: lib/interface.php:400
|
|
|
100 |
msgid "These words are excellent stopword material. A word that appears in most of the posts in the database is quite pointless when searching. This is also an easy way to create a completely new stopword list, if one isn't available in your language. Click the icon after the word to add the word to the stopword list. The word will also be removed from the index, so rebuilding the index is not necessary."
|
101 |
msgstr "Diese Wörter bilden hervorragendes Stoppwort-Material. Ein Wort, das auf den meisten Ihrer Seiten erscheint, ist für die Suche nutzlos. Auf diese Weise können Sie außerdem eine neue Stoppwort-Liste erstellen, falls in Ihrer Sprache keine solche Liste vorhanden ist. Klicken Sie auf das Icon hinter dem Wort um ein Wort in die Stoppwort-Liste aufzunehmen. Das Wort wird danach auch aus dem Index entfernt, daher müssen Sie den Such-Index nicht neu erstellen."
|
102 |
|
103 |
+
# @ relevanssi
|
104 |
#: lib/interface.php:426
|
|
|
105 |
msgid "Add to stopwords"
|
106 |
msgstr "Zu den Stoppwörtern hinzufügen"
|
107 |
|
108 |
+
# @ relevanssi
|
109 |
#: lib/interface.php:437
|
|
|
110 |
msgid "Total Searches"
|
111 |
msgstr "Alle Suchanfragen"
|
112 |
|
113 |
+
# @ relevanssi
|
114 |
#: lib/interface.php:440
|
|
|
115 |
msgid "Totals"
|
116 |
msgstr "Summe"
|
117 |
|
118 |
+
# @ relevanssi
|
119 |
#: lib/interface.php:445
|
|
|
120 |
msgid "Common Queries"
|
121 |
msgstr "Häufige Suchbegriffe"
|
122 |
|
123 |
+
# @ relevanssi
|
124 |
#: lib/interface.php:447
|
|
|
125 |
msgid ""
|
126 |
"Here you can see the 20 most common user search queries, how many times those \n"
|
127 |
"\t\tqueries were made and how many results were found for those queries."
|
128 |
msgstr "Hier sehen Sie die 20 häufigsten Suchanfragen Ihrer Besucher, wie oft diese ausgeführt wurden, und wieviele Ergebnisse dafür gefunden wurden."
|
129 |
|
130 |
+
# @ relevanssi
|
131 |
+
#: lib/interface.php:453 lib/interface.php:469 lib/interface.php:501
|
|
|
|
|
132 |
msgid "Today and yesterday"
|
133 |
msgstr "Heute und gestern"
|
134 |
|
135 |
+
# @ relevanssi
|
136 |
+
#: lib/interface.php:457 lib/interface.php:473 lib/interface.php:502
|
|
|
|
|
137 |
msgid "Last 7 days"
|
138 |
msgstr "Die letzten 7 Tage"
|
139 |
|
140 |
+
# @ relevanssi
|
141 |
+
#: lib/interface.php:461 lib/interface.php:477 lib/interface.php:503
|
|
|
|
|
142 |
msgid "Last 30 days"
|
143 |
msgstr "Die letzten 30 Tage"
|
144 |
|
145 |
+
# @ relevanssi
|
146 |
#: lib/interface.php:466
|
|
|
147 |
msgid "Unsuccessful Queries"
|
148 |
msgstr "Erfolglose Suchanfragen"
|
149 |
|
150 |
+
# @ relevanssi
|
151 |
#: lib/interface.php:484
|
|
|
152 |
msgid "Reset Logs"
|
153 |
msgstr "Protokoll zurücksetzen"
|
154 |
|
155 |
+
# @ relevanssi
|
156 |
#: lib/interface.php:487
|
157 |
#, php-format
|
|
|
158 |
msgid "To reset the logs, type \"reset\" into the box here %s and click %s"
|
159 |
msgstr "Zum Zurücksetzen der Protokolle bitte \"reset\" in dieses Textfeld %s eintragen und %s klicken."
|
160 |
|
161 |
+
# @ relevanssi
|
162 |
#: lib/interface.php:504
|
|
|
163 |
msgid "Forever"
|
164 |
msgstr "Für immer"
|
165 |
|
166 |
+
# @ relevanssi
|
167 |
#: lib/interface.php:506
|
|
|
168 |
msgid "When"
|
169 |
msgstr "Wenn"
|
170 |
|
171 |
+
# @ relevanssi
|
172 |
#: lib/interface.php:506
|
|
|
173 |
msgid "Searches"
|
174 |
msgstr "Suchanfragen"
|
175 |
|
176 |
+
# @ relevanssi
|
177 |
#: lib/interface.php:536
|
|
|
178 |
msgid "Query"
|
179 |
msgstr "Suchanfrage"
|
180 |
|
181 |
+
# @ relevanssi
|
182 |
#: lib/interface.php:536
|
|
|
183 |
msgid "Hits"
|
184 |
msgstr "Treffer"
|
185 |
|
186 |
+
# @ relevanssi
|
187 |
+
#: lib/interface.php:846 lib/interface.php:891
|
|
|
188 |
msgid "Basic options"
|
189 |
msgstr "Grundeinstellungen"
|
190 |
|
191 |
+
# @ relevanssi
|
192 |
+
#: lib/interface.php:847 lib/interface.php:957
|
|
|
193 |
msgid "Weights"
|
194 |
msgstr "Gewichtungen"
|
195 |
|
196 |
+
# @ relevanssi
|
197 |
+
#: lib/interface.php:848 lib/interface.php:1012
|
|
|
198 |
msgid "Logs"
|
199 |
msgstr "Protokolle"
|
200 |
|
201 |
+
# @ relevanssi
|
202 |
+
#: lib/interface.php:849 lib/interface.php:1041
|
|
|
203 |
msgid "Exclusions and restrictions"
|
204 |
msgstr "Ausschließen oder Beschränkungen"
|
205 |
|
206 |
+
# @ relevanssi
|
207 |
#: lib/interface.php:850
|
|
|
208 |
msgid "Custom excerpts"
|
209 |
msgstr "Eigene Zusammenfassungen"
|
210 |
|
211 |
+
# @ relevanssi
|
212 |
#: lib/interface.php:851
|
|
|
213 |
msgid "Highlighting search results"
|
214 |
msgstr "Suchbegriffe hervorheben"
|
215 |
|
216 |
+
# @ relevanssi
|
217 |
+
#: lib/interface.php:852 lib/interface.php:1187
|
|
|
218 |
msgid "Indexing options"
|
219 |
msgstr "Indizierungs-Einstellungen"
|
220 |
|
221 |
+
# @ relevanssi
|
222 |
+
#: lib/interface.php:853 lib/interface.php:1335
|
|
|
223 |
msgid "Caching"
|
224 |
msgstr "Cache"
|
225 |
|
226 |
+
# @ relevanssi
|
227 |
+
#: lib/interface.php:854 lib/interface.php:1358
|
|
|
228 |
msgid "Synonyms"
|
229 |
msgstr "Synonyme"
|
230 |
|
231 |
+
# @ relevanssi
|
232 |
+
#: lib/interface.php:855 lib/interface.php:1366
|
|
|
233 |
msgid "Stopwords"
|
234 |
msgstr "Stoppwörter"
|
235 |
|
236 |
+
# @ relevanssi
|
237 |
#: lib/interface.php:858
|
|
|
238 |
msgid "Import/export options"
|
239 |
msgstr "Einstellungen importieren/exportieren"
|
240 |
|
241 |
+
# @ relevanssi
|
242 |
#: lib/interface.php:861
|
|
|
243 |
msgid "Buy Relevanssi Premium"
|
244 |
msgstr "Relevanssi Premium kaufen"
|
245 |
|
246 |
+
# @ relevanssi
|
247 |
#: lib/interface.php:866
|
|
|
248 |
msgid "Quick tools"
|
249 |
msgstr "Quick tools"
|
250 |
|
251 |
+
# @ relevanssi
|
252 |
#: lib/interface.php:868
|
|
|
253 |
msgid "Save options"
|
254 |
msgstr "Einstellungen sichern"
|
255 |
|
256 |
+
# @ relevanssi
|
257 |
#: lib/interface.php:869
|
|
|
258 |
msgid "Build the index"
|
259 |
msgstr "Index aufbauen"
|
260 |
|
261 |
+
# @ relevanssi
|
262 |
+
#: lib/interface.php:870 lib/interface.php:1333
|
|
|
263 |
msgid "Continue indexing"
|
264 |
msgstr "Weiter indizieren"
|
265 |
|
266 |
+
# @ relevanssi
|
267 |
#: lib/interface.php:870
|
|
|
268 |
msgid "add"
|
269 |
msgstr "hinzufügen"
|
270 |
|
271 |
+
# @ relevanssi
|
272 |
#: lib/interface.php:870
|
|
|
273 |
msgid "documents."
|
274 |
msgstr "Dokumente."
|
275 |
|
276 |
+
# @ relevanssi
|
277 |
#: lib/interface.php:874
|
|
|
278 |
msgid "WARNING: You've chosen no post types to index. Nothing will be indexed. <a href='#indexing'>Choose some post types to index</a>."
|
279 |
msgstr "WARNUNG: Sie haben keine Post-Typen für die Indizierung bestimmt. Es wird nichts indiziert werden. <a href='#indexing'>Wählen Sie ein paar Post-Typen aus.</a>."
|
280 |
|
281 |
+
# @ relevanssi
|
282 |
#: lib/interface.php:878
|
|
|
283 |
msgid "Use 'Build the index' to build the index with current <a href='#indexing'>indexing options</a>. If you can't finish indexing with one go, use 'Continue indexing' to finish the job. You can change the number of documents to add until you find the largest amount you can add with one go. See 'State of the Index' below to find out how many documents actually go into the index."
|
284 |
msgstr "Klicken Sie 'Index aufbauen' um den Index mit den derzeitigen <a href='#indexing'>Index-Einstellungen</a> zu erzeugen. Wenn es nicht auf Anhieb funktioniert, klicken Sie 'Weiter indizieren' um den Vorgang abzuschließen. Erhöhen Sie die Anzahl der Dokumente bis Sie die größte Anzahl an Dokumenten erreichte haben, die Sie in einem Zug indizieren können. Sehen Sie auch bei 'Zustand des Index' weiter unten nach, um herauszufinden, wie viele Dokumente sich gegenwärtig im Index befinden."
|
285 |
|
286 |
+
# @ relevanssi
|
287 |
#: lib/interface.php:880
|
|
|
288 |
msgid ""
|
289 |
"If Relevanssi doesn't index anything and you have upgraded from a 2.x version, it's likely the changes in\n"
|
290 |
"\tthe database structure haven't gone through in the upgrade. In that case all you need to do is to deactivate the\n"
|
291 |
"\tplugin and then activate it again."
|
292 |
msgstr "Falls Relevanssi nichts indiziert und Sie von einer 2.x-Version upgedated haben, sind wahrscheinlich die Änderungen in der Datenbank nicht durch das Update gegangen. In diesem Fall genügt es, wenn Sie das Plugin einmal deaktivieren, und anschließend wieder aktivieren."
|
293 |
|
294 |
+
# @ relevanssi
|
295 |
#: lib/interface.php:884
|
|
|
296 |
msgid "State of the Index"
|
297 |
msgstr "Zustand des Index"
|
298 |
|
299 |
+
# @ relevanssi
|
300 |
#: lib/interface.php:886
|
|
|
301 |
msgid "Documents in the index"
|
302 |
msgstr "Dokumente im Index"
|
303 |
|
304 |
+
# @ relevanssi
|
305 |
#: lib/interface.php:887
|
|
|
306 |
msgid "Terms in the index"
|
307 |
msgstr "Suchbegriffe im Index"
|
308 |
|
309 |
+
# @ relevanssi
|
310 |
#: lib/interface.php:888
|
|
|
311 |
msgid "Highest post ID indexed"
|
312 |
msgstr "Höchste indizierte Post-ID"
|
313 |
|
314 |
+
# @ relevanssi
|
315 |
#: lib/interface.php:897
|
|
|
316 |
msgid "Use search for admin:"
|
317 |
msgstr "Suchen im Admin-Bereich"
|
318 |
|
319 |
+
# @ relevanssi
|
320 |
#: lib/interface.php:899
|
|
|
321 |
msgid "If checked, Relevanssi will be used for searches in the admin interface"
|
322 |
msgstr "Wenn aktiviert, wird Relevanssi auch für die Suche innerhalb des Admin-Bereichs verwendet."
|
323 |
|
324 |
+
# @ relevanssi
|
325 |
#: lib/interface.php:903
|
|
|
326 |
msgid "Default operator for the search?"
|
327 |
msgstr "Standard-Operator für Suchanfragen?"
|
328 |
|
329 |
+
# @ relevanssi
|
330 |
#: lib/interface.php:905
|
|
|
331 |
msgid "AND - require all terms"
|
332 |
msgstr "AND – Alle Begriffe müssen vorkommen"
|
333 |
|
334 |
+
# @ relevanssi
|
335 |
#: lib/interface.php:906
|
|
|
336 |
msgid "OR - any term present is enough"
|
337 |
msgstr "OR – einer der Begriffe muß vorkommen"
|
338 |
|
339 |
+
# @ relevanssi
|
340 |
#: lib/interface.php:908
|
|
|
341 |
msgid "If you choose AND and the search finds no matches, it will automatically do an OR search."
|
342 |
msgstr "Wenn AND ausgewählt ist, und die Suche ergibt keine Treffer, wird automatisch auf OR umgeschaltet."
|
343 |
|
344 |
+
# @ relevanssi
|
345 |
#: lib/interface.php:912
|
|
|
346 |
msgid "Disable OR fallback:"
|
347 |
msgstr "OR-Fallback deaktivieren"
|
348 |
|
349 |
+
# @ relevanssi
|
350 |
#: lib/interface.php:914
|
|
|
351 |
msgid "If you don't want Relevanssi to fall back to OR search when AND search gets no hits, check this option. For most cases, leave this one unchecked."
|
352 |
msgstr "Wenn Sie nicht möchten, das bei einer erfolglosen AND-Suche auf OR zurückgegriffen wird, aktivieren Sie diese Option. In den meisten Fällen sollten Sie diese Option deaktiviert lassen."
|
353 |
|
354 |
+
# @ relevanssi
|
355 |
#: lib/interface.php:918
|
|
|
356 |
msgid "Default order for results:"
|
357 |
msgstr "Standard-Reihenfolge für Suchergebnisse:"
|
358 |
|
359 |
+
# @ relevanssi
|
360 |
#: lib/interface.php:920
|
|
|
361 |
msgid "Relevance (highly recommended)"
|
362 |
msgstr "Relevanz (Hochgradig empfohlen)"
|
363 |
|
364 |
+
# @ relevanssi
|
365 |
#: lib/interface.php:921
|
|
|
366 |
msgid "Post date"
|
367 |
msgstr "Datum des Beitrags"
|
368 |
|
369 |
+
# @ relevanssi
|
370 |
#: lib/interface.php:923
|
|
|
371 |
msgid "If you want date-based results, see the recent post bonus in the Weights section."
|
372 |
msgstr "Bei Datums-Basierten Suchergebnissen, see the recent post bonus im Abschnitt 'Gewichtung'."
|
373 |
|
374 |
+
# @ relevanssi
|
375 |
#: lib/interface.php:927
|
|
|
376 |
msgid "When to use fuzzy matching?"
|
377 |
msgstr "Wann sollen unscharfe Vergleiche benutzt werden?"
|
378 |
|
379 |
+
# @ relevanssi
|
380 |
#: lib/interface.php:929
|
|
|
381 |
msgid "When straight search gets no hits"
|
382 |
msgstr "Wenn die normale Suche keine Treffer ausgibt"
|
383 |
|
384 |
+
# @ relevanssi
|
385 |
#: lib/interface.php:930
|
|
|
386 |
msgid "Always"
|
387 |
msgstr "Immer"
|
388 |
|
389 |
+
# @ relevanssi
|
390 |
#: lib/interface.php:931
|
|
|
391 |
msgid "Don't use fuzzy search"
|
392 |
msgstr "Unscharfe Vergleiche nicht verwenden"
|
393 |
|
394 |
+
# @ relevanssi
|
395 |
#: lib/interface.php:933
|
|
|
396 |
msgid "Straight search matches just the term. Fuzzy search matches everything that begins or ends with the search term."
|
397 |
msgstr "Die normale Suche sucht nur nach direkten Übereinstimmungen mit dem Suchbegriff. Die unscharfe Suche findet alles, was mit dem Suchbegriff beginnt oder endet."
|
398 |
|
399 |
+
# @ relevanssi
|
400 |
#: lib/interface.php:941
|
|
|
401 |
msgid "Limit searches:"
|
402 |
msgstr "Suchergebnisse begrenzen:"
|
403 |
|
404 |
+
# @ relevanssi
|
405 |
#: lib/interface.php:943
|
|
|
406 |
msgid "If this option is checked, Relevanssi will limit search results to at most 500 results per term. This will improve performance, but may cause some relevant documents to go unfound. However, Relevanssi tries to prioritize the most relevant documents. <strong>This does not work well when sorting results by date.</strong> The throttle can end up cutting off recent posts to favour more relevant posts."
|
407 |
msgstr "Wenn diese Option aktiviert ist, wird Relevanssi die Suchergebnisse auf 500 Treffer pro Suchbegriff begrenzen. Dadurch wird die Leistungsfähigkeit verbessert, kann aber dazu führen, dass einige Relevante Dokumente nicht gefunden werden. Relevanssi wird trotzdem versuchen, die relevantesten Dokumente zu priorisieren. <strong>Dies funktioniert aber nicht besonders gut bei Sortierung nach Datum,</strong> und kann dazu führen dass neuere Dokumente zugunsten relevanterer Dokumente ausgelassen werden."
|
408 |
|
409 |
+
# @ relevanssi
|
410 |
#: lib/interface.php:947
|
|
|
411 |
msgid "Limit:"
|
412 |
msgstr "Begrenzung:"
|
413 |
|
414 |
+
# @ relevanssi
|
415 |
#: lib/interface.php:949
|
|
|
416 |
msgid "For better performance, adjust the limit to a smaller number. Adjusting the limit to 100 - or even lower - should be safe for good results, and might bring a boost in search speed."
|
417 |
msgstr "Zur Erhöhung der Leistungsfähigkeit tragen Sie einer kleinere Zahl ein. Ein Limit von 100 oder weniger sollte noch immer gute Suchergebnisse bringen und die Effizienz einer Suche deutlich erhöhen."
|
418 |
|
419 |
+
# @ relevanssi
|
420 |
#: lib/interface.php:959
|
|
|
421 |
msgid "These values affect the weights of the documents. These are all multipliers, so 1 means no change in weight, less than 1 means less weight, and more than 1 means more weight. Setting something to zero makes that worthless. For example, if title weight is more than 1, words in titles are more significant than words elsewhere. If title weight is 0, words in titles won't make any difference to the search results."
|
422 |
msgstr "Diese Werte betreffen die Gewichtung von Dokumenten. Es sind Faktoren, 1 bedeutet keine Änderung in der Gewichtung, weniger als 1 hat eine geringere Gewichtung zur Folge und mehr als 1 eine höhere. Null macht das Element irrelevant bei der Gewichtung. Wenn zum Beispiel die Gewichtung des Titels mehr als 1 beträgt, dann werden Suchwörter die im Titel auftauchen als aussagekräftiger angesehen als wenn die Wörter woanders auftauche würden. Wenn die Gewichtung des Titels 0 ist, haben Suchbegriffe im Titel keinerlei Auswirkung auf die Gewichtung der Suchergebnisse."
|
423 |
|
424 |
+
# @ relevanssi
|
425 |
#: lib/interface.php:964
|
|
|
426 |
msgid "Element"
|
427 |
msgstr "Element"
|
428 |
|
429 |
+
# @ relevanssi
|
430 |
#: lib/interface.php:965
|
|
|
431 |
msgid "Weight"
|
432 |
msgstr "Gewichtung"
|
433 |
|
434 |
+
# @ relevanssi
|
435 |
#: lib/interface.php:966
|
|
|
436 |
msgid "Default weight"
|
437 |
msgstr "Standard Gewichtung"
|
438 |
|
439 |
+
# @ relevanssi
|
440 |
#: lib/interface.php:971
|
|
|
441 |
msgid "Post titles"
|
442 |
msgstr "Beitrags-Titel"
|
443 |
|
444 |
+
# @ relevanssi
|
445 |
#: lib/interface.php:983
|
|
|
446 |
msgid "Comment text"
|
447 |
msgstr "Kommentar-Texte"
|
448 |
|
449 |
+
# @ relevanssi
|
450 |
#: lib/interface.php:1006
|
|
|
451 |
msgid "Limit results to current language:"
|
452 |
msgstr "Resultate nur auf die gegenwärtige Sprache einschränken"
|
453 |
|
454 |
+
# @ relevanssi
|
455 |
#: lib/interface.php:1008
|
|
|
456 |
msgid "If this option is checked, Relevanssi will only return results in the current active language. Otherwise results will include posts in every language."
|
457 |
msgstr "Wenn diese Option aktiviert ist, zeigt Relevanssi nur Ergebnisse in der aktuell gewählten Sprache an. Andernfalls werden Resultate in allen Sprachen angezeigt."
|
458 |
|
459 |
+
# @ relevanssi
|
460 |
#: lib/interface.php:1014
|
|
|
461 |
msgid "Keep a log of user queries:"
|
462 |
msgstr "Suchanfragen der Besucher protokollieren:"
|
463 |
|
464 |
+
# @ relevanssi
|
465 |
#: lib/interface.php:1016
|
|
|
466 |
msgid "If checked, Relevanssi will log user queries. The log appears in 'User searches' on the Dashboard admin menu."
|
467 |
msgstr "Wenn aktiviert wird Relevanssi die Such-Anfragen Ihrer Besucher protokollieren. Das Protokoll finden Sie unter 'Suchanfragen' im Administrations-Menu Ihres Dashboards. "
|
468 |
|
469 |
+
# @ relevanssi
|
470 |
#: lib/interface.php:1020
|
|
|
471 |
msgid "Log the user's IP with the queries:"
|
472 |
msgstr "Die IP-Adresse der Besucher ebenfalls Protokollieren:"
|
473 |
|
474 |
+
# @ relevanssi
|
475 |
#: lib/interface.php:1022
|
|
|
476 |
msgid "If checked, Relevanssi will log user's IP-Adress with the queries."
|
477 |
msgstr "Wenn aktiviert, speichert Relevanssi die IP-Adressen Ihrer Besucher zusammen mit den Suchanfragen. (Diese Option verstößt gegen mehrere Datenschutzrichtlinien, Sie sollten sie nicht aktivieren)"
|
478 |
|
479 |
+
# @ relevanssi
|
480 |
#: lib/interface.php:1026
|
|
|
481 |
msgid "Don't log queries from these users:"
|
482 |
msgstr "Suchanfragen von diesen Benutzern nicht protokollieren:"
|
483 |
|
484 |
+
# @ relevanssi
|
485 |
#: lib/interface.php:1028
|
|
|
486 |
msgid "Comma-separated list of numeric user IDs or user login names that will not be logged."
|
487 |
msgstr "Komma-getrennte Liste mit numerischen IDs oder Login-Namen der Benutzer, die nicht Protokolliert werden sollen. "
|
488 |
|
489 |
+
# @ relevanssi
|
490 |
#: lib/interface.php:1032
|
|
|
491 |
msgid "If you enable logs, you can see what your users are searching for. You can prevent your own searches from getting in the logs with the omit feature."
|
492 |
msgstr "Durch die Protokollierung können Sie einsehen, was Ihre Besucher auf Ihrer Seite suchen. Durch die Eingabe 'Suchanfragen von...' können Sie Suchanfragen Ihrer eigenen Benutzer von der Protokollierung ausnehmen."
|
493 |
|
494 |
+
# @ relevanssi
|
495 |
#: lib/interface.php:1035
|
|
|
496 |
msgid "If you enable logs, you can see what your users are searching for. Logs are also needed to use the 'Did you mean?' feature. You can prevent your own searches from getting in the logs with the omit feature."
|
497 |
msgstr "Durch die Protokollierung können Sie einsehen, was Ihre Besucher auf Ihrer Seite suchen. Die Protokolle werden ebenso für die 'meinten Sie vielleicht'-Funktion benötigt. Durch die Eingabe 'Suchanfragen von...' können Sie Suchanfragen Ihrer eigenen Benutzer von der Protokollierung ausnehmen."
|
498 |
|
499 |
+
# @ relevanssi
|
500 |
#: lib/interface.php:1043
|
|
|
501 |
msgid "Restrict search to these categories and tags:"
|
502 |
msgstr "Suche nur in diesen Kategorien und Schlagwörtern:"
|
503 |
|
504 |
+
# @ relevanssi
|
505 |
#: lib/interface.php:1045
|
|
|
506 |
msgid "Enter a comma-separated list of category and tag IDs to restrict search to those categories or tags. You can also use <code><input type='hidden' name='cats' value='list of cats and tags' /></code> in your search form. The input field will \toverrun this setting."
|
507 |
msgstr "Tragen Sie eine Komma-getrennte Liste der numerischen Kategorie- oder Schlagwort-IDs ein, auf die Sie die Suche einschränken wollen. Sie können auch <code><input type='hidden' name='cats' value='Liste der Kategorien und Schlagwörter' /></code> in Ihr Suchformular einfügen. Das Eingabefeld wird die hier getätigten Einstelllungen überschreiben."
|
508 |
|
509 |
+
# @ relevanssi
|
510 |
#: lib/interface.php:1049
|
|
|
511 |
msgid "Exclude these categories and tags from search:"
|
512 |
msgstr "Diese Kategorien und Schlagwörter aus der Suche ausschließen:"
|
513 |
|
514 |
+
# @ relevanssi
|
515 |
#: lib/interface.php:1051
|
|
|
516 |
msgid "Enter a comma-separated list of category and tag IDs that are excluded from search results. You can exclude categories with the 'cat' input field by using negative values."
|
517 |
msgstr "Tragen Sie eine Komma-getrennte Liste der numerischen Kategorie- oder Schlagwort-IDs ein, die aus der Suche ausgeschlossen werden sollen. Sie können Kategorien auch durch negative IDs unter 'Suche nur in …' ausschließen."
|
518 |
|
519 |
+
# @ relevanssi
|
520 |
#: lib/interface.php:1055
|
|
|
521 |
msgid "Exclude these posts/pages from search:"
|
522 |
msgstr "Diese Beiträge / Seiten aus der Suche ausschließen:"
|
523 |
|
524 |
+
# @ relevanssi
|
525 |
#: lib/interface.php:1059
|
|
|
526 |
msgid "Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there). You can also use a checkbox on post/page edit pages to remove posts from index."
|
527 |
msgstr "Komma-getrennte Liste von numerischen Seiten- / Beitrags-IDs, die von der Suche ausgenommen werden sollen. Sie können auch die Checkbox beim Bearbeiten eines Beitrags / einer Seite benutzen um Dokumente aus dem Suchindex auszuschließen."
|
528 |
|
529 |
+
# @ relevanssi
|
530 |
#: lib/interface.php:1062
|
|
|
531 |
msgid "Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there)."
|
532 |
msgstr "Komma-Separierte Liste von numerischen Seiten- / Beitrags-IDs, die von der Suche ausgenommen werden sollen."
|
533 |
|
534 |
+
# @ relevanssi
|
535 |
#: lib/interface.php:1068
|
|
|
536 |
msgid "Respect exclude_from_search for custom post types:"
|
537 |
msgstr "exclude_from_search auch auf Benutzerdefinierte Beiträge anwenden:"
|
538 |
|
539 |
+
# @ relevanssi
|
540 |
#: lib/interface.php:1070
|
|
|
541 |
msgid "If checked, Relevanssi won't display posts of custom post types that have 'exclude_from_search' set to true. If not checked, Relevanssi will display anything that is indexed."
|
542 |
msgstr "Wenn aktiviert wird Relevanssi keine Benutzerdefinierten Betrags-Typen anzeigen, bei denen exclude_from_search auf true gesetzt ist. Andernfalls zeigt Relevanssi alles an, was indiziert worden ist."
|
543 |
|
544 |
+
# @ relevanssi
|
545 |
#: lib/interface.php:1072
|
|
|
546 |
msgid "Custom excerpts/snippets"
|
547 |
msgstr "Benutzerdefinierte Auszüge/Snippets"
|
548 |
|
549 |
+
# @ relevanssi
|
550 |
#: lib/interface.php:1074
|
|
|
551 |
msgid "Create custom search result snippets:"
|
552 |
msgstr "Neues Benutzerdefiniertes Suchergebnis-Snippet:"
|
553 |
|
554 |
+
# @ relevanssi
|
555 |
#: lib/interface.php:1076
|
|
|
556 |
msgid "If checked, Relevanssi will create excerpts that contain the search term hits. To make them work, make sure your search result template uses the_excerpt() to display post excerpts."
|
557 |
msgstr "Wenn aktiviert zeigt Relevanssi Auszüge an, in denen der Suchtreffer zu sehen ist. Das funktioniert nur, wenn Ihr Theme die Funktion 'the_excerpt()' benutzt um Textauszüge anzuzeigen."
|
558 |
|
559 |
+
# @ relevanssi
|
560 |
#: lib/interface.php:1078
|
|
|
561 |
msgid "Note: Building custom excerpts can be slow. If you are not actually using the excerpts, make sure you disable the option."
|
562 |
msgstr "Anmerkung: Benutzerdefinierte Auszüge zu erzeugen kann ziemlich lange dauern. Wenn Sie ohnehin keine Textauszüge eintragen, sollten Sie diese Option deaktivieren."
|
563 |
|
564 |
+
# @ relevanssi
|
565 |
#: lib/interface.php:1080
|
|
|
566 |
msgid "Length of the snippet:"
|
567 |
msgstr "Länge des Snippets:"
|
568 |
|
569 |
+
# @ relevanssi
|
570 |
#: lib/interface.php:1083
|
|
|
571 |
msgid "characters"
|
572 |
msgstr "Zeichen"
|
573 |
|
574 |
+
# @ relevanssi
|
575 |
#: lib/interface.php:1084
|
|
|
576 |
msgid "words"
|
577 |
msgstr "Wörter"
|
578 |
|
579 |
+
# @ relevanssi
|
580 |
#: lib/interface.php:1086
|
|
|
581 |
msgid "This must be an integer."
|
582 |
msgstr "Bitte eine ganze Zahl eintragen"
|
583 |
|
584 |
+
# @ relevanssi
|
585 |
#: lib/interface.php:1090
|
|
|
586 |
msgid "Allowable tags in excerpts:"
|
587 |
msgstr "Erlaubte HTML-Tags in Auszügen:"
|
588 |
|
589 |
+
# @ relevanssi
|
590 |
#: lib/interface.php:1093
|
|
|
591 |
msgid "List all tags you want to allow in excerpts, without any whitespace. For example: '<p><a><strong>'."
|
592 |
msgstr "Liste alle HTML-Tags, die Sie in Auszügen erlauben wollen, ohne Leerzeichen dazwischen. Z.B.: '<p><a><strong>'."
|
593 |
|
594 |
+
# @ relevanssi
|
595 |
#: lib/interface.php:1097
|
|
|
596 |
msgid "Show breakdown of search hits in excerpts:"
|
597 |
msgstr "Alle Trefferstellen in den Auszügen anzeigen:"
|
598 |
|
599 |
+
# @ relevanssi
|
600 |
#: lib/interface.php:1099
|
|
|
601 |
msgid "Check this to show more information on where the search hits were made. Requires custom snippets to work."
|
602 |
msgstr "Zeigt mehr Informationen, an welchen Stellen die Suchbegriffe im Text gefunden wurden. Erfordert benutzerdefinierte Snippets."
|
603 |
|
604 |
+
# @ relevanssi
|
605 |
#: lib/interface.php:1103
|
|
|
606 |
msgid "The breakdown format:"
|
607 |
msgstr "Format der Trefferstellen:"
|
608 |
|
609 |
+
# @ relevanssi
|
610 |
#: lib/interface.php:1105
|
611 |
#, php-format
|
|
|
612 |
msgid "Use %body%, %title%, %tags% and %comments% to display the number of hits (in different parts of the post), %total% for total hits, %score% to display the document weight and %terms% to show how many hits each search term got. No double quotes (\") allowed!"
|
613 |
msgstr "Benutzen Sie %body%, %title%, %tags% und %comments% um die Anzahl der Treffen anzuzeigen (in den unterschiedlichen Stellen des Dokuments), %total% für die Gesamte Anzahl an Treffern, %score% für die Gewichtung des Dokuments, %terms% zur Anzeige, wieviele Treffer jeder Suchbegriff erbracht hat. Es sind keine Doppelten Anführungszeichen (\") erlaubt!"
|
614 |
|
615 |
+
# @ relevanssi
|
616 |
#: lib/interface.php:1107
|
|
|
617 |
msgid "Search hit highlighting"
|
618 |
msgstr "Suchergebnis hervorheben"
|
619 |
|
620 |
+
# @ relevanssi
|
621 |
#: lib/interface.php:1109
|
|
|
622 |
msgid "First, choose the type of highlighting used:"
|
623 |
msgstr "Erstens: Art der Hervorhebung auswählen:"
|
624 |
|
625 |
+
# @ relevanssi
|
626 |
#: lib/interface.php:1112
|
|
|
627 |
msgid "Highlight query terms in search results:"
|
628 |
msgstr "Suchbegriffe in den Ergebnissen hervorheben:"
|
629 |
|
630 |
+
# @ relevanssi
|
631 |
#: lib/interface.php:1114
|
|
|
632 |
msgid "No highlighting"
|
633 |
msgstr "Keine Hervorhebung"
|
634 |
|
635 |
+
# @ relevanssi
|
636 |
#: lib/interface.php:1118
|
|
|
637 |
msgid "Text color"
|
638 |
msgstr "Textfarbe"
|
639 |
|
640 |
+
# @ relevanssi
|
641 |
#: lib/interface.php:1119
|
|
|
642 |
msgid "Background color"
|
643 |
msgstr "Hintergrundfarbe"
|
644 |
|
645 |
+
# @ relevanssi
|
646 |
#: lib/interface.php:1120
|
|
|
647 |
msgid "CSS Style"
|
648 |
msgstr "CSS-Style"
|
649 |
|
650 |
+
# @ relevanssi
|
651 |
#: lib/interface.php:1121
|
|
|
652 |
msgid "CSS Class"
|
653 |
msgstr "CSS-Klasse"
|
654 |
|
655 |
+
# @ relevanssi
|
656 |
#: lib/interface.php:1123
|
|
|
657 |
msgid "Highlighting isn't available unless you use custom snippets"
|
658 |
msgstr "Hervorhebung ist ohne Benutzerdefinierte Snippets nicht verfügbar"
|
659 |
|
660 |
+
# @ relevanssi
|
661 |
#: lib/interface.php:1127
|
|
|
662 |
msgid "Highlight query terms in result titles too:"
|
663 |
msgstr "Suchbegriffe im Titel ebenfalls hervorheben:"
|
664 |
|
665 |
+
# @ relevanssi
|
666 |
#: lib/interface.php:1133
|
|
|
667 |
msgid "Highlight query terms in documents from local searches:"
|
668 |
msgstr "Suchbegriffe in aufgerufenen Dokumenten ebenfalls hervorheben:"
|
669 |
|
670 |
+
# @ relevanssi
|
671 |
#: lib/interface.php:1135
|
|
|
672 |
msgid "Highlights hits when user opens the post from search results. This is based on HTTP referrer, so if that's blocked, there'll be no highlights."
|
673 |
msgstr "Hebt die Suchbegriffe hervor, wenn der Besucher ein Dokument aus einem Suchergebnis heraus öffnet. Diese Funktion basiert auf Abfrage des HTTP-Referrers, wenn der blockiert wird, gibt es auch keine Hervorhebung."
|
674 |
|
675 |
+
# @ relevanssi
|
676 |
#: lib/interface.php:1141
|
|
|
677 |
msgid "Highlight query terms in comments:"
|
678 |
msgstr "Suchbegriffe in Kommentaren hervorheben:"
|
679 |
|
680 |
+
# @ relevanssi
|
681 |
#: lib/interface.php:1143
|
|
|
682 |
msgid "Highlights hits in comments when user opens the post from search results."
|
683 |
msgstr "Hebt die Suchbegriffe auch in den Kommentaren hervor, wenn der Besucher eine Seite aus dem Suchergebnis heraus öffnet."
|
684 |
|
685 |
+
# @ relevanssi
|
686 |
#: lib/interface.php:1147
|
|
|
687 |
msgid "Uncheck this if you use non-ASCII characters:"
|
688 |
msgstr "Deaktivieren, wenn Sie nicht-ASCII-Zeichen verwenden."
|
689 |
|
690 |
+
# @ relevanssi
|
691 |
#: lib/interface.php:1149
|
|
|
692 |
msgid "If you use non-ASCII characters (like Cyrillic alphabet) and the highlights don't work, uncheck this option to make highlights work."
|
693 |
msgstr "Wenn Sie Nicht-ASCII-Zeichen verwenden (wie z.B. im kyrillischen Alphabet) und die Hervorhebung nicht funktioniert, deaktivieren Sie diese Option bitte."
|
694 |
|
695 |
+
# @ relevanssi
|
696 |
#: lib/interface.php:1154
|
|
|
697 |
msgid "Then adjust the settings for your chosen type:"
|
698 |
msgstr "Dann: nehmen Sie die Einstellungen für die gewählte Hervorhebung vor"
|
699 |
|
700 |
+
# @ relevanssi
|
701 |
#: lib/interface.php:1158
|
|
|
702 |
msgid "Text color for highlights:"
|
703 |
msgstr "Textfarbe für Hervorhebungen:"
|
704 |
|
705 |
+
# @ relevanssi
|
706 |
+
#: lib/interface.php:1160 lib/interface.php:1166
|
|
|
707 |
msgid "Use HTML color codes (#rgb or #rrggbb)"
|
708 |
msgstr "Bitte HTML-Farbcodes verwenden (#rgb oder #rrggbb)"
|
709 |
|
710 |
+
# @ relevanssi
|
711 |
#: lib/interface.php:1164
|
|
|
712 |
msgid "Background color for highlights:"
|
713 |
msgstr "Hintergrundfarbe für Hervorhebungen:"
|
714 |
|
715 |
+
# @ relevanssi
|
716 |
#: lib/interface.php:1170
|
|
|
717 |
msgid "CSS style for highlights:"
|
718 |
msgstr "CSS-Style für Hervorhebungen:"
|
719 |
|
720 |
+
# @ relevanssi
|
721 |
#: lib/interface.php:1172
|
|
|
722 |
msgid "You can use any CSS styling here, style will be inserted with a <span>"
|
723 |
msgstr "Sie können beliebiges CSS eintragen. Die Styles werden durch ein <span> eingefügt."
|
724 |
|
725 |
+
# @ relevanssi
|
726 |
#: lib/interface.php:1176
|
|
|
727 |
msgid "CSS class for highlights:"
|
728 |
msgstr "CSS-Klasse für Hervorhebungen:"
|
729 |
|
730 |
+
# @ relevanssi
|
731 |
#: lib/interface.php:1178
|
|
|
732 |
msgid "Name a class here, search results will be wrapped in a <span> with the class"
|
733 |
msgstr "Benennen Sie hier eine CSS-Klasse. Der Suchbegriff wird von einem <span> mit dieser Klasse umschlossen werden."
|
734 |
|
735 |
+
# @ relevanssi
|
736 |
+
#: lib/interface.php:1185 lib/interface.php:1364
|
|
|
737 |
msgid "Save the options"
|
738 |
msgstr "Einstellungen sichern"
|
739 |
|
740 |
+
# @ relevanssi
|
741 |
#: lib/interface.php:1189
|
|
|
742 |
msgid "Choose post types to index:"
|
743 |
msgstr "Welche Beitrags-Typen sollen indiziert werden:"
|
744 |
|
745 |
+
# @ relevanssi
|
746 |
#: lib/interface.php:1194
|
|
|
747 |
msgid "Type"
|
748 |
msgstr "Typ"
|
749 |
|
750 |
+
# @ relevanssi
|
751 |
+
#: lib/interface.php:1195 lib/interface.php:1241
|
|
|
752 |
msgid "Index"
|
753 |
msgstr "Index"
|
754 |
|
755 |
+
# @ relevanssi
|
756 |
+
#: lib/interface.php:1196 lib/interface.php:1242
|
|
|
757 |
msgid "Public?"
|
758 |
msgstr "Öffentlich?"
|
759 |
|
760 |
+
# @ relevanssi
|
761 |
+
#: lib/interface.php:1213 lib/interface.php:1256
|
762 |
#, php-format
|
|
|
763 |
msgid "%s"
|
764 |
msgstr "%s"
|
765 |
|
766 |
+
# @ relevanssi
|
767 |
+
#: lib/interface.php:1214 lib/interface.php:1257
|
|
|
768 |
msgid "yes"
|
769 |
msgstr "Ja"
|
770 |
|
771 |
+
# @ relevanssi
|
772 |
+
#: lib/interface.php:1214 lib/interface.php:1257
|
|
|
773 |
msgid "no"
|
774 |
msgstr "Nein"
|
775 |
|
776 |
+
# @ relevanssi
|
777 |
#: lib/interface.php:1235
|
|
|
778 |
msgid "Choose taxonomies to index:"
|
779 |
msgstr "Taxonomien für die Indizierung auswählen:"
|
780 |
|
781 |
+
# @ relevanssi
|
782 |
#: lib/interface.php:1240
|
|
|
783 |
msgid "Taxonomy"
|
784 |
msgstr "Taxonomie"
|
785 |
|
786 |
+
# @ relevanssi
|
787 |
#: lib/interface.php:1277
|
|
|
788 |
msgid "If you check a taxonomy here, the terms for that taxonomy are indexed with the posts. If you for example choose \"post_tag\", searching for tags will find all posts that have the tag."
|
789 |
msgstr "Wenn Sie eine Taxonomie hier aktivieren, werden all ihre Begriffe zusammen mit dem Beitrag indiziert. Wenn Sie z.B. \"post_tag\" auswählen, wird die Suche nach einem Tag auch die Beiträge finden, die diesem Tag zugeordnet sind."
|
790 |
|
791 |
+
# @ relevanssi
|
792 |
#: lib/interface.php:1281
|
|
|
793 |
msgid "Minimum word length to index"
|
794 |
msgstr "Mindestlänge von Wörtern im Index"
|
795 |
|
796 |
+
# @ relevanssi
|
797 |
#: lib/interface.php:1283
|
|
|
798 |
msgid "Words shorter than this number will not be indexed."
|
799 |
msgstr "Kürzere Wörter werden nicht indiziert."
|
800 |
|
801 |
+
# @ relevanssi
|
802 |
#: lib/interface.php:1289
|
|
|
803 |
msgid "Expand shortcodes in post content:"
|
804 |
msgstr "Shortcodes im Beitrags-Inhalt ausführen:"
|
805 |
|
806 |
+
# @ relevanssi
|
807 |
#: lib/interface.php:1291
|
|
|
808 |
msgid "If checked, Relevanssi will expand shortcodes in post content before indexing. Otherwise shortcodes will be stripped. If you use shortcodes to include dynamic content, Relevanssi will not keep the index updated, the index will reflect the status of the shortcode content at the moment of indexing."
|
809 |
msgstr "Wenn aktiviert wird Relevanssi die Shortcodes in den Beiträgen ausführen. Z.B. gelangen Bildzuschriften in Galerien dadurch in den Suchindex. Ein nachträgliches aktivieren dieser Option aktualisiert nicht den Suchindex, in dem Fall müssen Sie den Index aktualisieren. "
|
810 |
|
811 |
+
# @ relevanssi
|
812 |
#: lib/interface.php:1297
|
|
|
813 |
msgid "Index and search your posts' authors:"
|
814 |
msgstr "Beitrags-Autoren indizieren und suchen:"
|
815 |
|
816 |
+
# @ relevanssi
|
817 |
#: lib/interface.php:1299
|
|
|
818 |
msgid "If checked, Relevanssi will also index and search the authors of your posts. Author display name will be indexed. Remember to rebuild the index if you change this option!"
|
819 |
msgstr "Wenn aktiviert wird Relavanssi auch auf den Autorenseiten suchen. Die Namen der Autoren werden dabei indiziert. Bitte denken Sie daran den Index neu aufzubauen, wenn Sie diese Option aktivieren."
|
820 |
|
821 |
+
# @ relevanssi
|
822 |
#: lib/interface.php:1303
|
|
|
823 |
msgid "Index and search post excerpts:"
|
824 |
msgstr "Auszüge indizieren und durchsuchen:"
|
825 |
|
826 |
+
# @ relevanssi
|
827 |
#: lib/interface.php:1305
|
|
|
828 |
msgid "If checked, Relevanssi will also index and search the excerpts of your posts.Remember to rebuild the index if you change this option!"
|
829 |
msgstr "Wenn aktiviert wird Relavanssi auch auf den Auszügen Ihrer Beiträge. Bitte denken Sie daran den Index neu aufzubauen, wenn Sie diese Option aktivieren."
|
830 |
|
831 |
+
# @ relevanssi
|
832 |
#: lib/interface.php:1309
|
|
|
833 |
msgid "Index and search these comments:"
|
834 |
msgstr "Diese Kommentaren indizieren und durchsuchen:"
|
835 |
|
836 |
+
# @ relevanssi
|
837 |
#: lib/interface.php:1311
|
|
|
838 |
msgid "none"
|
839 |
msgstr "keine"
|
840 |
|
841 |
+
# @ relevanssi
|
842 |
#: lib/interface.php:1312
|
|
|
843 |
msgid "normal"
|
844 |
msgstr "Normal"
|
845 |
|
846 |
+
# @ relevanssi
|
847 |
#: lib/interface.php:1313
|
|
|
848 |
msgid "all"
|
849 |
msgstr "Alle"
|
850 |
|
851 |
+
# @ relevanssi
|
852 |
#: lib/interface.php:1315
|
|
|
853 |
msgid "Relevanssi will index and search ALL (all comments including track- & pingbacks and custom comment types), NONE (no comments) or NORMAL (manually posted comments on your blog).<br />Remember to rebuild the index if you change this option!"
|
854 |
msgstr "Relevanssi wird ALLE (alle Kommentare einschließlich Track- & Pingbacks und Benutzerdefinierte Kommentartype), KEINE (Keine Kommentare) der NORMAL (von Besuchern gepostete Kommentare).<br />Bitte denken Sie daran den Index neu aufzubauen, wenn Sie diese Option aktivieren."
|
855 |
|
856 |
+
# @ relevanssi
|
857 |
#: lib/interface.php:1319
|
|
|
858 |
msgid "Custom fields to index:"
|
859 |
msgstr "Benutzerdefinierte Felder indizieren:"
|
860 |
|
861 |
+
# @ relevanssi
|
862 |
#: lib/interface.php:1321
|
|
|
863 |
msgid "A comma-separated list of custom fields to include in the index. Set to 'visible' to index all visible custom fields and to 'all' to index all custom fields, also those starting with a '_' character."
|
864 |
+
msgstr "Eine Komma-getrennte Liste von Benutzerdefinierten Feldern die in den Index aufgenommen werden sollen. Wählen Sie ’visible’ um alle sichtbaren Benutzerd. Felder aufzunehmen, oder ’all’ um auch solche aufzunehmen, die mit einem '_' anfangen."
|
865 |
|
866 |
+
# @ relevanssi
|
867 |
#: lib/interface.php:1331
|
|
|
868 |
msgid "Save indexing options and build the index"
|
869 |
msgstr "Einstellungen sichern und Index aufbauen"
|
870 |
|
871 |
+
# @ relevanssi
|
872 |
#: lib/interface.php:1337
|
|
|
873 |
msgid ""
|
874 |
"Warning: In many cases caching is not useful, and in some cases can be even harmful. Do not\n"
|
875 |
"\tactivate cache unless you have a good reason to do so."
|
876 |
msgstr "Warnung: In vielen Fällen ist das Caching nicht sehr vorteilhaft und manchen Fälle sogar nachteilig. Aktivieren Sie den Cache bitte nicht ohne einen sehr guten Grund!"
|
877 |
|
878 |
+
# @ relevanssi
|
879 |
#: lib/interface.php:1340
|
|
|
880 |
msgid "Enable result and excerpt caching:"
|
881 |
msgstr "Ergebnis- und Auszugs-Cache aktivieren:"
|
882 |
|
883 |
+
# @ relevanssi
|
884 |
#: lib/interface.php:1342
|
|
|
885 |
msgid "If checked, Relevanssi will cache search results and post excerpts."
|
886 |
msgstr "Wenn aktiviert wird Relevanssi Suchergebnisse und Auszüge cachen."
|
887 |
|
888 |
+
# @ relevanssi
|
889 |
#: lib/interface.php:1346
|
|
|
890 |
msgid "Cache expire (in seconds):"
|
891 |
msgstr "Cache läuft ab (in Sekunden):"
|
892 |
|
893 |
+
# @ relevanssi
|
894 |
#: lib/interface.php:1348
|
|
|
895 |
msgid "86400 = day"
|
896 |
msgstr "86400 = 1 Tag"
|
897 |
|
898 |
+
# @ relevanssi
|
899 |
#: lib/interface.php:1352
|
|
|
900 |
msgid "Entries in the cache"
|
901 |
msgstr "Einträge im Cache"
|
902 |
|
903 |
+
# @ relevanssi
|
904 |
#: lib/interface.php:1356
|
|
|
905 |
msgid "Clear all caches"
|
906 |
msgstr "Cache löschen"
|
907 |
|
908 |
+
# @ relevanssi
|
909 |
#: lib/interface.php:1362
|
|
|
910 |
msgid "Add synonyms here in 'key = value' format. When searching with the OR operator, any search of 'key' will be expanded to include 'value' as well. Using phrases is possible. The key-value pairs work in one direction only, but you can of course repeat the same pair reversed."
|
911 |
msgstr "Synonyme im 'key = value' Format hinzufügen. Wenn mit dem OR-Operator gesucht wird, wird jede Suche nach 'key' auch auf 'value' ausgedehnt. Die Benutzung von Sätzen oder Phrasen ist auch möglich. Die Key-Value-Paare funktionieren nur in eine Richtung, aber Sie können natürlich weitere Paare mit vertauschten Werten eintragen."
|
912 |
|
913 |
+
# @ relevanssi
|
914 |
#: lib/interface.php:1385
|
|
|
915 |
msgid "<p>Enter a word here to add it to the list of stopwords. The word will automatically be removed from the index, so re-indexing is not necessary. You can enter many words at the same time, separate words with commas.</p>"
|
916 |
msgstr "<p>Tragen Sie ein Wort ein um der Liste der Stoppwörter anzufügen. Das Wort wird automatisch aus dem Index gelöscht, daher brauchen Sie den Index nicht erneut aufzubauen. Sie können mehrere Wörter auf einmal durch Kommata getrennt eintragen.</p>"
|
917 |
|
918 |
+
# @ relevanssi
|
919 |
#: lib/interface.php:1387
|
|
|
920 |
msgid "Stopword(s) to add: "
|
921 |
msgstr "Stoppwörter hinzufügen:"
|
922 |
|
923 |
+
# @ relevanssi
|
924 |
#: lib/interface.php:1388
|
|
|
925 |
msgid "Add"
|
926 |
msgstr "Hinzufügen"
|
927 |
|
928 |
+
# @ relevanssi
|
929 |
#: lib/interface.php:1391
|
|
|
930 |
msgid "<p>Here's a list of stopwords in the database. Click a word to remove it from stopwords. Removing stopwords won't automatically return them to index, so you need to re-index all posts after removing stopwords to get those words back to index."
|
931 |
msgstr "Liste der Stoppwörter in der Datenbank. Klicken Sie auf ein Wort um es aus der Stoppwort-Liste zu entfernen. Das Entfernen bringt die Stoppwörter nicht automatisch zurück in den Index, Sie müssen daher nach dem Entfernen der Stoppwörter den Index neu aufbauen.."
|
932 |
|
933 |
+
# @ relevanssi
|
934 |
#: lib/interface.php:1417
|
|
|
935 |
msgid "Remove all stopwords"
|
936 |
msgstr "Alle Stoppwörter entfernen"
|
937 |
|
938 |
+
# @ relevanssi
|
939 |
#: lib/interface.php:1423
|
|
|
940 |
msgid "Here's a list of stopwords you can use to export the stopwords to another blog."
|
941 |
msgstr "Eine Liste von Stoppwörtern zum Export in einen anderen Blog."
|
942 |
|
943 |
+
# @ relevanssi
|
944 |
#: lib/uninstall.php:41
|
|
|
945 |
msgid "Data wiped clean, you can now delete the plugin."
|
946 |
msgstr "Alle Daten sauber gelöscht. Sie können das Plugin jetzt löschen."
|
947 |
|
948 |
+
# @ relevanssi
|
949 |
#: relevanssi.php:296
|
|
|
950 |
msgid "Tag weight:"
|
951 |
msgstr "Schlüsselwort Gewichtung:"
|
952 |
|
953 |
+
# @ relevanssi
|
954 |
#: relevanssi.php:311
|
|
|
955 |
msgid "Category weight:"
|
956 |
msgstr "Kategorie Gewichtung:"
|
957 |
|
958 |
+
# @ relevanssi
|
959 |
#: lib/interface.php:1004
|
|
|
960 |
msgid "WPML/Polylang compatibility"
|
961 |
msgstr "WPML/Polylang Kompatibilität"
|
|
relevanssi.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Relevanssi
|
4 |
Plugin URI: http://www.relevanssi.com/
|
5 |
Description: This plugin replaces WordPress search with a relevance-sorting search.
|
6 |
-
Version: 3.5.
|
7 |
Author: Mikko Saari
|
8 |
Author URI: http://www.mikkosaari.fi/
|
9 |
*/
|
@@ -86,13 +86,14 @@ function relevanssi_didyoumean($query, $pre, $post, $n = 5, $echo = true) {
|
|
86 |
}
|
87 |
}
|
88 |
|
|
|
89 |
if ($distance > 0) {
|
90 |
$url = get_bloginfo('url');
|
91 |
$url = esc_attr(add_query_arg(array(
|
92 |
's' => urlencode($closest)
|
93 |
|
94 |
), $url ));
|
95 |
-
$url = apply_filters('relevanssi_didyoumean_url', $url);
|
96 |
$result = apply_filters('relevanssi_didyoumean_suggestion', "$pre<a href='$url'>$closest</a>$post");
|
97 |
if ($echo) echo $result;
|
98 |
}
|
@@ -376,7 +377,7 @@ better search experience for your users?</p>
|
|
376 |
<p><strong>Go Premium!</strong> Buy Relevanssi Premium. See <a href="http://www.relevanssi.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=features">feature
|
377 |
comparison</a> and <a href="http://www.relevanssi.com/buy-premium/?utm_source=plugin&utm_medium=link&utm_campaign=license">license prices</a>.</p>
|
378 |
|
379 |
-
<p><strong><a href="http://
|
380 |
</div>
|
381 |
</div>
|
382 |
</div>
|
3 |
Plugin Name: Relevanssi
|
4 |
Plugin URI: http://www.relevanssi.com/
|
5 |
Description: This plugin replaces WordPress search with a relevance-sorting search.
|
6 |
+
Version: 3.5.4
|
7 |
Author: Mikko Saari
|
8 |
Author URI: http://www.mikkosaari.fi/
|
9 |
*/
|
86 |
}
|
87 |
}
|
88 |
|
89 |
+
$result = null;
|
90 |
if ($distance > 0) {
|
91 |
$url = get_bloginfo('url');
|
92 |
$url = esc_attr(add_query_arg(array(
|
93 |
's' => urlencode($closest)
|
94 |
|
95 |
), $url ));
|
96 |
+
$url = apply_filters('relevanssi_didyoumean_url', $url, $query, $closest);
|
97 |
$result = apply_filters('relevanssi_didyoumean_suggestion', "$pre<a href='$url'>$closest</a>$post");
|
98 |
if ($echo) echo $result;
|
99 |
}
|
377 |
<p><strong>Go Premium!</strong> Buy Relevanssi Premium. See <a href="http://www.relevanssi.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=features">feature
|
378 |
comparison</a> and <a href="http://www.relevanssi.com/buy-premium/?utm_source=plugin&utm_medium=link&utm_campaign=license">license prices</a>.</p>
|
379 |
|
380 |
+
<p><strong><a href="http://www.relevanssi.com/buy-premium/?utm_source=plugin&utm_medium=link&utm_campaign=license">Buy Premium now »</a></strong></p>
|
381 |
</div>
|
382 |
</div>
|
383 |
</div>
|