Support » Plugin: Relevanssi - A Better Search » Oderby TItle

  • Hi!

    I have build up a page with 500 pdf files and the free relevanssi plugin version. If i search the files (for example the search word: MB-007, it shows all MB-XXX Files ordered the same way all the time.. (MB-001, MB-006….) If i search MB-350, i need to scroll down for ages to find the PDF file.

    Another problem is that it always shows up a random picture of the page where the files are… If my download area for example has a full height header and the downloads above it, it also includes a small full height header of the download are in the search result…How to exclude that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Relevanssi doesn’t really affect the way your page shows up. Relevanssi will just tell you which page has the keyword, nothing else. Relevanssi has no means to reorder the contents of the page.

    It’s possible to add some Javascript that will scroll the page down to where the keyword is first found, but that’s not a foolproof method: https://www.relevanssi.com/knowledge-base/scroll-result-page-search-term/

    What shows up on your search results template has nothing to do with Relevanssi; it’s all up to your theme and the search results template it provides. If you don’t want images to show up in the search results page, you need to edit the template so that no images are shown.

    Thank you for your fast answer.

    Very complicated for such a simple task.. Isnt there any other way to do this? I mean..if i have 100 files names: mb-xxx and search mb-002…why does it show all mb-xxx files..? Maybe i am doing something wrong? Otherwise:

    1) So i just need to add both codes to the functions.php?

    Plugin Author Mikko Saari

    (@msaari)

    Ah, but it is not a simple task! It may seem like a simple task, but it’s not.

    Relevanssi does not show the files. Relevanssi shows you the page, which has a list of all the names. Relevanssi doesn’t know what the contents mean; all it knows is that user wanted to find posts matching “mb-002”, that one post matches it and should thus be returned. Relevanssi doesn’t know that the user wants only that part of the page and nothing else, because usually the user wants the whole page.

    If you want the list to only have the names matching the search query, you need to edit the page contents on the fly, and that takes it to the complicated territory.

    No, none of the code in the JavaScript scroll goes to the functions.php; it’s best if you put the JS code in a separate file and then add a functions.php function that uses wp_enqueue_script() to read it in when necessary.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Oderby TItle’ is closed to new replies.