Changeset 32509 for main/trunk

Show
Ignore:
Timestamp:
09.10.2018 19:46:17 (13 months ago)
Author:
ak19
Message:

After changes in last 3 commits, reinstating the possible Too_Many_Clauses outcome when expanding a wildcard query to its query terms. (e.g. it occurs when searching for something like a*.)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/lucene-gs/src/org/greenstone/LuceneWrapper4/GS2LuceneQuery.java

    r32508 r32509  
    172172 
    173173        Query query = parseQuery(reader, query_parser, query_string, fuzziness); 
    174         query = recursivelyRewriteQuery(query, reader);      
     174        query = recursivelyRewriteQuery(query, reader, lucene_query_result);         
    175175        // System.err.println("@@@@ final query class name: " + query.getClass()); 
    176176 
     
    477477    // which also does a recursive rewrite. Unfortunately, the existing BooleanQuery does not handle MultiTermQuery 
    478478    // subcomponents. 
    479     protected Query recursivelyRewriteQuery(Query orig_query, IndexReader reader) throws java.io.IOException 
     479    protected Query recursivelyRewriteQuery(Query orig_query, IndexReader reader, LuceneQueryResult lucene_query_result) throws java.io.IOException 
    480480    { 
    481481    //Query query = orig_query.rewrite(reader); 
     
    487487        for (BooleanClause clause : clauses) { 
    488488        Query subQuery = clause.getQuery(); 
    489         subQuery = recursivelyRewriteQuery(subQuery, reader); 
     489        subQuery = recursivelyRewriteQuery(subQuery, reader, lucene_query_result); 
    490490        clause.setQuery(subQuery); 
    491491        } 
     
    529529        // and you'll hit this exception 
    530530 
    531         //lucene_query_result.setError(LuceneQueryResult.TOO_MANY_CLAUSES_ERROR); 
     531        lucene_query_result.setError(LuceneQueryResult.TOO_MANY_CLAUSES_ERROR); 
    532532 
    533533        if(query instanceof MultiTermQuery) { 
     
    563563        return query; 
    564564        } else { 
    565         return recursivelyRewriteQuery(query, reader); 
     565        return recursivelyRewriteQuery(query, reader, lucene_query_result); 
    566566        } 
    567567    }