Package net.sf.regain.search.config

Examples of net.sf.regain.search.config.IndexConfig


    // Get the IndexConfig
    IndexConfig[] configArr = SearchToolkit.getIndexConfigArr(request);
    String[] fieldValues;
    if (configArr.length == 1) {
      // We have only one index -> Get the field values
      IndexConfig config = configArr[0];
      IndexSearcherManager manager = IndexSearcherManager.getInstance(config.getDirectory());
      fieldValues = manager.getFieldValues(fieldName);
    } else {
      // We have multiple indexes -> Get the values of each index and merge them
      HashSet valueSet = new HashSet();
      for (int i = 0; i < configArr.length; i++) {
View Full Code Here


    // Get the IndexConfig
    IndexConfig[] configArr = SearchToolkit.getIndexConfigArr(request);
    SortingOption[] sortingOptions = null;
    if (configArr.length >= 1) {
      // We take the first index config
      IndexConfig config = configArr[0];
      sortingOptions = config.getSortingOptions();
    }

    if (sortingOptions == null) {
      // create default option relevance
      Localizer localizer = new Localizer(request.getResourceBaseUrl(), "msg", request.getLocale());
View Full Code Here

      }

      // Get the configurations for these indexes
      List configList = new ArrayList();
      for (int i = 0; i < indexNameArr.length; i++) {
        IndexConfig index = mConfig.getIndexConfig(indexNameArr[i]);
        if (index == null) {
          throw new RegainException("The configuration does not contain the index '" + indexNameArr[i] + "'");

        }
        // If index is a parent index -> get all childs
        if (index.isParent()) {
          String[] allIndexName = mConfig.getAllIndexNameArr();
          for (int j = 0; j < allIndexName.length; j++) {
            IndexConfig indexParent = mConfig.getIndexConfig(allIndexName[j]);
            if (indexParent.hasParent() && indexNameArr[i].equals(indexParent.getParentName())) {
              configList.add(indexParent);
            }
          }
        } else {
          configList.add(index);
View Full Code Here

    // Get the IndexConfig
    IndexConfig[] configArr = SearchToolkit.getIndexConfigArr(request);
    boolean showSortFieldContent = false;
    if (configArr.length >= 1) {
      // We take the first index config
      IndexConfig config = configArr[0];
      showSortFieldContent = config.getShowSortFieldContent();
    }
    if (sortContent != null && showSortFieldContent) {
      Localizer localizer = new Localizer(request.getResourceBaseUrl(), "msg", request.getLocale());
      response.print("&nbsp;");
      response.print(localizer.msg("sortContent", "sort field content"));
View Full Code Here

    // Get the IndexConfig
    IndexConfig[] configArr = SearchToolkit.getIndexConfigArr(request);
    if (configArr.length > 1) {
      throw new RegainException("The currentindex tag can only be used for one index!");
    }
    IndexConfig config = configArr[0];
   
    File currentIndexDir = new File(config.getDirectory(), "new");
    if (! currentIndexDir.exists()) {
      currentIndexDir = new File(config.getDirectory(), "index");
    }
   
    if (currentIndexDir.exists()) {
      // Get the last update
      String timestamp = RegainToolkit.readStringFromFile(LASTUPDATE_FILE);
      Date lastUpdate = RegainToolkit.stringToLastModified(timestamp);
     
      // Get the index size
      long size = RegainToolkit.getDirectorySize(currentIndexDir);
      String sizeAsString = RegainToolkit.bytesToString(size, request.getLocale());
     
      // Get the document count
      IndexSearcherManager manager = IndexSearcherManager.getInstance(config.getDirectory());
      int docCount = manager.getDocumentCount();
     
      // Print the results
      response.print(localizer.msg("indexInfo", "Last update: {0}<br/>Size: {1}<br/>Document count: {2}",
          lastUpdate, sizeAsString, new Integer(docCount)));
View Full Code Here

      // Get the IndexConfig
      IndexConfig[] configArr = SearchToolkit.getIndexConfigArr(request);
      if (configArr.length > 1) {
        throw new RegainException("The indexupdate tag can only be used for one index!");
      }
      IndexConfig config = configArr[0];

      // Get the index size
      File indexUpdateDir = new File(config.getDirectory(), "temp");
      long size = RegainToolkit.getDirectorySize(indexUpdateDir);
      String sizeAsString = RegainToolkit.bytesToString(size, request.getLocale());
      String currentJobUrl = crawler.getCurrentJobUrl();
     
      Object[] args = new Object[] {
View Full Code Here

TOP

Related Classes of net.sf.regain.search.config.IndexConfig

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.