I have found an example for fts support in cb 2. So I have implemented the index the following way:
var name = “fts_index”
var indices = new List();
// fullTextFields is a string list of fields to be indexed
foreach (var field in fullTextFields)
{
indices.Add(FullTextIndexItem.Property(field.Key));
}
var ftsIndex = IndexBuilder.FullTextIndex(indices.ToArray());
Context.CreateIndex(name, ftsIndex);
Then i am calling my Query with following params:
var term = string.empty; //the search term tb replaced by any valid term
var ftsExpression = FullTextExpression.Index(“fts_index”);
var query = QueryBuilder.Select(SelectResult.Expression(Meta.ID))
.From(DataSource.Database(Context))
.Where(Expression.Property(“Type”).EqualTo(Expression.String(typeof(tt).Name))
.And(ftsExpression.Match(term + “*”)))
.Limit(Expression.Int(1000), Expression.Int(0));
var res = query.Execute();
no matter what i set for term i do not get any results… res is always not containing a collection. with string empty all items of type tt should be returned…
Yes i am using the upper Case for Type.
A normal Query like:
var query = QueryBuilder.Select(SelectResult.Expression(Meta.ID)) .From(DataSource.Database(Context)).Where(Expression.Property(“Type”).EqualTo(Expression.String(typeof(tt).Name)));
returns the results perfectly.
Only with fulltextsearch i do not get any results…
and yes i have tried different terms, but none is working
If you believe it’s an issue then create a simple self contained program that shows the unexpected behavior and someone will look at it if you file an issue