示例#1
0
        public override Terms GetTerms(string field)
        {
            UninterruptableMonitor.Enter(this);
            try
            {
                if (!_termsCache.TryGetValue(field, out SimpleTextTerms terms) || terms == null)
                {
                    if (!_fields.TryGetValue(field, out long?fp) || !fp.HasValue)
                    {
                        return(null);
                    }
                    else
                    {
                        terms = new SimpleTextTerms(this, field, fp.Value, _maxDoc);
                        _termsCache[field] = terms;
                    }
                }

                return(terms);
            }
            finally
            {
                UninterruptableMonitor.Exit(this);
            }
        }
        public override Terms GetTerms(string field)
        {
            lock (this)
            {
                if (!_termsCache.TryGetValue(field, out SimpleTextTerms terms) || terms == null)
                {
                    if (!_fields.TryGetValue(field, out long?fp) || !fp.HasValue)
                    {
                        return(null);
                    }
                    else
                    {
                        terms = new SimpleTextTerms(this, field, fp.Value, _maxDoc);
                        _termsCache[field] = terms;
                    }
                }

                return(terms);
            }
        }
示例#3
0
 public override Terms Terms(string field)
 {
     lock (this)
     {
         Terms terms = _termsCache[field];
         if (terms == null)
         {
             long?fp = fields[field];
             if (fp == null)
             {
                 return(null);
             }
             else
             {
                 terms = new SimpleTextTerms(this, field, fp.Value, maxDoc);
                 _termsCache[field] = (SimpleTextTerms)terms;
             }
         }
         return(terms);
     }
 }
示例#4
0
        public override Terms Terms(string field)
        {
            lock (this)
            {
                SimpleTextTerms terms;
                if (_termsCache.TryGetValue(field, out terms))
                {
                    return(terms);
                }

                long?fp;
                if (!_fields.TryGetValue(field, out fp) || !fp.HasValue)
                {
                    return(null);
                }

                terms = new SimpleTextTerms(this, field, fp.Value, _maxDoc);
                _termsCache[field] = (SimpleTextTerms)terms;
                return(terms);
            }
        }
        public override Terms Terms(string field)
        {
            lock (this)
            {
                Terms terms = _termsCache[field];
                if (terms != null)
                {
                    return(terms);
                }

                var fp = _fields[field];
                if (fp == null)
                {
                    return(null);
                }

                terms = new SimpleTextTerms(this, field, fp.Value, _maxDoc);
                _termsCache[field] = (SimpleTextTerms)terms;
                return(terms);
            }
        }
        public override Terms Terms(string field)
        {
            lock (this)
            {
                Terms terms = _termsCache[field];
                if (terms != null) return terms;

                var fp = _fields[field];
                if (fp == null)
                {
                    return null;
                }

                terms = new SimpleTextTerms(this, field, fp.Value, _maxDoc);
                _termsCache[field] = (SimpleTextTerms) terms;
                return terms;
            }
        }