You may need to implement your own Query class that wraps the generated query and it could always return false for equals.

-- Jack Krupansky

-----Original Message----- From: denl0
Sent: Monday, January 21, 2013 10:54 AM
To: solr-user@lucene.apache.org
Subject: Re: How to combine Qparsers in a plugin?

I build my query like this:

               Query q = QParser.getParser(qstr, "edismax",
req).getQuery();
               return JoinUtil.createJoinQuery("pageFileId", true,
"fileId", q, searcher, ScoreMode.Max);
Is it possible to set that the query never equals.
Here's an updated version of my code:

public class TestParserPlugin extends ExtendedDismaxQParserPlugin{



   @Override
   public QParser createParser(String string, SolrParams sp, SolrParams
sp1, SolrQueryRequest sqr) {

       return new TestParserPlugin.TestParser(string, sp1, sp1, sqr);

   }

   @Override
   public void init(NamedList nl) {

   }


   public class TestParser extends QParser {

       public TestParser(String qstr, SolrParams localParams, SolrParams
params, SolrQueryRequest req) {
           super(qstr, localParams, params, req);
       }

       @Override
       public org.apache.lucene.search.Query parse() throws
org.apache.lucene.queryparser.classic.ParseException {
           //IndexReader reader;
           try {
               //IndexSearcher searcher=req.getSearcher();
               IndexSearcher searcher = req.getSearcher();
               Query q = QParser.getParser(qstr, "edismax",
req).getQuery();
               return JoinUtil.createJoinQuery("pageFileId", true,
"fileId", q, searcher, ScoreMode.Max);
           } catch (IOException ex) {

Logger.getLogger(TestParserPlugin.class.getName()).log(Level.SEVERE, null,
ex);
           }

           return null;
       }

   }






}



--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-combine-Qparsers-in-a-plugin-tp4035011p4035108.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to