Examples of LuceneConfiguration


Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

        if (originalText == null) {
            return null;
        }
       
        // create text to analyze
        LuceneConfiguration config = getwgacore().getLuceneManager().retrieveLuceneConfig(content().getDatabase().getDbReference());
        LuceneIndexItemRule rule = config.getMatchingItemRule(name);
        String analyzeText = rule.parseItemValue(originalText);

        // create tokenstream
        TokenStream tokenStream = getwgacore().getLuceneManager().createTokenStream(analyzeText, content());
       
View Full Code Here

Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

     * @param enabled
     * @param indexItemRules - list of de.innovationgate.wga.common.beans.LuceneIndexItemRule
     * @return the updated contentDbElement
     */
    public static Element createLuceneConfig(Element contentDbElement, boolean enabled, List indexItemRules) {
        LuceneConfiguration config = new LuceneConfiguration();
        config.setEnabled(enabled);
        config.setItemRules(indexItemRules);
        return createLuceneConfig(contentDbElement, config);
    }   
View Full Code Here

Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

        }
       
    }

    private void createOrUpdateDBIndex(WGDatabase db, Set newConnectedDBKeys) {
        LuceneConfiguration config;
        // if database is already in index on the filesystem
        HashMap currentDBsInIndexOnFileSystem = _indexConfig.retrieveIndexedDbs();
        String dbKey = db.getDbReference();
        if (currentDBsInIndexOnFileSystem.containsKey(dbKey)) {
            LuceneConfiguration oldConfig = (LuceneConfiguration) currentDBsInIndexOnFileSystem.get(dbKey);
            LuceneConfiguration newConfig = retrieveLuceneConfig(dbKey);
            // if configuration has changed
            if (!oldConfig.equals(newConfig)) {
                // update database
                updateDatabase(dbKey, newConfig);
                if (newConfig.isEnabled()) {
                  registerForContentEvents(db);
                    // rebuild index of db
                    _core.getLog().info("Indexing rules for db '" + dbKey + "' has changed. Indexed content will be truncated and reindexed ...");
                    addDBUpdateRequest(new IndexingRequest(dbKey, null, true));
                } else {
View Full Code Here

Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

        //Create Lucene Config
      ContentStore dbConfig = _core.getWgaConfiguration().getContentStore(dbKey);
      if (dbConfig != null) {
        de.innovationgate.wga.config.LuceneIndexConfiguration luceneIndexConfig = dbConfig.getLuceneIndexConfiguration();
        if (luceneIndexConfig != null) {
          LuceneConfiguration config = new LuceneConfiguration();
          config.setEnabled(luceneIndexConfig.isEnabled());
          List itemRules = LuceneIndexItemRule.getRules(luceneIndexConfig.getItemRules());
          List fileRules = LuceneIndexFileRule.getRules(luceneIndexConfig.getFileRules());
          config.setItemRules(itemRules);
          config.setFileRules(fileRules);         
          return config;
        } else {
          _core.getLog().error("Could not retrieve lucene config for db '" + dbKey + "'");
                return null
        }
View Full Code Here

Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

            while (it.hasNext()) {
                Element dbElement = (Element) it.next();
                String dbKey = dbElement.attributeValue("key");
                Element configElement = dbElement.element("configuration");
               
                LuceneConfiguration config = new LuceneConfiguration();
                String luceneEnabled = configElement.attributeValue("enabled", "false");
                if (luceneEnabled.trim().equalsIgnoreCase("true")) {
                    config.setEnabled(true);
                } else {
                    config.setEnabled(false);
                }           
                //Lucene Indexing rules
                List itemRules = LuceneIndexItemRule.getRules(configElement);
                List fileRules = LuceneIndexFileRule.getRules(configElement);
                if (itemRules != null) {
                    config.setItemRules(itemRules);
                }
                if (fileRules != null) {
                    config.setFileRules(fileRules);
                }
               
                indexedDbs.put(dbKey, config);
            }
        }
View Full Code Here

Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

                }
            }        
        }
       
        private LuceneIndexItemRule retrieveItemRule(WGDatabase db, String itemName) {           
            LuceneConfiguration config = (LuceneConfiguration) _indexedDbs.get(db.getDbReference());
            if (config != null) {
                return config.getMatchingItemRule(itemName);
            }
            else {
                return null;
            }
        }
View Full Code Here

Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

                return null;
            }
        }
       
        private LuceneIndexFileRule retrieveFileRule(WGDatabase db, String filename) {           
            LuceneConfiguration config = (LuceneConfiguration) _indexedDbs.get(db.getDbReference());
            return config.getMatchingFileRule(filename);
        }
View Full Code Here

Examples of de.innovationgate.wga.common.beans.LuceneConfiguration

        // retrieve matching rule for field and check if field was indexed as KEYWORD
        Iterator searchDBKeys = _searchDBKeys.iterator();
        while (searchDBKeys.hasNext()) {
            String dbKey = (String) searchDBKeys.next();
            if (dbKey != null) {
                LuceneConfiguration config = (LuceneConfiguration) _configs.get(dbKey);
                if (config != null) {
                    LuceneIndexItemRule rule = config.getMatchingItemRule(field);
                    if (rule.getIndexType().equals(LuceneIndexItemRule.INDEX_TYPE_KEYWORD)) {
                        return true;
                    }
                }
            }
View Full Code Here

Examples of parse.LuceneConfiguration

    Log log = LogFactory.getLog(IndexViewerMojo.class);

    public void execute() throws MojoExecutionException {
        Application application = this.loadApplication();
        LuceneConfiguration configuration = application.<LuceneConfiguration> getInstance(LuceneConfiguration.class);
        try {
            Runtime runtime = Runtime.getRuntime();
            Process process = runtime.exec("java -jar lukeall.jar -index " + configuration.getIndexLocation());
            process.waitFor();
            log.debug("****************Exit Value**************" + process.exitValue());
            Thread.sleep(5000);
        } catch (Exception e) {
            log.error("Error processing index at location:" + configuration.getIndexLocation(), e);
        }

        log.debug("*********************Viewing Index******************");

    }
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.