Changeset 12390 for trunk/indexers


Ignore:
Timestamp:
2006-08-03T13:19:12+12:00 (18 years ago)
Author:
mdewsnip
Message:

More fixes, many thanks to John Thompson and DL Consulting Ltd.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/indexers/lucene-gs/src/org/greenstone/LuceneWrapper/GS2LuceneQuery.java

    r12387 r12390  
    7575
    7676        // Lucene does "OR" queries by default; do an "AND" query if specified
    77         if (default_conjuction_operator.equals("AND")) {
    78         query_parser.setDefaultOperator(query_parser.AND_OPERATOR);
    79         query_parser_no_stop_words.setDefaultOperator(query_parser.AND_OPERATOR);
    80         }
     77        if (default_conjuction_operator.equals("AND"))
     78                {
     79                    query_parser.setDefaultOperator(query_parser.AND_OPERATOR);
     80                    query_parser_no_stop_words.setDefaultOperator(query_parser.AND_OPERATOR);
     81                }
    8182
    8283        BufferedReader in = new BufferedReader(new InputStreamReader(System.in, "UTF-8"));
    83         while (true) {
    84         // Read the query from STDIN
    85         String query_string = in.readLine();
    86         if (query_string == null || query_string.length() == -1) {
    87             break;
    88         }
    89         ///ystem.err.println("**** query = " + query_string);
    90 
    91         Query query_including_stop_words = query_parser_no_stop_words.parse(query_string);
    92         query_including_stop_words = query_including_stop_words.rewrite(reader);
     84        while (true)
     85                {
     86                    // Read the query from STDIN
     87                    String query_string = in.readLine();
     88                    if (query_string == null || query_string.length() == -1)
     89                        {
     90                            break;
     91                        }
     92                    ///ystem.err.println("**** query = " + query_string);
     93
     94                    Query query_including_stop_words = query_parser_no_stop_words.parse(query_string);
     95                    query_including_stop_words = query_including_stop_words.rewrite(reader);
    9396
    9497                // Split query string into the search terms and the filter terms
     
    201204                        ///ystem.err.println("Rewritten Fuzzy query: " + query.toString());
    202205                    }
    203 
     206                else
     207                    {
     208                        query = query_parser.parse(query_prefix + query_suffix);
     209                        query = query.rewrite(reader);
     210                    }
    204211
    205212        // Perform the query
Note: See TracChangeset for help on using the changeset viewer.