Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix for vocabulary import (double term detection)
Michael Peter Christenff035a20e7b9
diff --git a/htroot/Vocabulary_p.java b/htroot/Vocabulary_p.javaindex 442f1e9c2..a558bd2d0 100644--- a/htroot/Vocabulary_p.java+++ b/htroot/Vocabulary_p.java@@ -124,7 +124,7 @@ public class Vocabulary_p {// check double synonymsif (synonyms.length() > 0) {String oldliteral = synonym2literal.get(synonyms);- if (oldliteral != null) {+ if (oldliteral != null && !literal.equals(oldliteral)) {// replace old entry with combined newtable.remove(oldliteral);String newliteral = oldliteral + "," + literal;@@ -212,14 +212,6 @@ public class Vocabulary_p {}}- // check if a term shall be deleted- for (Map.Entry<String, String> e : post.entrySet()) {- if (e.getKey().startsWith("delete_") && e.getValue().equals("checked")) {- String term = e.getKey().substring(7);- vocabulary.delete(term);- }- }-// check if the vocabulary shall be clearedif (post.get("clear_table", "").equals("checked") ) {vocabulary.clear();@@ -231,6 +223,14 @@ public class Vocabulary_p {vocabulary = null;vocabularyName = null;}++ // check if a term shall be deleted+ if (vocabulary != null && vocabulary.size() > 0) for (Map.Entry<String, String> e : post.entrySet()) {+ if (e.getKey().startsWith("delete_") && e.getValue().equals("checked")) {+ String term = e.getKey().substring(7);+ vocabulary.delete(term);+ }+ }// check the isFacet propertyif (vocabulary != null) {