Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

New Feature : Search Plugin 21 Mar 2017 13:04 #15050

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Use now the Joomla search module for searching directly on your component datas
You gonna love it..

www.j-cook.pro/index.php/docs/versions/292-3-1-4
Coding is now a piece of cake
The following user(s) said Thank You: organicwebs

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

New Feature : Search Plugin 22 Mar 2017 15:20 #15058

concat() function

YAY!

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

New Feature : Search Plugin 23 Mar 2017 09:23 #15059

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
I Started to play with this new Search Plugin.
first step (Include Component Area) is on :)


I am now trying to anderstand how the Component Tables are managed for the text Search ...

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

New Feature : Search Plugin 23 Mar 2017 12:11 #15060

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Once you put a SEARCH filter (and the fields to search on) in a FRONT list, then the concerned table becomes an AREA
For the moment, the area name is the same name than the table name (plural). But it is possible to extend this feature and create a custom area for whatever search.

The plugin is NOT forkable at the moment.
This plugin is closely linked to your component, using the ORM system which permit to keep locked all the ACCESSES without needing to instance them over again and again.
For sure, this plugin will systematically load the component loader (when the area is selected only), and I don't know precisely the consequences on the page loading, but this was necessary.
Anyone is free to remove the ORM layer and the component loader (manually), for some areas that do not require too much restrictions. In that case, deal with a litteral SQL query in the plugin.
I simply provide you the most difficult work. Then, "use the scissors" and cut it to your needs.

In the sandbox, you can play with it (automatically installed with your component), and check the ACL, published, author.... you will see how beautiful...
Coding is now a piece of cake

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

New Feature : Search Plugin 23 Mar 2017 12:27 #15061

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Others tips :
The plugin is querying the concerned model trough the 'plugin.search' context name.
This context automatically find the ormPluginSearch() function in the concerned model (front only)

This is the place for all customs. And it is FORKABLE. The plugin is just a bridge. It is the caller, not the worker.
In future evolution, I will also place the definition of the searchable areas in the component (loader or helper).

I also introduced the concat() function in ORM because the ALL rule of search is requiring it.
The search applies on a list of fields, and all these fields are concatenated directly in the query.

Example : (area : Cities)
Search : "Paris France"
-> The string Paris is found on field 'Name'
-> The string France is found on field 'Country.Name'
I you search ALL, the search will match only when the 2 terms are found. The result is impossible to achieve without concatenation.

To concatenate, use the bracklets (as shown in your component)
{name} {country.name} {country.continent.name}

Another use of concat, is for rendering the text for the search result. Example
City: {name} / Country: {country.name} / Continent: {country.continent.name}

Open your curiosity in the ormPluginSearch() function, all is compacted in few lines.
Now compare with a classical plugin, and then share your comments, lol
Coding is now a piece of cake
The following user(s) said Thank You: liubov

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

New Feature : Search Plugin 23 Mar 2017 12:54 #15062

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
Ho yes OK!
I did not anderstand what this sentence means ! I get it now, thank you.

Once you put a SEARCH filter (and the fields to search on) in a FRONT list, then the concerned table becomes an AREA...

I read the procedure, a have a last question:

Does it works if the search is made from the main Search Module of the site (not only from FRONT List component page) ?

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

Last edit: by liubov.

New Feature : Search Plugin 23 Mar 2017 12:58 #15063

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986

liubov wrote: Does it works if the search is made from the main Search Module of the site (not only from FRONT List component page) ?


Yes of course. This is precisely the purpose of the feature.

Achieving this work, the ORM search engine has been improved as well for the component internal searches.
At the moment I write you this I realize that the component search is not using the concat() (yet) and so the results can differs. things can improve (easy to do manually)
Coding is now a piece of cake

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

  • Page:
  • 1
Time to create page: 0.069 seconds

WOW.. WOW... WOW... This is awesome... in less than 3 hours of work I have my application done... this is simply the best tool I ever tried to generate Joomla Components... Thank you very much for this tool and your answer.. it helped me a lot... My friends here in Brazil are going nuts with this...
Griiettner (Forum)

Get Started