Hi Koji: I think as far as attribute+QP, it might not be the best way to go.
For example, another way (and customization of phrase query) is on SOLR-2660.
In that patch i added factory methods to QueryParser so you can override this:
then hooks to solr's fieldtype.
But with the attribute approach, what happens if I omit positions AND use n-grams?
This is a totally reasonable thing to do, since positions are redundantly encoded
in the n-gram term text, it makes sense i might not index any positions at all
and approximate my phrase queries with boolean AND
I think subclassing is a better approach: because otherwise how do we
determine which would run first in the case of multiple conflicting attributes?
In this case then the consumer (e.g. Solr) is forced to decide and its more consistent
with the way other queries are generated: getXXXQuery() etc.