public LinearFunction(string field, Action <FunctionScoreDecayFieldDescriptor> descriptorBuilder) { _LinearDescriptor = new Dictionary <PropertyPathMarker, FunctionScoreDecayFieldDescriptor>(); var descriptor = new FunctionScoreDecayFieldDescriptor(); descriptorBuilder(descriptor); _LinearDescriptor[field] = descriptor; }
public ExpFunction(Expression <Func <T, object> > objectPath, Action <FunctionScoreDecayFieldDescriptor> descriptorBuilder) { _ExpDescriptor = new Dictionary <PropertyPathMarker, FunctionScoreDecayFieldDescriptor>(); var descriptor = new FunctionScoreDecayFieldDescriptor(); descriptorBuilder(descriptor); _ExpDescriptor[objectPath] = descriptor; }
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; }