Keyword

"No items found" if I search on numbered pages of items list

  • Fábio Jordan
  • Fábio Jordan's Avatar Topic Author
  • Offline
  • Senior Member
  • Nothing like a good coffee to make a better web
More
4 years 5 months ago #176172 by Fábio Jordan
Hello.

So, I guess I found a bug or at least a limitation.

Let's suppose I'm browsing on items list in the backend. And then, when I'm at page 5, I want to search for a specific item with the word "King". So, when I type this word in the search field, I get the result:

No items found.

At first, I thought there was a bug, but then I repeated the same thing, but instead of the word "King", I've tried to search for the word "Amor" (which means Love in portuguese). So, in this case, I've got some results.

The problem is: instead of reseting the parameters and give me the results (at the 1st page) of the word "King", K2 tries to pull results from the 5th page for that word. It occurs that I don't have 100 items with the word "King" in the title, so it can't load the 5th page, because it doesn't exist.

BUT it also happens that I cannot go back to the first page of this search to see the results. So, I have to reset the results and type the term in the first page to be sure I'll have the results.

Is there a solution for that?

Thanks in advance!
Attachments:

Please Log in or Create an account to join the conversation.

More
4 years 5 months ago #176181 by JoomlaWorks
This actually relates to Joomla's MVC and how it handles pagination data stored in each user's session.

There's a logic behind that of course. Say you're browsing page 3 of "Items", then you switch to "Categories". If you click to go back to "Items", you'll land to page 3. This can be convenient, but as you also witnessed, it can cause issues as well.

It *should* be easy to circumvent that without ripping off the entire MVC structure in K2.

I'll have a deeper look and get back to you.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Fábio Jordan
  • Fábio Jordan's Avatar Topic Author
  • Offline
  • Senior Member
  • Nothing like a good coffee to make a better web
More
4 years 5 months ago #176189 by Fábio Jordan
I see... That's good to know... And I'm hopping there's an easy solution for that.

And actually, talkint about pagination, the pagination in frontend also uses Joomla's MVC? Because in websites like mine, that has categories with more than a thousand items, the pagination does not work pretty good after page 10.

As a workaround, I decided to use ajax to load more items, so the users still in the same page and the website loads the content dynamically. Btw, maybe there should be an option in K2 to use this kind of loading if the user prefers. What do you think?

If you want to check this out:
www.cafecomfilme.com.br/filmes

Just scroll down to bottom and there's the button "Carregar mais filmes" (Load more movies).

Thanks again for the awesome work! K2 always the best!

Please Log in or Create an account to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #176193 by JoomlaWorks
K2 uses Joomla's pagination both in the frontend and backend.

If you have issues in the frontend, it's most likely related to server performance issues, especially if your K2 site has more than a few dozen thousand items. The SQL queries executed by K2 are as minimal as possible, so if you get delays, it's most likely a database server issue: either MySQL/MariaDB etc. is overloaded or -as in most cases- it's simply not tuned for heavy load. And since you seem to be on a cPanel based server, it's most likely the latter.

If you have control over the server, I would highly recommend you install Engintron (applications.cpanel.net/listings/view/Engintron-Nginx-on-cPanel) to lower the overall load on your server and then consult this guide to tune MySQL/MariaDB: engintron.com/docs/#/pages/Beyond-Engintron-Optimizing-MySQL

Guess who built Engintron... ;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 4 years 5 months ago by JoomlaWorks.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum