本文整理汇总了C#中Lucene.Net.Search.Similarity类的典型用法代码示例。如果您正苦于以下问题:C# Lucene.Net.Search.Similarity类的具体用法?C# Lucene.Net.Search.Similarity怎么用?C# Lucene.Net.Search.Similarity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Lucene.Net.Search.Similarity类属于命名空间,在下文中一共展示了Lucene.Net.Search.Similarity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SpanScorer
internal SpanScorer(Spans spans, Weight weight, Similarity similarity, byte[] norms) : base(similarity)
{
this.spans = spans;
this.norms = norms;
this.weight = weight;
this.value_Renamed = weight.GetValue();
}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:7,代码来源:SpanScorer.cs
示例2: DocumentWriter
/// <summary>This ctor used by test code only.
///
/// </summary>
/// <param name="directory">The directory to write the document information to
/// </param>
/// <param name="analyzer">The analyzer to use for the document
/// </param>
/// <param name="similarity">The Similarity function
/// </param>
/// <param name="maxFieldLength">The maximum number of tokens a field may have
/// </param>
public DocumentWriter(Directory directory, Analyzer analyzer, Similarity similarity, int maxFieldLength)
{
InitBlock();
this.directory = directory;
this.analyzer = analyzer;
this.similarity = similarity;
this.maxFieldLength = maxFieldLength;
}
开发者ID:zweib730,项目名称:beagrep,代码行数:19,代码来源:DocumentWriter.cs
示例3: SpanWeight
public SpanWeight(SpanQuery query, Searcher searcher)
{
this.similarity = query.GetSimilarity(searcher);
this.query = query;
this.terms = query.GetTerms();
idf = this.query.GetSimilarity(searcher).Idf(terms, searcher);
}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:8,代码来源:SpanWeight.cs
示例4: SpanWeight
public SpanWeight(SpanQuery query, Searcher searcher)
{
this.similarity = query.GetSimilarity(searcher);
this.query = query;
terms = new System.Collections.Hashtable();
query.ExtractTerms(terms);
System.Collections.ArrayList tmp = new System.Collections.ArrayList(terms.Values);
idf = this.query.GetSimilarity(searcher).Idf(tmp, searcher);
}
开发者ID:vineelkovvuri,项目名称:ExtendableDesktopSearch,代码行数:11,代码来源:SpanWeight.cs
示例5: SpanScorer
protected internal SpanScorer(Spans spans, Weight weight, Similarity similarity, byte[] norms):base(similarity)
{
this.spans = spans;
this.norms = norms;
this.weight = weight;
this.value_Renamed = weight.GetValue();
if (this.spans.Next())
{
doc = - 1;
}
else
{
doc = NO_MORE_DOCS;
more = false;
}
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:16,代码来源:SpanScorer.cs
示例6: PayloadNearSpanScorer
protected internal PayloadNearSpanScorer(PayloadNearQuery enclosingInstance, Lucene.Net.Search.Spans.Spans spans, Weight weight, Similarity similarity, byte[] norms)
: base(spans, weight, similarity, norms)
{
InitBlock(enclosingInstance);
this.spans = spans;
}
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:6,代码来源:PayloadNearQuery.cs
示例7: SetSimilarity
/// <summary>Expert: Set the Similarity implementation used by this IndexWriter.
///
/// </summary>
/// <seealso cref="Similarity.SetDefault(Similarity)">
/// </seealso>
public virtual void SetSimilarity(Similarity similarity)
{
EnsureOpen();
this.similarity = similarity;
docWriter.SetSimilarity(similarity);
}
开发者ID:Mpdreamz,项目名称:lucene.net,代码行数:11,代码来源:IndexWriter.cs
示例8: DocumentsWriter
internal DocumentsWriter(Directory directory, IndexWriter writer)
{
this.directory = directory;
this.writer = writer;
this.similarity = writer.GetSimilarity();
flushedDocCount = writer.MaxDoc();
byteBlockAllocator = new ByteBlockAllocator(this);
waitQueue = new WaitQueue(this);
/*
This is the current indexing chain:
DocConsumer / DocConsumerPerThread
--> code: DocFieldProcessor / DocFieldProcessorPerThread
--> DocFieldConsumer / DocFieldConsumerPerThread / DocFieldConsumerPerField
--> code: DocFieldConsumers / DocFieldConsumersPerThread / DocFieldConsumersPerField
--> code: DocInverter / DocInverterPerThread / DocInverterPerField
--> InvertedDocConsumer / InvertedDocConsumerPerThread / InvertedDocConsumerPerField
--> code: TermsHash / TermsHashPerThread / TermsHashPerField
--> TermsHashConsumer / TermsHashConsumerPerThread / TermsHashConsumerPerField
--> code: FreqProxTermsWriter / FreqProxTermsWriterPerThread / FreqProxTermsWriterPerField
--> code: TermVectorsTermsWriter / TermVectorsTermsWriterPerThread / TermVectorsTermsWriterPerField
--> InvertedDocEndConsumer / InvertedDocConsumerPerThread / InvertedDocConsumerPerField
--> code: NormsWriter / NormsWriterPerThread / NormsWriterPerField
--> code: StoredFieldsWriter / StoredFieldsWriterPerThread / StoredFieldsWriterPerField
*/
// TODO FI: this should be something the user can pass in
// Build up indexing chain:
TermsHashConsumer termVectorsWriter = new TermVectorsTermsWriter(this);
TermsHashConsumer freqProxWriter = new FreqProxTermsWriter();
InvertedDocConsumer termsHash = new TermsHash(this, true, freqProxWriter,
new TermsHash(this, false, termVectorsWriter, null));
NormsWriter normsWriter = new NormsWriter();
DocInverter docInverter = new DocInverter(termsHash, normsWriter);
StoredFieldsWriter fieldsWriter = new StoredFieldsWriter(this);
DocFieldConsumers docFieldConsumers = new DocFieldConsumers(docInverter, fieldsWriter);
consumer = docFieldProcessor = new DocFieldProcessor(this, docFieldConsumers);
}
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:41,代码来源:DocumentsWriter.cs
示例9: WriteDoc
/// <summary> Writes the document to the directory segment using the analyzer and the similarity score</summary>
/// <param name="">dir
/// </param>
/// <param name="">analyzer
/// </param>
/// <param name="">similarity
/// </param>
/// <param name="">segment
/// </param>
/// <param name="">doc
/// </param>
public static void WriteDoc(Directory dir, Analyzer analyzer, Similarity similarity, System.String segment, Document doc)
{
DocumentWriter writer = new DocumentWriter(dir, analyzer, similarity, 50);
try
{
writer.AddDocument(segment, doc);
}
catch (System.IO.IOException e)
{
System.Console.Error.WriteLine(e.StackTrace);
}
}
开发者ID:emtees,项目名称:old-code,代码行数:23,代码来源:DocHelper.cs
示例10: JustCompileSpanScorer
internal JustCompileSpanScorer(Spans spans, Weight weight, Similarity similarity, byte[] norms):base(spans, weight, similarity, norms)
{
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:3,代码来源:JustCompileSearchSpans.cs
示例11: SetUp
/// <summary> Sets up a RAMDirectory, and adds documents (using English.intToEnglish()) with two fields: field and multiField
/// and analyzes them using the PayloadAnalyzer
/// </summary>
/// <param name="similarity">The Similarity class to use in the Searcher
/// </param>
/// <param name="numDocs">The num docs to add
/// </param>
/// <returns> An IndexSearcher
/// </returns>
/// <throws> IOException </throws>
public virtual IndexSearcher SetUp(Similarity similarity, int numDocs)
{
RAMDirectory directory = new RAMDirectory();
PayloadAnalyzer analyzer = new PayloadAnalyzer(this);
IndexWriter writer = new IndexWriter(directory, analyzer, true);
writer.SetSimilarity(similarity);
//writer.infoStream = System.out;
for (int i = 0; i < numDocs; i++)
{
Document doc = new Document();
doc.Add(new Field(FIELD, English.IntToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
doc.Add(new Field(MULTI_FIELD, English.IntToEnglish(i) + " " + English.IntToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
doc.Add(new Field(NO_PAYLOAD_FIELD, English.IntToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
writer.AddDocument(doc);
}
//writer.optimize();
writer.Close();
IndexSearcher searcher = new IndexSearcher(directory);
searcher.SetSimilarity(similarity);
return searcher;
}
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:32,代码来源:PayloadHelper.cs
示例12: SetSimilarity
internal void SetSimilarity(Similarity similarity)
{
lock (this)
{
this.similarity = similarity;
for (int i = 0; i < threadStates.Length; i++)
threadStates[i].docState.similarity = similarity;
}
}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:9,代码来源:DocumentsWriter.cs
示例13: InitBlock
private void InitBlock(PayloadNearQuery enclosingInstance)
{
this.enclosingInstance = enclosingInstance;
similarity = GetSimilarity();
}
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:5,代码来源:PayloadNearQuery.cs
示例14: SetSimilarity
public void SetSimilarity(Lucene.Net.Search.Similarity similarity)
{
this.similarity = similarity;
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:4,代码来源:MoreLikeThis.cs
示例15: MoreLikeThis
public MoreLikeThis(IndexReader ir, Lucene.Net.Search.Similarity sim)
{
this.ir = ir;
this.similarity = sim;
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:5,代码来源:MoreLikeThis.cs
示例16: InitBlock
private void InitBlock()
{
similarity = Similarity.GetDefault();
}
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:4,代码来源:IndexWriter.cs
示例17: SetSimilarity
/// <summary>Expert: Set the Similarity implementation used by this IndexWriter.
///
/// </summary>
/// <seealso cref="Similarity.SetDefault(Similarity)">
/// </seealso>
public virtual void SetSimilarity(Similarity similarity)
{
this.similarity = similarity;
}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:9,代码来源:IndexWriter.cs
示例18: InitBlock
private void InitBlock()
{
similarity = Similarity.GetDefault();
mergePolicy = new LogByteSizeMergePolicy(this);
readerPool = new ReaderPool(this);
}
开发者ID:o0111,项目名称:ruralcafe,代码行数:6,代码来源:IndexWriter.cs
示例19: WriteDoc
/// <summary> Writes the document to the directory using the analyzer
/// and the similarity score; returns the SegmentInfo
/// describing the new segment
/// </summary>
/// <param name="dir">
/// </param>
/// <param name="analyzer">
/// </param>
/// <param name="similarity">
/// </param>
/// <param name="doc">
/// </param>
/// <throws> IOException </throws>
public static SegmentInfo WriteDoc(Directory dir, Analyzer analyzer, Similarity similarity, Document doc)
{
IndexWriter writer = new IndexWriter(dir, analyzer, IndexWriter.MaxFieldLength.LIMITED);
writer.SetSimilarity(similarity);
//writer.setUseCompoundFile(false);
writer.AddDocument(doc);
writer.Flush();
SegmentInfo info = writer.NewestSegment();
writer.Close();
return info;
}
开发者ID:Rationalle,项目名称:ravendb,代码行数:24,代码来源:DocHelper.cs
示例20: DocumentsWriter
internal DocumentsWriter(Directory directory, IndexWriter writer, IndexingChain indexingChain)
{
InitBlock();
this.directory = directory;
this.writer = writer;
this.similarity = writer.GetSimilarity();
flushedDocCount = writer.MaxDoc();
consumer = indexingChain.GetChain(this);
if (consumer is DocFieldProcessor)
{
docFieldProcessor = (DocFieldProcessor) consumer;
}
}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:14,代码来源:DocumentsWriter.cs
注:本文中的Lucene.Net.Search.Similarity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论