public DocListAndSet getMoreLikeThis( Reader reader, int start, int rows, List<Query> filters, List<InterestingTerm> terms, int flags ) throws IOException { mltquery = mlt.like(reader); setBoosts(mltquery); if( terms != null ) { fillInterestingTermsFromMLTQuery( mltquery, terms ); } DocListAndSet results = new DocListAndSet(); if (this.needDocSet) { results = searcher.getDocListAndSet(mltquery, filters, null, start, rows, flags); } else { results.docList = searcher.getDocList(mltquery, filters, null, start, rows, flags); } return results; }
public MLTResult getMoreLikeThisFromContentSteam(Reader reader, int start, int rows, List<Query> filters, int flags, Sort lsort) throws IOException, SyntaxError { MLTQuery mltQuery = mlt.like(reader); Query rawMLTQuery = mltQuery.getOrQuery(); if(mltQuery.getMustMatchQuery() != null || mltQuery.getMustNOTMatchQuery() != null){ throw new RuntimeException( String.format("The %s and the %s parameters are not supported for content stream queries", MoreLikeThisParams.FL_MUST_MATCH, MoreLikeThisParams.FL_MUST_NOT_MATCH)); } Query boostedMLTQuery = getBoostedFunctionQuery( rawMLTQuery ); DocListAndSet results = new DocListAndSet(); if (this.needDocSet) { results = searcher.getDocListAndSet( boostedMLTQuery, filters, lsort, start, rows, flags); } else { results.docList = searcher.getDocList( boostedMLTQuery, filters, lsort, start, rows, flags); } return new MLTResult(mltQuery.getMltTerms(), boostedMLTQuery, results); }
public DocListAndSet getMoreLikeThis( int id, int start, int rows, List<Query> filters, List<InterestingTerm> terms, int flags ) throws IOException { Document doc = reader.document(id); mltquery = mlt.like(id); setBoosts(mltquery); if( terms != null ) { fillInterestingTermsFromMLTQuery( mltquery, terms ); } // exclude current document from results BooleanQuery mltQuery = new BooleanQuery(); mltQuery.add(mltquery, BooleanClause.Occur.MUST); mltQuery.add( new TermQuery(new Term(uniqueKeyField.getName(), uniqueKeyField.getType().storedToIndexed(doc.getFieldable(uniqueKeyField.getName())))), BooleanClause.Occur.MUST_NOT); DocListAndSet results = new DocListAndSet(); if (this.needDocSet) { results = searcher.getDocListAndSet(mltQuery, filters, null, start, rows, flags); } else { results.docList = searcher.getDocList(mltQuery, filters, null, start, rows, flags); } return results; }
results = searcher.getDocListAndSet(finalMLTQuery, filters, lsort, start, rows, flags); } else { results.docList = searcher.getDocList(finalMLTQuery, filters, lsort, start, rows, flags);
results = searcher.getDocListAndSet(finalUfQuery, filters, lsort, start, rows, flags); } else { results.docList = searcher.getDocList(finalUfQuery, filters, lsort, start, rows, flags);
DocListAndSet both = searcher.getDocListAndSet(query,filter,sort,start, limit); test( both.docList.equals(results) ); test( both.docList.matches() == both.docSet.size() ); DocListAndSet both2 = searcher.getDocListAndSet(query,both.docSet,sort,start, limit); test( both2.docList.equals(both.docList) ); test( both2.docSet.equals(both.docSet) ); DocListAndSet both3 = searcher.getDocListAndSet(query,query,sort,start, limit); test( both3.docList.equals(both.docList) ); test( both3.docSet.equals(both.docSet) ); both2 = searcher.getDocListAndSet(query,new BitDocSet(neg),sort, start, limit); test( both2.docList.size() == 0 ); test( both2.docList.matches() == 0 );
collapseRequest.getCollapser().collapse(rb.getQuery(), rb.getFilters(), rb.getSortSpec().getSort()); DocListAndSet results = searcher.getDocListAndSet(rb.getQuery(), collapseResult == null ? rb.getFilters() : null, collapseResult.getCollapsedDocset(),