SearchEngine.java revision 1425
0N/A * See LICENSE.txt included in this distribution for the specific
0N/A * file and include the License file at LICENSE.txt.
0N/Apublic class SearchEngine {
1238N/A private static final boolean docsScoredInOrder = false;
1185N/A boolean allCollected;
0N/A public SearchEngine() {
986N/A return new QueryBuilder()
236N/A public boolean isValidQuery() {
1425N/A IndexReader ireader = (IndexReader.open(FSDirectory.open(new File(droot,project.getPath()) )));
1318N/A int noThreads = 2 + (2 * Runtime.getRuntime().availableProcessors()); //TODO there might be a better way for counting this - or we should honor the command line option here too!
816N/A * Note that this search will return the first cachePages of hitsPerPage, for more you need to call more
830N/A //TODO support paging per project (in search.java)
508N/A OpenGrokLogger.getLogger().log(Level.WARNING, "An error occured while getting history context", e);
816N/A * hence performance hit applies, if you want results in later pages than number of cachePages
816N/A } catch (Exception e) { // this exception should never be hit, since search() will hit this before
816N/A allCollected=true;
816N/A //TODO generation of ret(results) could be cashed and consumers of engine would just print them in whatever form they need, this way we could get rid of docs
0N/A boolean hasContext = false;
816N/A r = new TagFilter(new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(data + "/xref" + filename+".gz"))))); }
816N/A //TODO FIX below fragmenter according to either summarizer or context (to get line numbers, might be hard, since xref writers will need to be fixed too, they generate just one line of html code now :( )
0N/A hasContext = true;
816N/A OpenGrokLogger.getLogger().warning("Couldn't read summary from "+filename+" ("+exp.getMessage()+")");
0N/A if(!hasContext) {
0N/A } catch (IOException e) {
350N/A } catch (ClassNotFoundException e) {
615N/A } catch (HistoryException e) {
0N/A return this.definition;