Hi Richard Baugh,
The problem with this approach is that the content field is usually not a metafield, and the ContentFilterBuilder class works with metafields only. Having this in mind, I see two options here:
First approach:. Define a new metafield, but do not show it in the user interface. You will save the value from the Content in this metafield, so this value (content text) will become searchable. This process should happen on every item save. You can hook up to the ContentManager.Executing method and the saving there.
Second approach. You can do the search and filtering in several steps:
1. Search the items by the available metafields only. We assume that you will end up with an IList of Generic Content items, right?
2. Implement a foreach() method to iterate through each content item in the list, and perform:
- String.Equals() for matching exact search phrase
- String.Contains() for matching a text within the content
- other rules like regular expression search, or like implementation
Once you find an item that fits in the above criteria, add it in a second IList object.
In the end, you should end up with a list containing items filtered by the default metafields, and the custom logic in the foreach() cycle.
Let me know if I could be of further help.
the Telerik team