Package net.sf.clairv.common

Examples of net.sf.clairv.common.ResourceMetaData


  public void start() {
    Collection resources = context.getResources();
    ResourceProcessor resourceProcessor = context.getResourceProcessor();
    for (Iterator itr = resources.iterator(); itr.hasNext(); ) {
      Resource resource = (Resource)itr.next();
      ResourceMetaData meta = resource.getMetaData();
      log.info("Starting to indexing resource: " + meta.getResourceName());
      long start = System.currentTimeMillis();
      int count = resourceProcessor.process(resource);
      log.info("Indexing on resource \"" + meta.getResourceName()
          + "\" done (" + (System.currentTimeMillis() - start)
          + "ms used, " + count + " records indexed)");
    }
    resourceProcessor.close();
  }
View Full Code Here


          Properties p = new Properties();
          File f = new File(StringUtils.concatPath(loc,
              "meta.properties"));
          if (f.exists()) {
            p.load(new FileInputStream(f));
            ResourceMetaData meta = new ResourceMetaData();
            String name = p.getProperty("name");
            meta.setHitTextPattern(p.getProperty("hitTextPattern"));
            meta.setResourceDescription("description");
            meta.setResourceName(name);
            meta.setSearchableFields(StringUtils.splitStrings(p
                .getProperty("search")));
            resourceNames.add(name);
            IndexReader indexReader = IndexReader.open(loc);
            ResultPatternFactory factory = new ResultPatternFactory(indexReader);
            ResourceSuite suite = new ResourceSuite();
View Full Code Here

      recordHolder = new BufferedDocumentHolder();
      recordHolder.setBufferListener(new BufferAction());
      recordHolder.setMaxBufferSize(maxBufferSize);
    }

    ResourceMetaData meta = resource.getMetaData();

    String resourceDir = StringUtils.concatPath(indexDir, meta
        .getResourceName().replaceAll(" ", "_"));
    // Prepare the IndexWriter
    try {
      // warning: Current impl clear the index dir first!
      initDir(resourceDir);
      try {
        meta.write(new FileOutputStream(StringUtils.concatPath(
            resourceDir, "meta.properties")));
      } catch (IOException e) {
        log.error("Failed to write the meta data!", e);
        return -1;
      }
View Full Code Here

TOP

Related Classes of net.sf.clairv.common.ResourceMetaData

Copyright © 2018 www.massapicom. 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.