Search Records
Entity fields in Magentrix can be marked as "Searchable", which allows administrators to optimize search on various Entities.
The search utilizes a FULL-TEXT search method where it can ignore noise words and rank the results based on how relevant the records are to the search term.
Magentrix makes it extremely easy to take advantage of this functionality. The below example shows how you can search for all accounts that have the word "ACME" in their description or name fields (or any other field that is marked as Searchable).
var searchResults = Database.Search<Account>("Acme")
.Select(f => new { f.Id, f.Name })
.Limit(1000)
.ToList();Note: It is best practice not to add an "OrderBy" to your search queries. This way, you can get the results based on how relevant the data is to the search term.
While using Search functionality just like regular queries, you can use all commands to filter or sort the data as well.
var accountQuery = Database.Search<Account>("Acme")
.Select(f => new { f.Id, f.Name, f.Industry });
accountQuery.Where(f => f.Industry == "Telecom");
accountQuery.Limit(100);
var searchResults = accountQuery.ToList();