Lucene MaxClauseCount error after upgrading to Sitecore 7.2 (rev. 140228)

After upgrading your solution from an early release of Sitecore 7 (ie. 7.0 / 7.1) you might get the following error:

Message: maxClauseCount is set to 1024
Source: Lucene.Net
bij Lucene.Net.Search.BooleanQuery.Add(BooleanClause clause)
bijLucene.Net.Search.MultiTermQuery.ScoringBooleanQueryRewrite.Rewrite(IndexReaderreader, MultiTermQuery query)
bijSitecore.ContentSearch.Linq.Lucene.Queries.SpanWildcardQuery.Rewrite(IndexReaderreader)
bij Lucene.Net.Search.Spans.SpanFirstQuery.Rewrite(IndexReader reader)
bij Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
bij Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
bij Lucene.Net.Search.IndexSearcher.Rewrite(Query original)

You can’t solve this by adjusting the setting:

in your Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config file, but by adding the following lines of code to your SaerchProvider:

Somehow adjusting the setting in your config file won’t have any effect.