Lines Matching refs:query
59 private final Set<String> highlight = new HashSet<String>(); // put query terms in table
61 public Summarizer(Query query, Analyzer a) {
63 getTerms(query);
124 // containing any query terms.
126 // @TODO: check that phrases in the query are matched in the fragment
137 // how many query terms are present. An excerpt is
168 // If we find a term that's in the query...
183 // SUM_CONTEXT beyond the last query-term.
300 * Get the terms from a query and adds them to hightlite
303 * @param query
306 private void getTerms(Query query) {
307 if (query instanceof BooleanQuery) {
308 getBooleans((BooleanQuery) query);
309 } else if (query instanceof PhraseQuery) {
310 getPhrases((PhraseQuery) query);
311 } else if (query instanceof WildcardQuery) {
312 getWildTerm((WildcardQuery) query);
313 } else if (query instanceof TermQuery) {
314 getTerm((TermQuery) query);
315 } else if (query instanceof PrefixQuery) {
316 getPrefix((PrefixQuery) query);
320 private void getBooleans(BooleanQuery query) {
321 BooleanClause[] queryClauses = query.getClauses();
329 private void getPhrases(PhraseQuery query) {
330 Term[] queryTerms = query.getTerms();
336 private void getTerm(TermQuery query) {
337 highlight.add(query.getTerm().text());
340 private void getWildTerm(WildcardQuery query) {
341 highlight.add(query.getTerm().text());
343 private void getPrefix(PrefixQuery query) {
344 highlight.add(query.getPrefix().text());