With two queries. I'm not sure there's another way to do it. Unless you were prepared to get coding, and implement another SearchComponent, but given that you can achieve it with two queries, that seems overkill to me.
Upayavira On Tue, Jun 18, 2013, at 10:59 AM, Prathik Puthran wrote: > Hi, > > I wanted to know if it is possible to tweak solr to return the results of > both complete and partial query matches. > > For eg: > If the search query is "Brad Pitt" and if the query parser is "AND" Solr > returns all documents indexed against the term "Brad Pitt". > If the query parser is "OR" Solr returns all the documents indexed > against > the term "Brad Pitt", "Brad", "Pitt". > > I want to the Solr to return the data in a way such that all the results > matched by the "AND" parser (i.e. Complete match) should be in a seperate > key- value pair in JSON response. > i.e. "CompleteMatch :[doc1, doc2, doc3...]" > and all the partial matches which are not part of complete match should > be > a seperate key-value pair in JSON response i.e. > "PartialMatch : [doc4, doc5, doc6]. > > How can I achieve this? > > Thanks, > Prathik