Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Interface IFragmentsBuilder

    IFragmentsBuilder is an interface for fragments (snippets) builder classes. A IFragmentsBuilder class can be plugged in to FastVectorHighlighter.

    Namespace: Lucene.Net.Search.VectorHighlight
    Assembly: Lucene.Net.Highlighter.dll
    Syntax
    public interface IFragmentsBuilder

    Methods

    CreateFragment(IndexReader, int, string, FieldFragList)

    create a fragment.

    Declaration
    string CreateFragment(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList)
    Parameters
    Type Name Description
    IndexReader reader

    Lucene.Net.Index.IndexReader of the index

    int docId

    document id to be highlighted

    string fieldName

    field of the document to be highlighted

    FieldFragList fieldFragList

    FieldFragList object

    Returns
    Type Description
    string

    a created fragment or null when no fragment created

    Exceptions
    Type Condition
    IOException

    If there is a low-level I/O error

    CreateFragment(IndexReader, int, string, FieldFragList, string[], string[], IEncoder)

    create a fragment.

    Declaration
    string CreateFragment(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList, string[] preTags, string[] postTags, IEncoder encoder)
    Parameters
    Type Name Description
    IndexReader reader

    Lucene.Net.Index.IndexReader of the index

    int docId

    document id to be highlighted

    string fieldName

    field of the document to be highlighted

    FieldFragList fieldFragList

    FieldFragList object

    string[] preTags

    pre-tags to be used to highlight terms

    string[] postTags

    post-tags to be used to highlight terms

    IEncoder encoder

    an encoder that generates encoded text

    Returns
    Type Description
    string

    a created fragment or null when no fragment created

    Exceptions
    Type Condition
    IOException

    If there is a low-level I/O error

    CreateFragments(IndexReader, int, string, FieldFragList, int)

    create multiple fragments.

    Declaration
    string[] CreateFragments(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList, int maxNumFragments)
    Parameters
    Type Name Description
    IndexReader reader

    Lucene.Net.Index.IndexReader of the index

    int docId

    document id to be highlighter

    string fieldName

    field of the document to be highlighted

    FieldFragList fieldFragList

    FieldFragList object

    int maxNumFragments

    maximum number of fragments

    Returns
    Type Description
    string[]

    created fragments or null when no fragments created. size of the array can be less than maxNumFragments

    Exceptions
    Type Condition
    IOException

    If there is a low-level I/O error

    CreateFragments(IndexReader, int, string, FieldFragList, int, string[], string[], IEncoder)

    create multiple fragments.

    Declaration
    string[] CreateFragments(IndexReader reader, int docId, string fieldName, FieldFragList fieldFragList, int maxNumFragments, string[] preTags, string[] postTags, IEncoder encoder)
    Parameters
    Type Name Description
    IndexReader reader

    Lucene.Net.Index.IndexReader of the index

    int docId

    document id to be highlighter

    string fieldName

    field of the document to be highlighted

    FieldFragList fieldFragList

    FieldFragList object

    int maxNumFragments

    maximum number of fragments

    string[] preTags

    pre-tags to be used to highlight terms

    string[] postTags

    post-tags to be used to highlight terms

    IEncoder encoder

    an encoder that generates encoded text

    Returns
    Type Description
    string[]

    created fragments or null when no fragments created. size of the array can be less than maxNumFragments

    Exceptions
    Type Condition
    IOException

    If there is a low-level I/O error

    Back to top Copyright © 2024 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.