Order of search results

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
pmfuser
Posts: 106
Joined: Tue Apr 01, 2014 7:00 am

Order of search results

Post by pmfuser »

Hi,

For example, I have a new FAQ which has an exact phrase "word1 word2" in the text, tag "word1 word2", and finally, "word1 word2" as a keyword. It comes up last because it's the latest one with the least views, and a few older FAQs have the same tag and keyword because they should. Is there a way to change the order of search results and make this best match entry be a first on the list?

Thanks
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Order of search results

Post by Thorsten »

Hi,

do you use MySQL? If yes, did you enable search by relevance? Did you try the sorting by relevance?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
pmfuser
Posts: 106
Joined: Tue Apr 01, 2014 7:00 am

Re: Order of search results

Post by pmfuser »

All done now, and it looks much better. Thank you very much.

Still in regards of search, I have a search box at the bottom, and the refreshed page with results shows the middle of the page, so a user has to scroll up.

Where would be the directive for the top of the page? Template or code? I use spacelab template.

Thanks
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Order of search results

Post by Thorsten »

Hi,

good news on the search!

For the scroll up issue, you could add a "autofocus" attribute into the search input field.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
pmfuser
Posts: 106
Joined: Tue Apr 01, 2014 7:00 am

Re: Order of search results

Post by pmfuser »

you could add a "autofocus" attribute into the search input field
Sorry, I don't get this part. How is that done?

Thanks
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Order of search results

Post by Thorsten »

Hi,

just checked the code of the default template, shouid work as intended there. Can you post me a link to your FAQ?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
pmfuser
Posts: 106
Joined: Tue Apr 01, 2014 7:00 am

Re: Order of search results

Post by pmfuser »

I just saw the autofocus already in the search.tpl input field, too. The point is that the "jump" happens, but not all the way to the top. And after paying more attention to the search page, I see that the search field and button always stay on the bottom of the page which prevents it to go to the very top since the search form is at the bottom. Which part controls this behavior?

Thanks
pmfuser
Posts: 106
Joined: Tue Apr 01, 2014 7:00 am

Re: Order of search results

Post by pmfuser »

Dumb me.

Since I moved search section to the bottom of the page, autofocus should be deleted from the input field.

Thanks for the right hint!
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Order of search results

Post by Thorsten »

Hi,

ah, great! :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply