AND / OR operators during a search

ryarkiv

New member
// enable the possibility, for users, to specify AND / OR operators during a search e.g. typing "apple OR banana" (0|1)
// operators are case sensitive, OR and AND must be written in capital letters
// users cannot mix operators (city AND Europe OR USA)
$enable_user_booleans = 1;

I can´t make this happen. Why?
 

eugenio

Administrator
Staff member
Please describe better the issue: DaDaBIK version, the string you typed, the expected result, the actual result, ....
 

ryarkiv

New member
Well for instance I have a database with a lot of names, including 1069 "Jens" and 303 "Hans".
When I search contains "Jens OR Hans", nothing returns.

The database also has 6 "Peter Andersen".
When I search contains "Peter AND Andersen", nothing returns.
 

eugenio

Administrator
Staff member
Please set $display_sql = 1 in config.php and paste here the query produced by your search.
 

ryarkiv

New member
I did this:

// display the main sql statements of insert/search/edit/detail operations for debugging (0|1)
// note that the insert sql statement is will be displayed only if $insert_again_after_insert is set to 1 and $show_details_after_insert = 0
$display_sql = 1;

Search LIKE/Contains "Jens AND Hans"

No results and no query on the screen.

Search Contains "Jens Hans" produced 4 posts, but no query.

I also followed the instructions of the second line marked //

No results and no query on the screen


I think I know what you want me to produce, because I made the same operation with Dadabik 4.x and here I was able to produce the query on the screen. (The two Dadabik versions are not on the same server).
 

ryarkiv

New member
Sorry, I made a blunder. Forget what I wrote above.

Here it comes:

Your SQL query (for debugging purpose): SELECT `Ry-kommune-1901`.`KIPnr`, `Ry-kommune-1901`.`Løbenr`, `Ry-kommune-1901`.`Stednavn`, `Ry-kommune-1901`.`Ejendom_navn`, `Ry-kommune-1901`.`Matr_nr`, `Ry-kommune-1901`.`Ejer`, `Ry-kommune-1901`.`Husstand_familienr`, `Ry-kommune-1901`.`Kildenavn`, `Ry-kommune-1901`.`Køn`, `Ry-kommune-1901`.`Civilstand`, `Ry-kommune-1901`.`Tro`, `Ry-kommune-1901`.`Fødselsdato`, `Ry-kommune-1901`.`Fødested`, `Ry-kommune-1901`.`Tilflyttet`, `Ry-kommune-1901`.`Fra`, `Ry-kommune-1901`.`Stilling_husstand`, `Ry-kommune-1901`.`Erhverv`, `Ry-kommune-1901`.`Arbejder_for`, `Ry-kommune-1901`.`Handikap`, `Ry-kommune-1901`.`Ægteskab`, `Ry-kommune-1901`.`Ægtefælle_død`, `Ry-kommune-1901`.`Levende_børn`, `Ry-kommune-1901`.`Døde_børn`, `Ry-kommune-1901`.`Anmærkning`, `Ry-kommune-1901`.`Kildebemærkning`, `Ry-kommune-1901`.`Kommentar`, `Ry-kommune-1901`.`Egne_bemærkinger` FROM `Ry-kommune-1901` WHERE `Ry-kommune-1901`.`Kildenavn` LIKE '%Jens OR Hans%'


But still no results.
 

eugenio

Administrator
Staff member
Hello,
from your SQL query, it seems DaDaBIK thinks $enable_user_booleans is disabled.
Can you post a screenshot or a paste part of your config.php (the part containing $enable_user_booleans )?

Best,
 
Top