src/retrieval based query topic analysis/src/edu/virginia/cs/index/Searcher.java
public SearchResult search(SearchQuery searchQuery) {
        BooleanQuery combinedQuery = new BooleanQuery();
        for (String field : searchQuery.fields()) {
            QueryParser parser = new QueryParser(Version.LUCENE_46, field, analyzer);
            try {
                Query textQuery = parser.parse(searchQuery.queryText());
                combinedQuery.add(textQuery, BooleanClause.Occur.MUST);
            } catch (ParseException ex) {
                Logger.getLogger(Searcher.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        return runSearch(combinedQuery, searchQuery);
    }
/**
     * The main search function.
     *
     * @param searchQuery Set this object's attributes as needed.
     * @return
     */
The main search function.
@param searchQuery Set this object's attributes as needed.
@return
The main search function . @param searchQuery Set this object ' s attributes as needed . @return
public SearchResult search(SearchQuery searchQuery) {
        BooleanQuery combinedQuery = new BooleanQuery();
        for (String field : searchQuery.fields()) {
            QueryParser parser = new QueryParser(Version.LUCENE_46, field, analyzer);
            try {
                Query textQuery = parser.parse(searchQuery.queryText());
                combinedQuery.add(textQuery, BooleanClause.Occur.MUST);
            } catch (ParseException ex) {
                Logger.getLogger(Searcher.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return runSearch(combinedQuery, searchQuery);
    }
public SearchResult search ( SearchQuery searchQuery ) { BooleanQuery combinedQuery = new BooleanQuery ( ) ; for ( String field : searchQuery . fields ( ) ) { QueryParser parser = new QueryParser ( Version . LUCENE_46 , field , analyzer ) ; try { Query textQuery = parser . parse ( searchQuery . queryText ( ) ) ; combinedQuery . add ( textQuery , BooleanClause . Occur . MUST ) ; } catch ( ParseException ex ) { Logger . getLogger ( Searcher . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } return runSearch ( combinedQuery , searchQuery ) ; }
The main search function.
The main search function .