Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class WriteLineDocTask

    A task which writes documents, one line per document. Each line is in the following format: title <TAB> date <TAB> body. The output of this task can be consumed by LineDocSource and is intended to save the IO overhead of opening a file per document to be indexed.

    Inheritance
    System.Object
    PerfTask
    WriteLineDocTask
    WriteEnwikiLineDocTask
    Implements
    System.IDisposable
    Inherited Members
    PerfTask.m_logStep
    PerfTask.m_params
    PerfTask.NEW_LINE
    PerfTask.SetRunInBackground(Int32)
    PerfTask.RunInBackground
    PerfTask.BackgroundDeltaPriority
    PerfTask.Stop
    PerfTask.StopNow()
    PerfTask.Clone()
    PerfTask.Dispose()
    PerfTask.RunAndMaybeStats(Boolean)
    PerfTask.GetName()
    PerfTask.SetName(String)
    PerfTask.RunData
    PerfTask.Depth
    PerfTask.ToString()
    PerfTask.ShouldNeverLogAtStart
    PerfTask.ShouldNotRecordStats
    PerfTask.Setup()
    PerfTask.TearDown()
    PerfTask.Params
    PerfTask.DisableCounting
    PerfTask.AlgLineNum
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Benchmarks.ByTask.Tasks
    Assembly: Lucene.Net.Benchmark.dll
    Syntax
    public class WriteLineDocTask : PerfTask, IDisposable
    Remarks

    The format of the output is set according to the output file extension. Compression is recommended when the output file is expected to be large. See info on file extensions in FileType.

    Supports the following parameters:

    • line.file.outthe name of the file to write the output to. That parameter is mandatory. NOTE: the file is re-created.
    • line.fieldswhich fields should be written in each line. (optional, default: DEFAULT_FIELDS).
    • sufficient.fields list of field names, separated by comma, which, if all of them are missing, the document will be skipped. For example, to require that at least one of f1,f2 is not empty, specify: "f1,f2" in this field. To specify that no field is required, i.e. that even empty docs should be emitted, specify "," (optional, default: DEFAULT_SUFFICIENT_FIELDS).

    NOTE: this class is not thread-safe and if used by multiple threads the output is unspecified (as all will write to the same output file in a non-synchronized way).

    Constructors

    | Improve this Doc View Source

    WriteLineDocTask(PerfRunData)

    Declaration
    public WriteLineDocTask(PerfRunData runData)
    Parameters
    Type Name Description
    PerfRunData runData

    Fields

    | Improve this Doc View Source

    DEFAULT_FIELDS

    Fields to be written by default

    Declaration
    public static readonly string[] DEFAULT_FIELDS
    Field Value
    Type Description
    System.String[]
    | Improve this Doc View Source

    DEFAULT_SUFFICIENT_FIELDS

    Default fields which at least one of them is required to not skip the doc.

    Declaration
    public static readonly string DEFAULT_SUFFICIENT_FIELDS
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    FIELDS_HEADER_INDICATOR

    Declaration
    public const string FIELDS_HEADER_INDICATOR = "FIELDS_HEADER_INDICATOR###"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    m_fname

    Declaration
    protected readonly string m_fname
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    SEP

    Declaration
    public const char SEP = '\t'
    Field Value
    Type Description
    System.Char

    Properties

    | Improve this Doc View Source

    SupportsParams

    Declaration
    public override bool SupportsParams { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    PerfTask.SupportsParams

    Methods

    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    PerfTask.Dispose(Boolean)
    | Improve this Doc View Source

    DoLogic()

    Declaration
    public override int DoLogic()
    Returns
    Type Description
    System.Int32
    Overrides
    PerfTask.DoLogic()
    | Improve this Doc View Source

    GetLogMessage(Int32)

    Declaration
    protected override string GetLogMessage(int recsCount)
    Parameters
    Type Name Description
    System.Int32 recsCount
    Returns
    Type Description
    System.String
    Overrides
    PerfTask.GetLogMessage(Int32)
    | Improve this Doc View Source

    LineFileOut(Document)

    Selects output line file by written doc. Default: original output line file.

    Declaration
    protected virtual TextWriter LineFileOut(Document doc)
    Parameters
    Type Name Description
    Lucene.Net.Documents.Document doc
    Returns
    Type Description
    System.IO.TextWriter
    | Improve this Doc View Source

    SetParams(String)

    Set the params (docSize only)

    Declaration
    public override void SetParams(string params)
    Parameters
    Type Name Description
    System.String params

    docSize, or 0 for no limit.

    Overrides
    PerfTask.SetParams(String)
    | Improve this Doc View Source

    WriteHeader(TextWriter)

    Write header to the lines file - indicating how to read the file later.

    Declaration
    protected virtual void WriteHeader(TextWriter out)
    Parameters
    Type Name Description
    System.IO.TextWriter out

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.