deduplicator-heritrix/src/main/java/is/landsbokasafn/deduplicator/heritrix/LuceneIndexSearcher.java
/**
     * Do a search for duplicates in the index based on the provided query. 
     * @param query The query to perform. Query must be structured so that any results returned are valid duplicates
     *              (i.e. mandatory search term on appropriate digest) and structured so that the first hit is 
     *              the most appropriate one to use if there are multiple hits.
     * @return A duplicate based on the first hit of the query or null if query returned no hits.
     */
Do a search for duplicates in the index based on the provided query.
@param query The query to perform. Query must be structured so that any results returned are valid duplicates
and structured so that the first hit is
the most appropriate one to use if there are multiple hits.
@return A duplicate based on the first hit of the query or null if query returned no hits.
Do a search for duplicates in the index based on the provided query . @param query The query to perform . Query must be structured so that any results returned are valid duplicates and structured so that the first hit is the most appropriate one to use if there are multiple hits . @return A duplicate based on the first hit of the query or null if query returned no hits .
protected Document query(Query query) {
		Document doc = null; 
		try {
			ScoreDoc[] hits = searcher.search(query, null, 1).scoreDocs;
            if(hits != null && hits.length > 0){
                doc = searcher.doc(hits[0].doc);
            }
		} catch (IOException e) {
			logger.log(Level.SEVERE, "Error accessing index.", e);
		}
		return doc; 
	}
protected Document query ( Query query ) { Document doc = null ; try { ScoreDoc [ ] hits = searcher . search ( query , null , 1 ) . scoreDocs ; if ( hits != null && hits . length > 0 ) { doc = searcher . doc ( hits [ 0 ] . doc ) ; } } catch ( IOException e ) { logger . log ( Level . SEVERE , "Error accessing index." , e ) ; } return doc ; }
Do a search for duplicates in the index based on the provided query.
Do a search for duplicates in the index based on the provided query .