Package org.apache.lucene.document

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


                    String.valueOf(score));
            atts.addAttribute("", URI_ATTRIBUTE, URI_ATTRIBUTE, CDATA,
                    String.valueOf(uri));
            contentHandler.startElement(NAMESPACE, HIT_ELEMENT, Q_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


    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

      Document result = reader.document(0);
      assertTrue(result != null);
      //There are 2 unstored fields on the document that are not preserved across writing
      assertTrue(DocHelper.numFields(result) == DocHelper.numFields(testDoc) - 2);
     
      Enumeration fields = result.fields();
      while (fields.hasMoreElements()) {
        Field field = (Field) fields.nextElement();
        assertTrue(field != null);
        assertTrue(DocHelper.nameValues.containsKey(field.name()));
      }
View Full Code Here

    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

    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

                    String.valueOf(score));
            atts.addAttribute("", URI_ATTRIBUTE, URI_ATTRIBUTE, CDATA,
                    String.valueOf(uri));
            contentHandler.startElement(NAMESPACE, HIT_ELEMENT, Q_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

                    String.valueOf(score));
            atts.addAttribute("", URI_ATTRIBUTE, URI_ATTRIBUTE, CDATA,
                    String.valueOf(uri));
            contentHandler.startElement(NAMESPACE, HIT_ELEMENT, Q_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

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.