public override NumericDocValues GetNumericDocValues(string field)
        {
            EnsureOpen();
            FieldInfo fi = GetDVField(field, DocValuesType.NUMERIC);

            if (fi == null)
            {
                return(null);
            }

            IDictionary <string, object> dvFields = docValuesLocal.Get();

            NumericDocValues dvs;
            object           dvsDummy;

            dvFields.TryGetValue(field, out dvsDummy);
            dvs = (NumericDocValues)dvsDummy;
            if (dvs == null)
            {
                DocValuesProducer dvProducer;
                dvProducersByField.TryGetValue(field, out dvProducer);
                Debug.Assert(dvProducer != null);
                dvs             = dvProducer.GetNumeric(fi);
                dvFields[field] = dvs;
            }

            return(dvs);
        }
Exemple #2
0
        public virtual IRuntimeFacetHandler GetRuntimeFacetHandler(string name)
        {
            var map = m_runtimeFacetHandlerMap.Get();

            if (map == null)
            {
                return(null);
            }

            return(map.Get(name));
        }
Exemple #3
0
        public virtual object GetRuntimeFacetData(string name)
        {
            var map = m_runtimeFacetDataMap.Get();

            if (map == null)
            {
                return(null);
            }

            return(map.Get(name));
        }
        public override IBits GetDocsWithField(string field)
        {
            EnsureOpen();
            FieldInfo fi = FieldInfos.FieldInfo(field);

            if (fi == null)
            {
                // Field does not exist
                return(null);
            }
            if (fi.DocValuesType == DocValuesType.NONE)
            {
                // Field was not indexed with doc values
                return(null);
            }

            IDictionary <string, IBits> dvFields = docsWithFieldLocal.Get();

            IBits dvs;

            dvFields.TryGetValue(field, out dvs);
            if (dvs == null)
            {
                DocValuesProducer dvProducer;
                dvProducersByField.TryGetValue(field, out dvProducer);
                Debug.Assert(dvProducer != null);
                dvs             = dvProducer.GetDocsWithField(fi);
                dvFields[field] = dvs;
            }

            return(dvs);
        }
Exemple #5
0
        private ThreadResources GetThreadResources()
        {
            ThreadResources resources = threadResources.Get();

            if (resources == null)
            {
                resources          = new ThreadResources();
                resources.termEnum = Terms();
                threadResources.Set(resources);
            }
            return(resources);
        }
Exemple #6
0
        internal NumericDocValues GetNormValues(FieldInfo fi)
        {
            Debug.Assert(normsProducer != null);

            IDictionary <string, object> normFields = normsLocal.Get();

            object ret;

            normFields.TryGetValue(fi.Name, out ret);
            var norms = ret as NumericDocValues;

            if (norms == null)
            {
                norms = normsProducer.GetNumeric(fi);
                normFields[fi.Name] = norms;
            }

            return(norms);
        }