Examples of DocList


Examples of org.apache.solr.search.DocList

  private List checkEngine(CarrotClusteringEngine engine,
                           int expectedNumClusters, SolrParams clusteringParams) throws IOException {
    // Get all documents to cluster
    RefCounted<SolrIndexSearcher> ref = h.getCore().getSearcher();
    MatchAllDocsQuery query = new MatchAllDocsQuery();
    DocList docList;
    try {
      SolrIndexSearcher searcher = ref.get();
      docList = searcher.getDocList(query, (Query) null, new Sort(), 0,
              numberOfDocs);
      assertEquals("docList size", this.numberOfDocs, docList.matches());
    } finally {
      ref.decref();
    }

    ModifiableSolrParams solrParams = new ModifiableSolrParams();
View Full Code Here

Examples of org.apache.solr.search.DocList

      if( ttinfo != null && sfield != null && sfield.indexed() ) {
        Query q = qp.parse( fieldName+":[* TO *]" );
        int docCount = searcher.numDocs( q, matchAllDocs );
        if( docCount > 0 ) {
          // Find a document with this field
          DocList ds = searcher.getDocList( q, (Query)null, (Sort)null, 0, 1 );
          try {
            Document doc = searcher.doc( ds.iterator().next() );
            Fieldable fld = doc.getFieldable( fieldName );
            if( fld != null ) {
              f.add( "index", getFieldFlags( fld ) );
            }
            else {
View Full Code Here

Examples of org.apache.solr.search.DocList

      // Matching options
      boolean includeMatch = params.getBool( MoreLikeThisParams.MATCH_INCLUDE, true );
      int matchOffset = params.getInt( MoreLikeThisParams.MATCH_OFFSET, 0 );
      // Find the base match 
      Query query = QueryParsing.parseQuery(q, params.get(CommonParams.DF), params, req.getSchema());
      DocList match = searcher.getDocList(query, null, null, matchOffset, 1, flags ); // only get the first one...
      if( includeMatch ) {
        rsp.add( "match", match );
      }

      // This is an iterator, but we only handle the first match
      DocIterator iterator = match.iterator();
      if( iterator.hasNext() ) {
        // do a MoreLikeThis query for each document in results
        int id = iterator.nextDoc();
        mltDocs = mlt.getMoreLikeThis( id, start, rows, filters, interesting, flags );
      }
View Full Code Here

Examples of org.apache.solr.search.DocList

        // level values in the NamedList are checked for DocLists.
        NamedList values = rsp.getValues();
        for (int i=0; i<values.size(); i++) {
          Object o = values.getVal(i);
          if (o instanceof DocList) {
            DocList docs = (DocList)o;
            for (DocIterator iter = docs.iterator(); iter.hasNext();) {
              newSearcher.doc(iter.nextDoc());
            }
          }
        }
View Full Code Here

Examples of org.apache.solr.search.DocList

      // Matching options
      boolean includeMatch = params.getBool( MoreLikeThisParams.MATCH_INCLUDE, true );
      int matchOffset = params.getInt( MoreLikeThisParams.MATCH_OFFSET, 0 );
      // Find the base match 
      Query query = QueryParsing.parseQuery(q, params.get(CommonParams.DF), params, req.getSchema());
      DocList match = searcher.getDocList(query, null, null, matchOffset, 1, flags ); // only get the first one...
      if( includeMatch ) {
        rsp.add( "match", match );
      }

      // This is an iterator, but we only handle the first match
      DocIterator iterator = match.iterator();
      if( iterator.hasNext() ) {
        // do a MoreLikeThis query for each document in results
        int id = iterator.nextDoc();
        mltDocs = mlt.getMoreLikeThis( id, start, rows, filters, interesting, flags );
      }
View Full Code Here

Examples of org.apache.solr.search.DocList

    List<Integer> docIds = getInts(params.getParams(TermVectorParams.DOC_IDS));
    Iterator<Integer> iter;
    if (docIds != null && docIds.isEmpty() == false) {
      iter = docIds.iterator();
    } else {
      DocList list = listAndSet.docList;
      iter = list.iterator();
    }
    SolrIndexSearcher searcher = rb.req.getSearcher();

    IndexReader reader = searcher.getReader();
    //the TVMapper is a TermVectorMapper which can be used to optimize loading of Term Vectors
View Full Code Here

Examples of org.apache.solr.search.DocList

        // level values in the NamedList are checked for DocLists.
        NamedList values = rsp.getValues();
        for (int i=0; i<values.size(); i++) {
          Object o = values.getVal(i);
          if (o instanceof DocList) {
            DocList docs = (DocList)o;
            for (DocIterator iter = docs.iterator(); iter.hasNext();) {
              newSearcher.doc(iter.nextDoc());
            }
          }
        }
View Full Code Here

Examples of org.apache.solr.search.DocList

            true);
        int matchOffset = params.getInt(MoreLikeThisParams.MATCH_OFFSET, 0);
        // Find the base match
        Query query = QueryParsing.parseQuery(q, params.get(CommonParams.DF),
            params, req.getSchema());
        DocList match = searcher.getDocList(query, null, null, matchOffset, 1,
            flags); // only get the first one...
        if (includeMatch) {
          rsp.add("match", match);
        }

        // This is an iterator, but we only handle the first match
        DocIterator iterator = match.iterator();
        if (iterator.hasNext()) {
          // do a MoreLikeThis query for each document in results
          int id = iterator.nextDoc();
          mltDocs = mlt.getMoreLikeThis(id, start, rows, filters, interesting,
              flags);
View Full Code Here

Examples of org.apache.solr.search.DocList

    }
  }

  public void process(ResponseBuilder rb) throws IOException {

    DocList list = rb.getResults().docList;

    DocIterator it = list.iterator();

    List<Integer> docIds = new ArrayList<Integer>(list.size());

    while (it.hasNext())
      docIds.add(it.next());
   
        IndexReader reader = (IndexReader) ((SolrIndexReader) rb.req.getSearcher().getIndexReader())
View Full Code Here

Examples of org.apache.solr.search.DocList

   
    @Override
    public void process(ResponseBuilder rb) throws IOException
    {
       
        DocList list = rb.getResults().docList;

        DocIterator it = list.iterator();

        List<Integer> docIds = new ArrayList<Integer>(list.size());
       
        while (it.hasNext())
            docIds.add(it.next());

        if(logger.isDebugEnabled())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.