WordPress.org

Forums

Relevanssi and Pages (28 posts)

  1. billsaysthis
    Member
    Posted 6 years ago #

    Is there any news of an update to Relevanssi that fixes the problem with pages listed on its page in the Plugin Directory on the Other Notes tab?

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Posted 6 years ago #

    No, I haven't yet figured it out. Then again, I've been too busy with other projects to really try and tackle it.

    It's a nasty problem, particularly as most of the code it relates to is pretty much copied from wpSearch, which doesn't have the problem.

    I'll release a new version once I get the bug fixed.

  3. Mikko Saari
    Member
    Posted 6 years ago #

    Thanks for giving me a push. The bug is now fixed. The version 1.1 (just uploaded to the repository) handles pages correctly.

  4. billsaysthis
    Member
    Posted 6 years ago #

    Terrific! I'll give it a go.

  5. billsaysthis
    Member
    Posted 6 years ago #

    Uh oh. Using WP 2.8 I get the following error on activation:

    Plugin could not be activated because it triggered a fatal error.

    Parse error: parse error in C:\Program Files\EasyPHP 3.0\www\wp\wp-content\plugins\relevanssi\relevanssi.php on line 452

  6. billsaysthis
    Member
    Posted 6 years ago #

    Fixing that by removing the if test (since I know I have later than 2.8dev) I get another error:

    Plugin could not be activated because it triggered a fatal error.

    $stopwords = array( "a", "about", "above", "above", "across", "after", "afterwards", "again", "against", "all", "almost", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst", "amoungst", "amount", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anyway", "anywhere", "are", "around", "as", "at", "back", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "bill", "both", "bottom", "but", "by", "call", "can", "cannot", "cant", "co", "con", "could", "couldnt", "cry", "de", "describe", "detail", "do", "done", "down", "due", "during", "each", "eg", "eight", "either", "eleven", "else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had", "has", "hasnt", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "him", "himself", "his", "how", "however", "hundred", "ie", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "its", "itself", "keep", "last", "latter", "latterly", "least", "less", "ltd", "made", "many", "may", "me", "meanwhile", "might", "mill", "mine", "more", "moreover", "most", "mostly", "move", "much", "must", "my", "myself", "name", "namely", "neither", "never", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own", "part", "per", "perhaps", "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore", "therein", "thereupon", "these", "they", "thickv", "thin", "third", "this", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence", "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would", "yet", "you", "your", "yours", "yourself", "yourselves", "the" ); ?>

  7. Mikko Saari
    Member
    Posted 6 years ago #

    I've just committed another small bug fix release. The English stopword file was missing <?php from the beginning. Hadn't run into that before as I had only tested this on my Finnish-language blogs.

    Can you tell me I'm a newbie developer?

    So, either install the 1.1.2 version or manually add <?php to the beginning of the stopwords file. Sorry for the trouble =)

  8. billsaysthis
    Member
    Posted 6 years ago #

    1.1.2 no longer throws those errors but I'm not sure the index building is doing the right thing. I have zero posts and about a dozen pages (none of which has all that much text) but 20 minutes after clicking the build index button the Options page is still blank.

  9. billsaysthis
    Member
    Posted 6 years ago #

    Ok, maybe I was too fast to post that last comment ;)

    I refreshed the options page, clicked the Continue Indexing button and it finished a few seconds later.

    However I would suggest adding some sort of Ajax progress indicator, if only to show that work is actually being done.

  10. billsaysthis
    Member
    Posted 6 years ago #

    Also, is there a means to make the search results show an except that includes the text which caused the result to be included rather than the default first 55 characters?

  11. Mikko Saari
    Member
    Posted 6 years ago #

    I'll have to take a look at the progress indicator, sounds like a good idea.

    The plugin doesn't do anything about the presentation of results, it just returns a list of post objects and the search result template does the rest.

    However, a possible approach would be to modify the posts a bit, perhaps change the excerpt... But yes, I think it's feasible.

  12. Mikko Saari
    Member
    Posted 6 years ago #

    I just committed 1.2 to the repository. It still doesn't have the progress indicator, but:

    It can create custom search result snippets that show the part (well, a part) of the post which caused the post to get caught. It can also highlight query terms in the results.

    Check it out, I think it turned out quite well.

  13. billsaysthis
    Member
    Posted 6 years ago #

    Very nice change! One small tweak I would appreciate is wrapping the search term in a span with a specific class (e.g. <span class="actual-search-term">example</span> so it can be styled to match our site.

    Thanks much! When this site is published I will let you know so you can point to it as an English language example (if you wish, I'm just responding to the plugin page note about wanting some).

  14. Mikko Saari
    Member
    Posted 6 years ago #

    You can do whatever styling you want if you choose the CSS option, but using a class is a somewhat cleaner option, especially if you want to do more than one or two things. It did cross my mind after I released the current version, and I'll add it in the next version.

    I'm on vacation this week and have some things I want to add to the plugin before I get back to work next week, so there'll be at least one release in the next few days.

    Sure, let me know and I'll add the site on the list. I really appreciate your activity and feedback, it makes development so much more interesting to have responsive users (responsive, but not too demanding, hah).

  15. billsaysthis
    Member
    Posted 6 years ago #

    Enjoy the vacation! I'll look forward to this when you have the chance to update.

    Note that I agree a class is best, but I think the span is also necessary, otherwise (and I may misunderstand you here, and you already agree with me) what is the span applied to?

  16. Mikko Saari
    Member
    Posted 6 years ago #

    The current CSS option asks for style and wraps the search term with a <span style='custom css style here'>search term</span>. So you can use any CSS style you want.

    What you're suggesting, <span class='custom css class here'>search term</span>, does pretty much the same thing, but some users might prefer this way to do it. Allowing both is trivial, so of course that's the best way.

  17. billsaysthis
    Member
    Posted 6 years ago #

    Sorry, I didn't notice the dropdown box for choosing the highlight.

  18. William Bowles
    Member
    Posted 6 years ago #

    Got this error message after installing relevanssi:

    [Sat Jul 11 07:00:16 2009] [error] [client 82.148.44.32] WordPress database
    error Duplicate entry 'the' for key 1 for query IN
    SERT INTO wp_relevanssi_stopwords (stopword) VALUES ('the') made by
    activate_plugin, do_action, call_user_func_array, relevans
    si_install, relevanssi_populate_stopwords, referer:

    BTW, still on 2.7.1

    Bill

  19. billsaysthis
    Member
    Posted 6 years ago #

    Updated to 1.3.2, thanks!

    Getting this error searching on a term which WAS in the common terms list and which I deleted (that is, clicked the red circle next to it):

    Warning: array_keys() [function.array-keys]: The first argument should be an array in C:\Program Files\EasyPHP 3.0\www\wp\wp-content\plugins\relevanssi\relevanssi.php on line 260

  20. billsaysthis
    Member
    Posted 6 years ago #

    Also, the default name for the query term highlight CSS class, search-results, is also the name used for the body class in search.php. I changed mine to search-query-term in the settings page but perhaps you should choose a default name that's in the Relevanssi 'namespace' such as rlv-query-term or similar?

  21. Mikko Saari
    Member
    Posted 6 years ago #

    Creative-i: Does Relevanssi still work for you? If not, here's a quick fix if you don't mind editing code, or you can just download the next version. On line 162, add word IGNORE to the INSERT statement like this:

    $q = $wpdb->prepare("INSERT <strong>IGNORE</strong> INTO $stopword_table (stopword) VALUES (%s)", trim($word));

    Then install Relevanssi again.

    billsaysthis, good catch. I'm pretty good at assuming arrays. That bit needs a security check to skip the search if all search terms are stop words.

    Also, a good point on the CSS class. I'll change the default.

  22. Mikko Saari
    Member
    Posted 6 years ago #

    1.3.3 is now out, with these and few other fixes.

  23. billsaysthis
    Member
    Posted 6 years ago #

    I don't get the array error with 1.3.3 but searching on the word I described above (deleted from the common words list) returns zero results, is this the expected?

  24. Mikko Saari
    Member
    Posted 6 years ago #

    Yes, that's what's supposed to happen. Once you add a word to the stop word list, it is removed from index and cannot be used as a search term. Actually, come to think of it, I should probably still allow searching with stop words, because the fuzzy search may still cause hits.

    Anyway, I've been meaning to add some tools to look at the current stop word list and remove words that are actually necessary from the list.

  25. William Bowles
    Member
    Posted 6 years ago #

    Msaari:

    I just upgraded to 2.8.1 and haven't gotten around to upgrading Relevanssi yet (still trying to figure out why my RSS feeds aren't working), but I'll let you know how it goes.

    Bill

  26. William Bowles
    Member
    Posted 6 years ago #

    Okay, it seems to be working as advertized.

    Bill

  27. globalmax1
    Member
    Posted 6 years ago #

    Hi. On my Dashboard it is saying,
    Relevanssi needs attention; Remember to build the index
    I am not sure what I need to do?
    can you help
    Jean

  28. Mikko Saari
    Member
    Posted 6 years ago #

    Go to Settings -> Relevanssi and click "Save indexing options and build the index".

    Because building the index can take a long time, Relevanssi doesn't do it automatically when the plugin is installed.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags