Relevanssi - A Better Search
bug/error notice with short terms (2 posts)

  1. thomask
    Posted 4 years ago #

    when setting up "minimum word length" to index to anything above 1, and then trying to search shorter term, it returns
    1. this error notice
    Notice: Undefined variable: doc_weight in /var/www/vhosts/money.cz/httpdocs/wp-content/plugins/relevanssi/relevanssi.php on line 1309
    2. no results at all - imho it should then fallback to standard search.

    when setting it to 0 it returns then the same error (imho it should count with "1" as minimum).

    Also for unknown reason it began very strange weighting in last days and i do not know how to analyze what is going on - e.g. http://money.mediacentrum.cz/?s=money+S3
    I had to set-up weight of TITLE to 50!!! so that the page with slug money-S3 (http://money.mediacentrum.cz/money-s3/) with Money S3 in title and H1 and in text appears on first page (5th position), otherwise it is somewhere far far lower. Is there any way how i can see the actual weights for each article for the query?


  2. Mikko Saari
    Plugin Author

    Posted 4 years ago #

    Yeah, that undefinied variable is already on my to-do list.

    You can use the "Show breakdown of search hits in excerpts:" option to show the total score, just put "%score%" in the breakdown field.

    Looks like both "money" and "s3" are very common terms on your site, and in that case the results can be pretty much anything. Setting the title weight to 50 (which is not that huge a number, really) is probably the best idea.

    Relevanssi doesn't care about HTML markup (which might be a good idea, but requires so much work I don't think it's going to happen any time soon) or page slugs (that would be easier, and I think I'll take a look at indexing page slugs).

    I'll have to fix Relevanssi to behave when minimum word length is set to 0 (count it as 1, yes). I don't know about the fallback, though - somewhat complicated, and the user can always add a "your search term was too short" error notice to the search results page if necessary.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic