All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.redkalex.source.search.SearchMapping Maven / Gradle / Ivy

There is a newer version: 2.7.7
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.redkalex.source.search;

import java.lang.reflect.Type;
import java.util.Map;
import org.redkale.util.TypeToken;

/** @author zhangjx */
public class SearchMapping extends BaseBean {

    public static final Type MAPPING_MAP_TYPE = new TypeToken>() {}.getType();

    public SearchProperties mappings;

    public static class SearchProperties extends BaseBean {

        public Map properties;

        public boolean equal(Map ms) {
            if (properties == null) return false;
            if (ms == null) return false;
            if (properties.size() != ms.size()) return false;
            for (Map.Entry en : properties.entrySet()) {
                Map infomap = ms.get(en.getKey());
                if (infomap == null) return false;
                Object infoanalyzer = infomap.get("analyzer");
                if (en.getValue().analyzer == null && infoanalyzer != null) return false;
                if (en.getValue().analyzer != null && infoanalyzer == null) return false;
                if (en.getValue().analyzer != null && !en.getValue().analyzer.equals(infoanalyzer)) return false;
            }
            return true;
        }
    }

    public static class MappingItem extends BaseBean {

        public String type;

        public String analyzer;

        public Integer ignore_above;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy