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


C# Term.Bytes方法代码示例

本文整理汇总了C#中Term.Bytes方法的典型用法代码示例。如果您正苦于以下问题:C# Term.Bytes方法的具体用法?C# Term.Bytes怎么用?C# Term.Bytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Term的用法示例。


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

示例1: Set

 public void Set(Term term)
 {
     if (term == null)
     {
         Reset();
         return;
     }
     Bytes.CopyBytes(term.Bytes());
     Field = String.Intern(term.Field());
     CurrentFieldNumber = -1;
     this.Term = term;
 }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:12,代码来源:TermBuffer.cs

示例2: DeepCopyOf

 internal static Term DeepCopyOf(Term other)
 {
     return new Term(other.Field(), BytesRef.DeepCopyOf(other.Bytes()));
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:4,代码来源:TermInfosReader.cs

示例3: CompareAsUTF16

 private int CompareAsUTF16(Term term1, Term term2)
 {
     if (term1.Field().Equals(term2.Field()))
     {
         return LegacyComparator.Compare(term1.Bytes(), term2.Bytes());
     }
     else
     {
         return term1.Field().CompareTo(term2.Field());
     }
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:11,代码来源:TermInfosReader.cs

示例4: CompareTo

 /// <summary>
 /// Compare the fields of the terms first, and if not equals return from
 /// compare. If equal compare terms.
 /// </summary>
 /// <param name="term">
 ///          the term to compare. </param>
 /// <param name="termIndex">
 ///          the position of the term in the input to compare </param>
 /// <param name="input">
 ///          the input buffer. </param>
 /// <returns> int. </returns>
 /// <exception cref="IOException"> If there is a low-level I/O error. </exception>
 private int CompareTo(Term term, int termIndex, PagedBytesDataInput input, BytesRef reuse)
 {
     // if term field does not equal mid's field index, then compare fields
     // else if they are equal, compare term's string values...
     int c = CompareField(term, termIndex, input);
     if (c == 0)
     {
         reuse.Length = input.ReadVInt();
         reuse.Grow(reuse.Length);
         input.ReadBytes(reuse.Bytes, 0, reuse.Length);
         return Comparator.Compare(term.Bytes(), reuse);
     }
     return c;
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:26,代码来源:TermInfosReaderIndex.cs

示例5: TermStatistics

                public override TermStatistics TermStatistics(Term term, TermContext context)
                {
                    Debug.Assert(term != null);
                    long docFreq = 0;
                    long totalTermFreq = 0;
                    for (int nodeID = 0; nodeID < NodeVersions.Length; nodeID++)
                    {
                        TermStatistics subStats;
                        if (nodeID == MyNodeID)
                        {
                            subStats = base.TermStatistics(term, context);
                        }
                        else
                        {
                            TermAndShardVersion key = new TermAndShardVersion(nodeID, NodeVersions[nodeID], term);
                            subStats = OuterInstance.TermStatsCache[key];
                            // We pre-cached during rewrite so all terms
                            // better be here...
                            Debug.Assert(subStats != null);
                        }

                        long nodeDocFreq = subStats.DocFreq();
                        if (docFreq >= 0 && nodeDocFreq >= 0)
                        {
                            docFreq += nodeDocFreq;
                        }
                        else
                        {
                            docFreq = -1;
                        }

                        long nodeTotalTermFreq = subStats.TotalTermFreq();
                        if (totalTermFreq >= 0 && nodeTotalTermFreq >= 0)
                        {
                            totalTermFreq += nodeTotalTermFreq;
                        }
                        else
                        {
                            totalTermFreq = -1;
                        }
                    }

                    return new TermStatistics(term.Bytes(), docFreq, totalTermFreq);
                }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:44,代码来源:ShardSearchingTestBase.cs

示例6: DumbPrefixQuery

 internal DumbPrefixQuery(TestPrefixRandom outerInstance, Term term)
     : base(term.Field())
 {
     this.OuterInstance = outerInstance;
     Prefix = term.Bytes();
 }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:6,代码来源:TestPrefixRandom.cs


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