Table of Contents

Method FullTextSearch

Namespace
YndigoBlue.Velocity.Engine
Assembly
YndigoBlue.Velocity.dll

FullTextSearch(Table, IEnumerable<Column>, string)

Performs a full-text search on a table and returns a forward-only, connected data reader.

public ResultReader FullTextSearch(Table table, IEnumerable<Column> columns, string query)

Parameters

table Table

The Table to search (must have a full-text index).

columns IEnumerable<Column>

The columns to include in the search results.

query string

The full-text search query string.

Returns

ResultReader

A ResultReader for iterating through matching records.

Examples

using (var m = new Manager(conn))
{
    var schema = m.LoadSchema("app");
    var articlesTable = schema["articles"];

    var columns = new[] { articlesTable["title"], articlesTable["content"], articlesTable["author"] };

    using (var reader = m.FullTextSearch(articlesTable, columns, "database performance"))
    {
        while (reader.Read())
        {
            Console.WriteLine($"Title: {reader["title"]}");
        }
    }
}

Remarks

The table must have a full-text index created on the columns being searched. The search query syntax depends on the database system being used.

Exceptions

DbException

Thrown when a database error occurs.