Skip Navigation

[Résolu] To show the result AFTER input search

This support ticket is created Il y a 7 années et 3 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Ce sujet contient 6 réponses, a 2 voix.

Dernière mise à jour par Beda Il y a 7 années et 3 mois.

Assisté par: Beda.

Auteur
Publications
#485774

I am trying to: to show the search result only after putting the text in search box

I visited this URL: lien caché

I expected to see: nothing

Instead, I got: All the the results before I have searched something

#485900

That's expected.
A Views Custom Search will always display all results until you filter them.

What you can do to present only the Search Form, until you actually filter by something - and only then display the results, is to split the View into Search and Resutls on 2 different pages.

This is elaborated here:
https://toolset.com/documentation/user-guides/front-page-filters/#displaying-custom-search > Adding the custom search form to a page or widget:
"Since this View is a custom search, it includes both a ‘search form’ and a ‘results’ sections. Select if you want to display both of them in the same page or on different pages."

You can display them on different pages, so after the filter is triggered you will get directed to the Search Results Page.

#485946

Ok, I tried as you said. But there is still a problem. The button search is now on the risult page.

lien caché

there is only imput text search

the button is here
lien caché
It's a bit weird. Tnx

#485947

If you create a View, and insert the Search Form + it's button to the Filter Editor, this will also display in the filter editor.
Probably the Button is not inserted to the Filter but somewhere else in the View?

If you cannot spot this, please give me access to that site so I can quickly have a look, without making any big changes

#485962
Bildschirmfoto 2017-02-05 um 19.59.19.png
Bildschirmfoto 2017-02-05 um 19.59.23.png

I see the Search and Button here:
lien caché

I do see the results only here:
lien caché

Can you point me out what is wrong?

It's exactly as it is supposed to be:
1. on the first page the filter
2. on the second page the results.

Is this correct?

#486224

Yes I solved. That's was right the button was interted not in the right place of the view.
But I have a question: when I have more than 8000 post it's very complicated to show all the results. Memory is exausthed. So even I split the view into two pages, the problem is the same. There are to many post types to show and i don't want it. Tnx

#486245

This is another type of issue, which we can address in another ticket.

But I can leave here some inputs related to large sites and how to solve the possible issues.

1. Views could be used for such a Search, but the database might not.

Views is a wrapper (or a GUI) for the native WordPress search, meaning WP_Query instances.
When you start adding filters, it becomes expensive because the database interaction is expensive by itself.
As example, WordPress stores ALL posts in a single Table.
On sites with lots of posts, custom fields and users (as example wp-types has a high number of these) it means a very expensive database interaction.

Views can handle for sure if your database can handle complex queries for lots of visitors.
Once you get to a point where WordPress WP_Query is not enough, then you need to head to database solutions, which is what we did on wp-types forums as example.

We do use our own parametric search in https://wpml.org/theme/ and https://wpml.org/plugin/, where we actually list very specific, limited Post Types, filtered by a very limited amount of Meta values.

Below some additional information on how you can decide whether Views fits your needs or not:

1. From what point on do we speak of “numerous content”?
300 posts + meta?
1000?
100000?

The number can not be fixed, it depends on your own server performance and load.
Also, on your settings. Just a few examples:

Do you have post revisions enabled?

Other plugins adding extra tables?

How many visitors (that could end up eating the available memory at once) will use this feature on the website?

It depends on many factors including also the Server and DDBB.

If you plan to build a website where several users will query the DDBB with Views simultaneously, and you got several Content types and entries, Views might not be the correct Tool, mainly due to the fact, that WordPress itself can not provide the correct DDBB Structure for it, and we do not want to unfollow best practices and begin to add Custom tables to the DDBB.

But we also have a DOC for performance issues:
https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance