Index: src/java/org/apache/lucene/queryParser/ComplexPhraseQueryParser.java =================================================================== --- src/java/org/apache/lucene/queryParser/ComplexPhraseQueryParser.java (revision 797438) +++ src/java/org/apache/lucene/queryParser/ComplexPhraseQueryParser.java (working copy) @@ -79,6 +79,7 @@ if (isPass2ResolvingPhrases) { boolean oldConstantScoreRewriteSetting = getConstantScoreRewrite(); try { + // Temporarily set constantScoreRewrite to false so that Parser will // generate visible // collection of terms which we can convert into SpanQueries. @@ -205,12 +206,17 @@ // parse // thread is through protected void parsePhraseElements(QueryParser qp) throws ParseException { - // TODO ensure that field-sensitivity is preserved ie the query - // string below is parsed as - // field+":("+phrasedQueryStringContents+")" - // but this will need code in rewrite to unwrap the first layer of - // boolean query - contents = qp.parse(phrasedQueryStringContents); + String oldDefaultParserField=qp.field; + try + { + //temporarily set the QueryParser to be parsing the default field for this phrase e.g author:"fred* smith" + qp.field=field; + contents = qp.parse(phrasedQueryStringContents); + } + finally + { + qp.field=oldDefaultParserField; + } } public Query rewrite(IndexReader reader) throws IOException {