I've asked myself this question too some times. In this case extending MLT QParser. So far, i've not found a simple means to propagate a parsed top-level Lucene query object over the wire.
But, since there is a clear toString for that Query object, if we could retranslate that String to a real object, could that be lighter than parsing the incoming query text? Markus -----Original message----- > From:Mikhail Khludnev <m...@apache.org> > Sent: Thursday 11th May 2017 10:43 > To: solr-user <solr-user@lucene.apache.org> > Subject: How to avoid unnecessary query parsing on distributed search in > QueryComponent.prepare()? > > Hello, > When the distributed search is requested (SolrCloud), the query component > invokes prepare() where a query is parsed. But then it's just ignored, I > suppose because all work is done by subordinate shards' requests. > It's fine the most of the times because query parsing is cheap. Until we > have a heavy wildcarded complexphrase query, where the expensive expansion > is done during parsing. > How to avoid this waste of resources? Just bypass parsing is rb.isDistrib? > or refactor complexphrase parser moving expansion downstream to rewrite or > createWeight? > -- > Mikhail >