Hi, I wanted to implement my own query, query wich will be specific to my application. The query I want to implement is in fact just a combinaison of sevral already implemented queries. So acheive this, I do this kind of things : public class MyQuery extends Query { private Query query; public MyQuery(String foo) { query = new TermQuery("myfield", foo); } public Weight weight(Searcher searcher) throws IOException { return query.weight(searcher); } public String toString(String field) { return foo; } }
But I have an issue with that kind of queries : I cannot implement createWeight() as I cannot access this function on the underlying query. So the Query's function is used with raise a UnsupportedOperationException. For basic search.search(query), it works. But when I want to filter it : query = new FilteredQuery(query, filter); search.search(query); This raise the UnsupportedOperationException. I just see two options there. * make my own interface which is a factory of query. But I lost the flexibility of extending Query. Even if I want to do a little term query, I will have to make a factory of this term query. * patch Lucene to make createWeight() public any other advise ? cheers, Nicolas -- Nicolas LALEVÉE Solutions & Technologies ANYWARE TECHNOLOGIES Tel : +33 (0)5 61 00 52 90 Fax : +33 (0)5 61 00 51 46 http://www.anyware-tech.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]