middleware/_modelIndex.js
function (cb) {

                if (!session.list.formData.search || !session.list.formData.search.length || !req.linz.model.list.search || !Array.isArray(req.linz.model.list.search)) {
                    return cb(null);
                }

                // Default the `$and` key.
                if (!filters.$and) {
                    filters.$and = [];
                }

                async.map(req.linz.model.list.search, (field, fieldCallback) => {

                    linz.api.model.titleField(req.params.model, field, (err, titleField) => {

                        if (err) {
                            return fieldCallback(err);
                        }

                        fieldCallback(null, linz.api.query.fieldRegexp(titleField, session.list.formData.search));

                    });

                }, (err, $or) => {

                    filters.$and.push({ $or });

                    return cb(null);

                });

            }
function (cb) {

                if (!session.list.formData.search || !session.list.formData.search.length || !req.linz.model.list.search || !Array.isArray(req.linz.model.list.search)) {
                    return cb(null);
                }

                // Default the `$and` key.
                if (!filters.$and) {
                    filters.$and = [];
                }

                async.map(req.linz.model.list.search, (field, fieldCallback) => {

                    linz.api.model.titleField(req.params.model, field, (err, titleField) => {

                        if (err) {
                            return fieldCallback(err);
                        }

                        fieldCallback(null, linz.api.query.fieldRegexp(titleField, session.list.formData.search));

                    });

                }, (err, $or) => {

                    filters.$and.push({ $or });

                    return cb(null);

                });

            }
function ( cb ) { if ( ! session . list . formData . search || ! session . list . formData . search . length || ! req . linz . model . list . search || ! Array . isArray ( req . linz . model . list . search ) ) { return cb ( null ) ; } // Default the `$and` key. if ( ! filters . $and ) { filters . $and = [ ] ; } async . map ( req . linz . model . list . search , ( field , fieldCallback ) => { linz . api . model . titleField ( req . params . model , field , ( err , titleField ) => { if ( err ) { return fieldCallback ( err ) ; } fieldCallback ( null , linz . api . query . fieldRegexp ( titleField , session . list . formData . search ) ) ; } ) ; } , ( err , $or ) => { filters . $and . push ( { $or } ) ; return cb ( null ) ; } ) ; }
add the seach filters
add the seach filters