本文整理汇总了C#中Term.Field方法的典型用法代码示例。如果您正苦于以下问题:C# Term.Field方法的具体用法?C# Term.Field怎么用?C# Term.Field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Term
的用法示例。
在下文中一共展示了Term.Field方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutomatonQuery
/// <summary>
/// Create a new AutomatonQuery from an <seealso cref="Automaton"/>.
/// </summary>
/// <param name="term"> Term containing field and possibly some pattern structure. The
/// term text is ignored. </param>
/// <param name="automaton"> Automaton to run, terms that are accepted are considered a
/// match. </param>
public AutomatonQuery(Term term, Automaton automaton)
: base(term.Field())
{
this.Term = term;
this.Automaton_Renamed = automaton;
this.Compiled = new CompiledAutomaton(automaton);
}
示例2: FuzzyQuery
/// <summary>
/// Create a new FuzzyQuery that will match terms with an edit distance
/// of at most <code>maxEdits</code> to <code>term</code>.
/// If a <code>prefixLength</code> > 0 is specified, a common prefix
/// of that length is also required.
/// </summary>
/// <param name="term"> the term to search for </param>
/// <param name="maxEdits"> must be >= 0 and <= <seealso cref="LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE"/>. </param>
/// <param name="prefixLength"> length of common (non-fuzzy) prefix </param>
/// <param name="maxExpansions"> the maximum number of terms to match. If this number is
/// greater than <seealso cref="BooleanQuery#getMaxClauseCount"/> when the query is rewritten,
/// then the maxClauseCount will be used instead. </param>
/// <param name="transpositions"> true if transpositions should be treated as a primitive
/// edit operation. If this is false, comparisons will implement the classic
/// Levenshtein algorithm. </param>
public FuzzyQuery(Term term, int maxEdits, int prefixLength, int maxExpansions, bool transpositions)
: base(term.Field())
{
if (maxEdits < 0 || maxEdits > LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE)
{
throw new System.ArgumentException("maxEdits must be between 0 and " + LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE);
}
if (prefixLength < 0)
{
throw new System.ArgumentException("prefixLength cannot be negative.");
}
if (maxExpansions < 0)
{
throw new System.ArgumentException("maxExpansions cannot be negative.");
}
this.Term_Renamed = term;
this.MaxEdits_Renamed = maxEdits;
this.PrefixLength_Renamed = prefixLength;
this.Transpositions_Renamed = transpositions;
this.MaxExpansions = maxExpansions;
SetRewriteMethod(new MultiTermQuery.TopTermsScoringBooleanQueryRewrite(maxExpansions));
}
示例3: DumbRegexpQuery
internal DumbRegexpQuery(TestRegexpRandom2 outerInstance, Term term, int flags)
: base(term.Field())
{
this.OuterInstance = outerInstance;
RegExp re = new RegExp(term.Text(), flags);
Automaton = re.ToAutomaton();
}
示例4: Seek
internal virtual void Seek(TermInfo ti, Term term)
{
Count = 0;
FieldInfo fi = FieldInfos.FieldInfo(term.Field());
this.IndexOptions = (fi != null) ? fi.FieldIndexOptions : FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
CurrentFieldStoresPayloads = (fi != null) ? fi.HasPayloads() : false;
if (ti == null)
{
Df = 0;
}
else
{
Df = ti.DocFreq;
Doc_Renamed = 0;
FreqBasePointer = ti.FreqPointer;
ProxBasePointer = ti.ProxPointer;
SkipPointer = FreqBasePointer + ti.SkipOffset;
FreqStream.Seek(FreqBasePointer);
HaveSkipped = false;
}
}
示例5: 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;
}
示例6: DeepCopyOf
internal static Term DeepCopyOf(Term other)
{
return new Term(other.Field(), BytesRef.DeepCopyOf(other.Bytes()));
}
示例7: 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());
}
}
示例8: CompareField
/// <summary>
/// Compares the fields before checking the text of the terms.
/// </summary>
/// <param name="term">
/// the given term. </param>
/// <param name="termIndex">
/// the term that exists in the data block. </param>
/// <param name="input">
/// the data block. </param>
/// <returns> int. </returns>
/// <exception cref="IOException"> If there is a low-level I/O error. </exception>
private int CompareField(Term term, int termIndex, PagedBytesDataInput input)
{
input.Position = IndexToDataOffset.Get(termIndex);
return term.Field().CompareTo(Fields[input.ReadVInt()].Field());
}
示例9: PrefixQuery
/// <summary>
/// Constructs a query for terms starting with <code>prefix</code>. </summary>
public PrefixQuery(Term prefix)
: base(prefix.Field())
{
this.Prefix_Renamed = prefix;
}
示例10: DumbPrefixQuery
internal DumbPrefixQuery(TestPrefixRandom outerInstance, Term term)
: base(term.Field())
{
this.OuterInstance = outerInstance;
Prefix = term.Bytes();
}