コード例 #1
0
        public LinearFunction(string field, Action <FunctionScoreDecayFieldDescriptor> descriptorBuilder)
        {
            _LinearDescriptor = new Dictionary <PropertyPathMarker, FunctionScoreDecayFieldDescriptor>();

            var descriptor = new FunctionScoreDecayFieldDescriptor();

            descriptorBuilder(descriptor);
            _LinearDescriptor[field] = descriptor;
        }
コード例 #2
0
        public ExpFunction(Expression <Func <T, object> > objectPath, Action <FunctionScoreDecayFieldDescriptor> descriptorBuilder)
        {
            _ExpDescriptor = new Dictionary <PropertyPathMarker, FunctionScoreDecayFieldDescriptor>();

            var descriptor = new FunctionScoreDecayFieldDescriptor();

            descriptorBuilder(descriptor);
            _ExpDescriptor[objectPath] = descriptor;
        }
コード例 #3
0
        public ExpFunction(Expression <Func <T, object> > objectPath, Action <FunctionScoreDecayFieldDescriptor> descriptorBuilder)
        {
            _ExpDescriptor = new Dictionary <string, FunctionScoreDecayFieldDescriptor>();

            var resolver   = new PropertyNameResolver();
            var fieldName  = resolver.Resolve(objectPath);
            var descriptor = new FunctionScoreDecayFieldDescriptor();

            descriptorBuilder(descriptor);
            _ExpDescriptor[fieldName] = descriptor;
        }