Method CreateFullTextIndex
- Namespace
- YndigoBlue.Velocity.Engine
- Assembly
- YndigoBlue.Velocity.dll
CreateFullTextIndex(FullTextIndex, bool)
Creates a full-text index for advanced text search capabilities on text columns.
public void CreateFullTextIndex(FullTextIndex fullTextIndex, bool overwrite = false)
Parameters
fullTextIndexFullTextIndexThe FullTextIndex object defining the full-text index to create.
overwriteboolIf true, drops and recreates the index if it exists; if false, throws an error if it exists.
Examples
using (var m = new Manager(conn))
{
var schema = m.LoadSchema("app");
var table = schema["articles"];
// Create a full-text index on title and content columns
var ftIndex = new FullTextIndex("ftidx_articles", table);
ftIndex.AddColumn(table["title"]);
ftIndex.AddColumn(table["content"]);
m.CreateFullTextIndex(ftIndex);
}
Remarks
Full-text indexes enable advanced search features like phrase matching, proximity searches, and ranking. Typically used on VarChar or Text columns containing natural language content.
Exceptions
- DbException
Thrown when a database error occurs.