Examples of fields()


Examples of org.apache.lucene.document.Document.fields()

    List results = new ArrayList(result_count);
    for(int i=0;i<result_count;i++){
      Document doc = (Document)hits.doc(i);
      //ӳ���ĵ����Ե�Java������
      Object result = params.getSearchObject().newInstance();
      Enumeration fields = doc.fields();
      while(fields.hasMoreElements()){
        Field field = (Field)fields.nextElement();
        //System.out.println(field.name()+" -- "+field.stringValue());
        if(CLASSNAME_FIELD.equals(field.name()))
          continue;
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

                    String.valueOf(score));
            atts.addAttribute(namespace, URI_ATTRIBUTE, URI_ATTRIBUTE, CDATA,
                    String.valueOf(uri));
            contentHandler.startElement(namespace, HIT_ELEMENT, HIT_ELEMENT, atts);
            // fix me, add here a summary of this hit
            for (Enumeration e = doc.fields(); e.hasMoreElements(); ) {
                Field field = (Field)e.nextElement();
                if (field.isStored()) {
                    if (LuceneXMLIndexer.URL_FIELD.equals(field.name()))
                        continue;
                    atts.clear();
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

    for (int i=0;i<reader.maxDoc();i++) {                                             
      // add new document with field values
      doc = reader.document(i, new MapFieldSelector(new String[]{"date"}));                                                                                                       
      long date=-1;
             
      Enumeration e = doc.fields();
      while (e.hasMoreElements()) {
         Field field = (Field)e.nextElement();
         if (field.name().equals("date")) {
           date=Long.parseLong(field.stringValue());   
         }
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

      int idate=-1;
      String url=null;
      String subtype=null;

      doc = reader.document(i, new MapFieldSelector(new String[]{"date","url","subType"}));     
      Enumeration e = doc.fields();
      while (e.hasMoreElements()) {
         Field field = (Field)e.nextElement();                  
         if (field.name().equals("date")) {
           idate=stringdateToInt(field.stringValue());          
         }
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

      doc = reader.document(i, new MapFieldSelector(new String[]{"date","digest","url"}));                                                                                                       
      long date=-1;
      String digest=null;
      String url=null;
             
      Enumeration e = doc.fields();
      while (e.hasMoreElements()) {
         Field field = (Field)e.nextElement();
         if (field.name().equals("date")) {
           date=Long.parseLong(field.stringValue());   
         }
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

    int maxDoc=reader.maxDoc();
    for (int i=0;i<maxDoc;i++) {
      if (!reader.isDeleted(i)) {
        Document doc = reader.document(i, new MapFieldSelector(fieldNames));
        int j=0;
        for (Enumeration e=doc.fields();e.hasMoreElements();) {              
          Field field = (Field)e.nextElement();
          if (j!=0) {
            System.out.print(" ");
          }
          System.out.print(field.stringValue());
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

     fieldNames=remainingFields.toArray(new String[remainingFields.size()]); // else read from index the remaining fields
   }

   //Document doc = luceneSearcher.doc(hit.getIndexDocNo(), new MapFieldSelector(sfields));
   Document doc = reader.document(hit.getIndexDocNo(), (fieldNames==null) ? null : new MapFieldSelector(fieldNames));
   Enumeration e = doc.fields();
   while (e.hasMoreElements()) {
     Field field = (Field)e.nextElement();
     fields.add(field.name());
     values.add(field.stringValue());
   }
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

    for (int i = start; i < end; i++) {
      HashMap hit = new HashMap();
      hit.put(SCORE_FIELD, new Float(hits.score (i)));
      hit.put(INDEX_FIELD, new Long(i));
      Document doc = hits.doc(i);
      for (Enumeration e = doc.fields(); e.hasMoreElements(); ) {
        Field field = (Field)e.nextElement();
        if (field.name().equals(SCORE_FIELD)) continue;
        if (field.name().equals(INDEX_FIELD)) continue;
        hit.put(field.name(), field.stringValue());
      }
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

    ArrayList fields = new ArrayList();
    ArrayList values = new ArrayList();

    Document doc = luceneSearcher.doc(hit.getIndexDocNo());

    Enumeration e = doc.fields();
    while (e.hasMoreElements()) {
      Field field = (Field)e.nextElement();
      fields.add(field.name());
      values.add(field.stringValue());
    }
View Full Code Here

Examples of org.apache.lucene.document.Document.fields()

            counter++;

            //now loop through the keywords we added and log debug them
            if (log.isDebugEnabled()) {

                resultKeywords = thisDocument.fields();

                while (resultKeywords.hasMoreElements()) {
                    thisField = (Field) (resultKeywords.nextElement());
                    log.debug(
                        "indexed: contains field name:"
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.