Global search

saet

New member
Hello,

Is there another type of search that is not bound by certain fields such as "Quick search" and "Search"?
Basically I would need to be able to search through all the fields in the table.

Thanks.

----------------------------------------------------------

You are using DaDaBIK version 10.6-Manarola enterprise, installed on 04-12-2021 (installation code: 16794605dc449b439c), the latest version of DaDaBIK is 10.6-Manarola released on 01-26-2021

System info

PHP Version: 7.3.27
mysql version: 5.5.5-10.4.18-MariaDB
Web server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.3.27
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
URL installation: http://localhost/
 

Martin68

Well-known member
Hi,

I just added such a solution for a new table, perhaps can you use my solution for your problem:

i have a table with some textfields and wanted to find all rows where the search value is in any textfield. Therefor I added a filed "search field" which ist calculated by a php-function. I concat the values of the fields I want to search in and hides the filed in enter/edit/detailview. I just allow this field in quciksearch and so I can find all rows where the searched value is in any field I concat together.

Hope that helps.

Kind regards

Martin
 

miktham

New member
Hi,

I just added such a solution for a new table, perhaps can you use my solution for your problem:

i have a table with some textfields and wanted to find all rows where the search value is in any textfield. Therefor I added a filed "search field" which ist calculated by a php-function. I concat the values of the fields I want to search in and hides the filed in enter/edit/detailview. I just allow this field in quciksearch and so I can find all rows where the searched value is in any field I concat together.

Hope that helps.

Kind regards

Martin
Hi
Can you guide with sample code you had used?
 

Martin68

Well-known member
Yes, I can :)

First added a database field, large enough to contain all possible texts, in my situation its a textfield called "Suchfeld" or in English "searchfield"

Then I created a php-function called "DaDaBIK_gen_suchfeld" (generate searchfield), you must begin with "DaDaBIK"

function dadabik_gen_suchfeld($parameters_ar){ return $parameters_ar['Thema'] . $parameters_ar['Beschreibung'] . $parameters_ar['Leistungen'] ; }

Thema, Beschreibung und Leistungen are the names of the fields in the Database.

The function is stored in the file "include/custom_functions/calculated_fields_functions.php"

Then I set up in the forms configurator for "Suchfeld" and entered the functionname in the "Calculated field function:", when entering dada.. the system offered the functions it has found in the php-file.

At last I go to permissions, and
- hide the "Suchfeld" by setting "results" to "no"
- enable the quicksearch by setting "quick search" to "yes"

Thats all, not really a great thing..

Kind regards

Martin
 
Top