Class Context
java.lang.Object
org.opengrok.indexer.search.context.Context
This is supposed to get the matching lines from sourcefile.
 since Lucene does not easily give the match context.
- 
Constructor Summary
ConstructorsConstructorDescriptionContext(org.apache.lucene.search.Query query, QueryBuilder qbuilder) Initializes a context generator for matchers derived from the specifiedquery-- which might benulland result inisEmpty()returningtrue. - 
Method Summary
Modifier and TypeMethodDescriptionbooleangetContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits) booleangetContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits, Scopes scopes) ???.booleangetContext2(RuntimeEnvironment env, org.apache.lucene.search.IndexSearcher searcher, int docId, Appendable dest, String urlPrefix, String morePrefix, boolean limit, int tabSize) Look for context for this instance's initialized query in a search resultDocument, and output according to the parameters.booleanisEmpty()voidToggles the alternating value (initiallytrue). 
- 
Constructor Details
- 
Context
Initializes a context generator for matchers derived from the specifiedquery-- which might benulland result inisEmpty()returningtrue.- Parameters:
 query- the query to generate the result forqbuilder- required builder used to createquery
 
 - 
 - 
Method Details
- 
toggleAlt
public void toggleAlt()Toggles the alternating value (initiallytrue). - 
isEmpty
public boolean isEmpty() - 
getContext2
public boolean getContext2(RuntimeEnvironment env, org.apache.lucene.search.IndexSearcher searcher, int docId, Appendable dest, String urlPrefix, String morePrefix, boolean limit, int tabSize) Look for context for this instance's initialized query in a search resultDocument, and output according to the parameters.- Parameters:
 env- required environmentsearcher- required search that produced the documentdocId- document ID for producing contextdest- required target to writeurlPrefix- prefix for linksmorePrefix- optional link to more... pagelimit- a value indicating if the number of matching lines should be limited. N.b. unlikegetContext(java.io.Reader, java.io.Writer, java.lang.String, java.lang.String, java.lang.String, org.opengrok.indexer.analysis.Definitions, boolean, boolean, java.util.List, org.opengrok.indexer.analysis.Scopes), thelimitargument will not be interpreted w.r.t.RuntimeEnvironment.isQuickContextScan().tabSize- optional positive tab size that must accord with the value used when indexing or else postings may be wrongly shifted until re-indexing- Returns:
 - Did it get any matching context?
 
 - 
getContext
 - 
getContext
public boolean getContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits, Scopes scopes) ???. Closes the given in reader on return.- Parameters:
 in- File to be matchedout- to write the contexturlPrefix- URL prefixmorePrefix- to link to more... pagepath- path of the filetags- format to highlight defs.limit- should the number of matching lines be limited?isDefSearch- is definition searchhits- list of hitsscopes- scopes object- Returns:
 - Did it get any matching context?
 
 
 -