get_records param array for advanced search - not working

Hi,

I am upgrading from 1.5x to 2.x

While doing this I am moving from get_items(array $params = Array, integer $limit = 10)
to
get_records(string $recordType, array $params = Array, integer $limit = 10)

However $items = get_records('item', $params ,100);

while

$param = array(2) { ["submit_search"]=> string(6) "Search" ["advanced_search"]=> array(2) { [0]=> array(3) { ["element_id"]=> string(2) "50" ["type"]=> string(8) "contains" ["terms"]=> string(11) "commentaire" } [4]=> array(3) { ["element_id"]=> string(2) "44" ["type"]=> string(8) "contains" ["terms"]=> string(9) "Français" } } }

return me every results of the database, while only one recrods matches these criteria.

The search is not operative, where am I wrong ?

Thanks a lot

Alexandre

I believe the relevant change here is that the key "advanced_search" should now be just "advanced".

Far better, thanks John.

Just still a problem with the "collection it belongs to" condition

My querystring should not send the proper params, translate it gives:

array(3) { ["search"]=> string(11) "commentaire" ["submit_search"]=> string(6) "Search" ["advanced"]=> array(3) { [0]=> array(3) { ["element_id"]=> string(2) "50" ["type"]=> string(8) "contains" ["terms"]=> string(11) "commentaire" } [4]=> array(3) { ["element_id"]=> string(2) "44" ["type"]=> string(8) "contains" ["terms"]=> string(9) "Français" } [5]=> array(3) { ["element_id"]=> string(2) "50" ["type"]=> string(8) "contains" ["terms"]=> string(16) "Droit dauphinois" } } }

but now 50 is not the element_id of item collection, but the element_id of Collection name. Am I right ?

You should be able to look up the element_id number in application/schema/elements.sql