当前位置: 首页>>代码示例>>C#>>正文


C# Lucene类代码示例

本文整理汇总了C#中Lucene的典型用法代码示例。如果您正苦于以下问题:C# Lucene类的具体用法?C# Lucene怎么用?C# Lucene使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Lucene类属于命名空间,在下文中一共展示了Lucene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LuceneSearcher

 public LuceneSearcher(Lucene.Net.Store.Directory luceneDirectory, Analyzer analyzer)
     : base(analyzer)
 {
     _disposer = new DisposableSearcher(this);
     LuceneIndexFolder = null;
     _luceneDirectory = luceneDirectory;
 }
开发者ID:bowserm,项目名称:Examine,代码行数:7,代码来源:LuceneSearcher.cs

示例2: Filter

        public List<FacetReturn> Filter(Lucene.Net.Search.Query query, List<Util.SearchStringModel> searchQuery, string locationFilter, System.Collections.BitArray baseQuery)
        {
            if (InAvailableLocations(locationFilter))
            {
                var stopWatch = new Stopwatch();
                if (Config.EnableBucketDebug || Sitecore.ItemBucket.Kernel.Util.Constants.EnableTemporaryBucketDebug)
                {
                    Diagnostics.Log.Info("Start Extension Facet took : " + stopWatch.ElapsedMilliseconds + "ms",
                                         this);
                }
                stopWatch.Start();
                var returnFacets = this.GetSearch(query, GetFileExtensionsFromIndex().ToList(), searchQuery, locationFilter, baseQuery).Select(
                    facet =>
                    new FacetReturn
                        {
                            KeyName = facet.Key,
                            Value = facet.Value.ToString(),
                            Type = "extension",
                            ID = facet.Key
                        });
                if (Config.EnableBucketDebug || Sitecore.ItemBucket.Kernel.Util.Constants.EnableTemporaryBucketDebug)
                {
                    stopWatch.Stop();
                    Diagnostics.Log.Info("End Extension Facet took : " + stopWatch.ElapsedMilliseconds + "ms",
                                         this);
                }

                return returnFacets.ToList();
            }

            return new List<FacetReturn>();
        }
开发者ID:udt1106,项目名称:Sitecore-Item-Buckets,代码行数:32,代码来源:Extension.cs

示例3: AzureDirectory

        /// <summary>
        /// Create an AzureDirectory
        /// </summary>
        /// <param name="storageAccount">storage account to use</param>
        /// <param name="containerName">name of container (folder in blob storage)</param>
        /// <param name="cacheDirectory">local Directory object to use for local cache</param>
        /// <param name="rootFolder">path of the root folder inside the container</param>
        public AzureDirectory(
            CloudStorageAccount storageAccount,
            string containerName = null,
            Lucene.Net.Store.Directory cacheDirectory = null,
            bool compressBlobs = false,
            string rootFolder = null)
        {
            if (storageAccount == null)
                throw new ArgumentNullException("storageAccount");

            if (string.IsNullOrEmpty(containerName))
                _containerName = "lucene";
            else
                _containerName = containerName.ToLower();

            if (string.IsNullOrEmpty(rootFolder))
                _rootFolder = string.Empty;
            else
            {
                rootFolder = rootFolder.Trim('/');
                _rootFolder = rootFolder + "/";
            }

            _blobClient = storageAccount.CreateCloudBlobClient();
            _initCacheDirectory(cacheDirectory);
            this.CompressBlobs = compressBlobs;
        }
开发者ID:jclementson,项目名称:Examine,代码行数:34,代码来源:AzureDirectory.cs

示例4: FilteringTokenFilter

 public FilteringTokenFilter(Lucene.Net.Util.LuceneVersion version, bool enablePositionIncrements, TokenStream input)
     : this(version, input)
 {
     posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
     CheckPositionIncrement(version, enablePositionIncrements);
     this.enablePositionIncrements = enablePositionIncrements;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:FilteringTokenFilter.cs

示例5: InitBlock

			private void  InitBlock(Lucene.Net.Index.IndexReader reader, SpanNotQuery enclosingInstance)
			{
				this.reader = reader;
				this.enclosingInstance = enclosingInstance;
				includeSpans = Enclosing_Instance.include.GetSpans(reader);
				excludeSpans = Enclosing_Instance.exclude.GetSpans(reader);
			}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:7,代码来源:SpanNotQuery.cs

示例6: SecureSearcherManager

        public SecureSearcherManager(string indexName, Lucene.Net.Store.Directory directory)
            : base(directory)
        {
            IndexName = indexName;

            RegistrationBaseAddress = new Dictionary<string, Uri>();
        }
开发者ID:jinujoseph,项目名称:NuGet.Services.Metadata,代码行数:7,代码来源:SecureSearcherManager.cs

示例7: LuceneIndexingService

 public LuceneIndexingService(
     IPackageSource packageSource,
     Lucene.Net.Store.Directory directory)
 {
     _packageSource = packageSource;
     _directory = directory;
 }
开发者ID:ChrisMissal,项目名称:NuGetGallery,代码行数:7,代码来源:LuceneIndexingService.cs

示例8: FilterQueryByClasses

        public static Lucene.Net.Search.Query FilterQueryByClasses(ISet<System.Type> classesAndSubclasses, Lucene.Net.Search.Query luceneQuery)
        {
            // A query filter is more practical than a manual class filtering post query (esp on scrollable resultsets)
            // it also probably minimise the memory footprint
            if (classesAndSubclasses == null)
            {
                return luceneQuery;
            }

            BooleanQuery classFilter = new BooleanQuery();

            // annihilate the scoring impact of DocumentBuilder.CLASS_FIELDNAME
            classFilter.SetBoost(0);
            foreach (System.Type clazz in classesAndSubclasses)
            {
                Term t = new Term(DocumentBuilder.CLASS_FIELDNAME, TypeHelper.LuceneTypeName(clazz));
                TermQuery termQuery = new TermQuery(t);
                classFilter.Add(termQuery, BooleanClause.Occur.SHOULD);
            }

            BooleanQuery filteredQuery = new BooleanQuery();
            filteredQuery.Add(luceneQuery, BooleanClause.Occur.MUST);
            filteredQuery.Add(classFilter, BooleanClause.Occur.MUST);
            return filteredQuery;
        }
开发者ID:spib,项目名称:nhcontrib,代码行数:25,代码来源:FullTextSearchHelper.cs

示例9: DocIdSetAnonymousInnerClassHelper

 public DocIdSetAnonymousInnerClassHelper(QueryWrapperFilter outerInstance, Bits acceptDocs, AtomicReaderContext privateContext, Lucene.Net.Search.Weight weight)
 {
     this.OuterInstance = outerInstance;
     this.AcceptDocs = acceptDocs;
     this.PrivateContext = privateContext;
     this.Weight = weight;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:QueryWrapperFilter.cs

示例10: InitBlock

				private void  InitBlock(Lucene.Net.Search.StringIndex fcsi, int inclusiveLowerPoint, int inclusiveUpperPoint, AnonymousClassFieldCacheRangeFilter enclosingInstance)
				{
					this.fcsi = fcsi;
					this.inclusiveLowerPoint = inclusiveLowerPoint;
					this.inclusiveUpperPoint = inclusiveUpperPoint;
					this.enclosingInstance = enclosingInstance;
				}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:7,代码来源:FieldCacheRangeFilter.cs

示例11: InitBlock

			private void  InitBlock(Lucene.Net.Index.IndexWriter writerFinal, int iFinal, int iterFinal, TestThreadedOptimize enclosingInstance)
			{
				this.writerFinal = writerFinal;
				this.iFinal = iFinal;
				this.iterFinal = iterFinal;
				this.enclosingInstance = enclosingInstance;
			}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:7,代码来源:TestThreadedOptimize.cs

示例12: Decorate

 /// <summary>
 /// Decorates the specified query adding context information.
 /// </summary>
 /// <param name="query">The source query.</param>
 /// <returns>The decorated query.</returns>
 public Lucene.Net.Search.Query Decorate(Lucene.Net.Search.Query query)
 {
     BooleanQuery result = new BooleanQuery(true);
       result.Add(query, Occur.MUST);
       this.AddDecorations(result);
       return result;
 }
开发者ID:HydAu,项目名称:sitecore8ecommerce,代码行数:12,代码来源:SearchContext.cs

示例13: RunQuery

 public override List<SkinnyItem> RunQuery(Lucene.Net.Search.Query query, bool showAllVersions, string sortField, bool reverse, int start, int end, out int totalResults)
 {
     using (var scope = QueryTraceHelper.GetQueryTraceScope(query))
     {
         return base.RunQuery(query, showAllVersions, sortField, reverse, start, end, out totalResults);
     }
 }
开发者ID:NetworkTen,项目名称:SitecoreSearchContrib,代码行数:7,代码来源:QueryRunnerTrace.cs

示例14: MultiIndexLockFactory

 public MultiIndexLockFactory(Lucene.Net.Store.Directory master, Lucene.Net.Store.Directory child)
 {
     if (master == null) throw new ArgumentNullException("master");
     if (child == null) throw new ArgumentNullException("child");
     _master = master;
     _child = child;
 }
开发者ID:jclementson,项目名称:Examine,代码行数:7,代码来源:MultiIndexLockFactory.cs

示例15: InitBlock

			private void  InitBlock(System.Collections.BitArray bits, int[] totalHits, Lucene.Net.Search.FieldSortedHitQueue hq, IndexSearcher enclosingInstance)
			{
				this.bits = bits;
				this.totalHits = totalHits;
				this.hq = hq;
				this.enclosingInstance = enclosingInstance;
			}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:7,代码来源:IndexSearcher.cs


注:本文中的Lucene类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。