Disclaimer: I cannot post actual code due to security reasons.
Summary: I’m having an issue with FieldFullTextSearchPredicate. I have a complex object with many child objects I am prefetching and I want to be able FullText search on all objects/child objects retrieved. I will be using a fictitious Person class as an example.
Working example retrieves data correctly with "Jones":
var _prefetchPerson = new PrefetchPath2(EntityType.PersonEntity);
_prefetchPerson.Add(PersonEntity.PrefetchPathCareer);
_prefetchPerson.Add(PersonEntity.PrefetchPathBank);
var _filter = new RelationPredicateBucket();
var predPerson = new FieldFullTextSearchPredicate(
new[] {PersonFields.FirstName,
PersonFields.LastName},
FullTextSearchOperator.Contains, "Jones");
_filter.PredicateExpression.AddWithOr(predPerson);
var result = PersonService.Get(_filter, _prefetchPerson);
Non-working example, returns 0 objects even though they satisfy the search condition with "Jones":
var _prefetchPerson = new PrefetchPath2(EntityType.PersonEntity);
_prefetchPerson.Add(PersonEntity.PrefetchPathCareer);
_prefetchPerson.Add(PersonEntity.PrefetchPathBank);
var _filter = new RelationPredicateBucket();
var predPerson = new FieldFullTextSearchPredicate(
new[] {PersonFields.FirstName,
PersonFields.LastName},
FullTextSearchOperator.Contains, "Jones");
var predCareer = new FieldFullTextSearchPredicate(
new[] {CareerFields.Name,
CareerFields.CompanyName},
FullTextSearchOperator.Contains, "Jones");
var predBank = new FieldFullTextSearchPredicate(
new[] {BankFields.Name,
BankFields.AccountName},
FullTextSearchOperator.Contains, "Jones");
_filter.Relations.Add(Person.Relations.CareerEntityUsingPersonId);
_filter.Relations.Add(Person.Relations.BankEntityUsingPersonId);
_filter.PredicateExpression.AddWithOr(predPerson);
_filter.PredicateExpression.AddWithOr(predCareer);
_filter.PredicateExpression.AddWithOr(predBank);
var result = PersonService.Get(_filter, _prefetchPerson);
LLBLGen Pro version: 5.7 (5.7.2) RTM
SQL Server version: Microsoft SQL Server 2016 (SP2) (KB4052908 ) - 13.0.5026.0 (X64) (Build 17763: ) (Hypervisor)
Let me know if I can provide any further information.
Any assistance is appreciated. Thank you