lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <>
Subject How do you map a query for fieldx to fieldy
Date Mon, 02 Nov 2009 22:48:53 GMT
For backwards compatabiity I have to change queries for the track field 
to the recording field. I did this by overriding  QueryParser.newQuery() 
as follows

protected Query newTermQuery(Term term) {
        if ( term.field() == "track" ) {
            return super.newTermQuery(new Term("recording"term.text()));
        else {
            return super.newTermQuery(term);

this seemed to work, but then I realised it didnt work for phrasequeries 
so I have to override QueryParser.newPhraseQuery() but now thinking will 
fail for wilcard queries ectera. Is there just one method I can override 
to deal with this.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message