Ejemplo n.º 1
0
        /// <summary>
        /// Builds a <see cref="SpatialStrategy"/> from configuration options.
        /// </summary>
        protected virtual SpatialStrategy MakeSpatialStrategy(Config config)
        {
            //A Map view of Config that prefixes keys with "spatial."
            var configMap = new DictionaryAnonymousClass(config);

            SpatialContext ctx = SpatialContextFactory.MakeSpatialContext(configMap /*, null*/); // LUCENENET TODO: What is this extra param?

            //Some day the strategy might be initialized with a factory but such a factory
            // is non-existent.
            return(MakeSpatialStrategy(config, configMap, ctx));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Builds a <see cref="SpatialStrategy"/> from configuration options.
        /// </summary>
        protected virtual SpatialStrategy MakeSpatialStrategy(Config config)
        {
            //A Map view of Config that prefixes keys with "spatial."
            var configMap = new DictionaryAnonymousClass(config);

            // LUCENENET: The second argument was ClassLoader in Java, which should be made into
            // Assembly in .NET. However, Spatial4n currently doesn't support it.
            // In .NET it makes more logical sense to make 2 overloads and throw ArgumentNullException
            // if the second argument is null, anyway. So no need to change this once support has been added.
            // See: https://github.com/NightOwl888/Spatial4n/issues/1
            SpatialContext ctx = SpatialContextFactory.MakeSpatialContext(configMap /*, assembly: null*/);

            //Some day the strategy might be initialized with a factory but such a factory
            // is non-existent.
            return(MakeSpatialStrategy(config, configMap, ctx));
        }