Package net.sf.clairv.index.document

Examples of net.sf.clairv.index.document.Document.addField()


          }
          Pair type = (Pair) fieldTypeMappings.get(name);
          log.debug("Adding a field of name \"" + name
              + "\" with content: " + content);
          if (type != null) {
            doc.addField(name, content, (StoreOption)(type.t), (IndexOption)(type.v));
          } else {
            log.warn("Type of filed " + name + " is not mapped; "
                + "regarding as stored and untokenized");
            doc.addField(name, content, StoreOption.YES, IndexOption.UN_TOKENIZED);
          }
View Full Code Here


          if (type != null) {
            doc.addField(name, content, (StoreOption)(type.t), (IndexOption)(type.v));
          } else {
            log.warn("Type of filed " + name + " is not mapped; "
                + "regarding as stored and untokenized");
            doc.addField(name, content, StoreOption.YES, IndexOption.UN_TOKENIZED);
          }
        }
        holder.addDocument(doc);
        docCount++;
      }
View Full Code Here

    List entries = feed.getEntries();
    List docs = new ArrayList(entries.size());
    for (Iterator itr = entries.iterator(); itr.hasNext(); ) {
      SyndEntry entry = (SyndEntry)itr.next();
      Document doc = docFactory.createDocument();
      doc.addField("title", entry.getTitle(), StoreOption.YES,
          IndexOption.TOKENIZED);
      SyndContent descContent = entry.getDescription();
      String contentType = descContent.getType();
      String description = null;
      if (contentType != null && contentType.indexOf("text/html") != -1) {
View Full Code Here

        // HTML description; removes the tags
        description = descContent.getValue().replaceAll("<[^>]+>", "");
      } else {
        description = descContent.getValue();
      }
      doc.addField("description", description, StoreOption.YES,
          IndexOption.TOKENIZED);
      String author = entry.getAuthor();
      if (author == null)
        author = "";
      doc.addField("author", author, StoreOption.YES,
View Full Code Here

      doc.addField("description", description, StoreOption.YES,
          IndexOption.TOKENIZED);
      String author = entry.getAuthor();
      if (author == null)
        author = "";
      doc.addField("author", author, StoreOption.YES,
          IndexOption.TOKENIZED);
      doc.addField("url", entry.getLink(), StoreOption.YES,
          IndexOption.NO);
      doc.addField("publishedDate", DateTools.dateToString(entry
          .getPublishedDate(), DateTools.Resolution.MINUTE),
View Full Code Here

      String author = entry.getAuthor();
      if (author == null)
        author = "";
      doc.addField("author", author, StoreOption.YES,
          IndexOption.TOKENIZED);
      doc.addField("url", entry.getLink(), StoreOption.YES,
          IndexOption.NO);
      doc.addField("publishedDate", DateTools.dateToString(entry
          .getPublishedDate(), DateTools.Resolution.MINUTE),
          StoreOption.YES, IndexOption.UN_TOKENIZED);
      docs.add(doc);
View Full Code Here

        author = "";
      doc.addField("author", author, StoreOption.YES,
          IndexOption.TOKENIZED);
      doc.addField("url", entry.getLink(), StoreOption.YES,
          IndexOption.NO);
      doc.addField("publishedDate", DateTools.dateToString(entry
          .getPublishedDate(), DateTools.Resolution.MINUTE),
          StoreOption.YES, IndexOption.UN_TOKENIZED);
      docs.add(doc);
    }
    return docs;
View Full Code Here

      if (child.isDirectory()) {
        // delay processing the directory
        directories.add(child.getName());
      } else if (child.isFile()) {
        Document doc = docFactory.createDocument();
        doc.addField("fileName", child.getName(), StoreOption.YES,
            IndexOption.TOKENIZED);
        doc.addField("fileSize", (child.getSize() / 1024) + "KB",
            StoreOption.YES, IndexOption.NO);
        doc.addField("filePath", prefix + "/" + child.getName(),
            StoreOption.YES, IndexOption.NO);
View Full Code Here

        directories.add(child.getName());
      } else if (child.isFile()) {
        Document doc = docFactory.createDocument();
        doc.addField("fileName", child.getName(), StoreOption.YES,
            IndexOption.TOKENIZED);
        doc.addField("fileSize", (child.getSize() / 1024) + "KB",
            StoreOption.YES, IndexOption.NO);
        doc.addField("filePath", prefix + "/" + child.getName(),
            StoreOption.YES, IndexOption.NO);
        fileCount++;
        holder.addDocument(doc);
View Full Code Here

        Document doc = docFactory.createDocument();
        doc.addField("fileName", child.getName(), StoreOption.YES,
            IndexOption.TOKENIZED);
        doc.addField("fileSize", (child.getSize() / 1024) + "KB",
            StoreOption.YES, IndexOption.NO);
        doc.addField("filePath", prefix + "/" + child.getName(),
            StoreOption.YES, IndexOption.NO);
        fileCount++;
        holder.addDocument(doc);
      } else {
        log.warn("Discarded file: " + child.getName());
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.