Package org.apache.lucene.search

Examples of org.apache.lucene.search.Searcher.doc()


       
        SessionHitsOrganizer hitsOrganizer = null;     
     
        for (int i = start; i < end; i++) {
          float score = hits[i].score;         
          Document doc = searcher.doc(hits[i].doc);         
          String path = doc.get("path");     
         
          if (path != null) {
            MatchVO matchVO = new MatchVO();
            matchVO.setFilePath(path);
View Full Code Here


  // ensure that queries return expected results without DateFilter first
        ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
  assertEquals(1, hits.length);

         doAssert(searcher.doc(hits[0].doc), true);
         searcher.close();
    }

    private Document makeDocumentWithFields()
    {
View Full Code Here

      // ensure that queries return expected results without DateFilter first
      ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
      assertEquals(3, hits.length);
      int result = 0;
      for(int i=0;i<3;i++) {
        Document doc2 = searcher.doc(hits[i].doc);
        Field f = doc2.getField("id");
        if (f.stringValue().equals("id1"))
          result |= 1;
        else if (f.stringValue().equals("id2"))
          result |= 2;
View Full Code Here

                // if document is found, compare the
                // indexed last modified time with the
                // current file
                // - don't index if up to date
                if (hits.length > 0) {
                  Document doc = searcher.doc(hits[0].doc);
                  String indexModified =
                    doc.get("modified").trim();
                  if (indexModified != null) {
                    long lastModified = 0;
                    try {
View Full Code Here

           
            for (int i = 0; i < count; i++)
            {
                ParsedObject result = new BaseParsedObject();
               
              Document doc = searcher.doc(topDocs.scoreDocs[i].doc);
         
            addFieldsToParsedObject(doc, result);
           
            result.setScore(topDocs.scoreDocs[i].score);
            Field type = doc.getField(ParsedObject.FIELDNAME_TYPE);
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.