class BaseDaoESImp implements BaseDao {

    @Override
    public BoolQueryBuilder createQueryForMultiValue(TargetingChannel targetingChannel)
    {
        BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();

        /**
         * App usage has the part to hand different app states, such as installed, active and etc...
         */
        if (!CommonUtil.isEmpty(targetingChannel.getAus()))
        {
            /**
             * Split app usage into 2 parts, not installed and the rest
             */
            List<String> notInstalledApps = new ArrayList<>();
            List<String> restApps = new ArrayList<>();
            for (String appUsage : targetingChannel.getAus())
            {
                if (appUsage.length() > 0)
                {
                    if (appUsage.toLowerCase(Locale.US).contains("not_installed"))
                    {
                        /**
                         * Just get the app name not the postfixes
                         */
                        notInstalledApps.add(appUsage.split("_")[0] + "_type_installed");
                    }
                    else
                    {
                        restApps.add(appUsage);
                    }
                }
            }
            if (CommonUtil.isEmpty(notInstalledApps))
            {
                notInstalledApps = null;
            }
            if (CommonUtil.isEmpty(restApps))
            {
                restApps = null;
            }
            append(boolQueryBuilder, restApps, notInstalledApps, "au");
        }

        append(boolQueryBuilder, targetingChannel.getPdas(), targetingChannel.getExclude_pdas(), ES_TBR_DOC_PREFIX + "pda");
        append(boolQueryBuilder, targetingChannel.getApps(), targetingChannel.getExclude_apps(), ES_TBR_DOC_PREFIX + "app");
        append(boolQueryBuilder, targetingChannel.getDms(), ES_TBR_DOC_PREFIX + "dm");
        append(boolQueryBuilder, targetingChannel.getAis(), ES_TBR_DOC_PREFIX + "ai");
        append(boolQueryBuilder, targetingChannel.getDpc(), ES_TBR_DOC_PREFIX + "dpc");

        return boolQueryBuilder;
    }

    public  BaseDaoESImp();
    public  BaseDaoESImp(Properties properties);

}