|
Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/ContentDocument.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/ContentDocument.java?rev=1408976&r1=1408975&r2=1408976&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/ContentDocument.java (original) +++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/ContentDocument.java Tue Nov 13 21:47:18 2012 @@ -41,9 +41,9 @@ import org.ofbiz.service.LocalDispatcher import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; -import org.apache.lucene.document.Field.Index; import org.apache.lucene.document.Field.Store; -import org.apache.lucene.document.Field.TermVector; +import org.apache.lucene.document.StringField; +import org.apache.lucene.document.TextField; /** * ContentDocument Class @@ -76,7 +76,7 @@ public class ContentDocument { // make a new, empty document doc = new Document(); String contentId = content.getString("contentId"); - doc.add(new Field("contentId", contentId, Store.YES, Index.NOT_ANALYZED, TermVector.NO)); + doc.add(new StringField("contentId", contentId, Store.YES)); // Add the last modified date of the file a field named "modified". Use a // Keyword field, so that it's searchable, but so that no attempt is // made to tokenize the field into words. @@ -85,14 +85,14 @@ public class ContentDocument { modDate = (Timestamp) content.get("createdDate"); } if (modDate != null) { - doc.add(new Field("modified", modDate.toString(), Store.YES, Index.NOT_ANALYZED, TermVector.NO)); + doc.add(new StringField("modified", modDate.toString(), Store.YES)); } String contentName = content.getString("contentName"); if (UtilValidate.isNotEmpty(contentName)) - doc.add(new Field("title", contentName, Store.YES, Index.ANALYZED, TermVector.NO)); + doc.add(new TextField("title", contentName, Store.YES)); String description = content.getString("description"); if (UtilValidate.isNotEmpty(description)) - doc.add(new Field("description", description, Store.YES, Index.ANALYZED, TermVector.NO)); + doc.add(new TextField("description", description, Store.YES)); List<String> ancestorList = FastList.newInstance(); Delegator delegator = content.getDelegator(); ContentWorker.getContentAncestryAll(delegator, contentId, "WEB_SITE_PUB_PT", "TO", ancestorList); @@ -100,7 +100,7 @@ public class ContentDocument { //Debug.logInfo("in ContentDocument, ancestorString:" + ancestorString, // module); if (UtilValidate.isNotEmpty(ancestorString)) { - Field field = new Field("site", ancestorString, Store.NO, Index.ANALYZED, TermVector.NO); + Field field = new StringField("site", ancestorString, Store.NO); //Debug.logInfo("in ContentDocument, field:" + field.stringValue(), // module); doc.add(field); @@ -163,7 +163,7 @@ public class ContentDocument { } //Debug.logInfo("in DataResourceDocument, text:" + text, module); if (UtilValidate.isNotEmpty(text)) { - Field field = new Field("content", text, Store.NO, Index.ANALYZED, TermVector.NO); + Field field = new TextField("content", text, Store.NO); //Debug.logInfo("in ContentDocument, field:" + field.stringValue(), module); doc.add(field); } @@ -184,7 +184,7 @@ public class ContentDocument { String featureString = StringUtil.join(featureList, " "); //Debug.logInfo("in ContentDocument, featureString:" + featureString, module); if (UtilValidate.isNotEmpty(featureString)) { - Field field = new Field("feature", featureString, Store.NO, Index.ANALYZED, TermVector.NO); + Field field = new TextField("feature", featureString, Store.NO); doc.add(field); } return true; Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java?rev=1408976&r1=1408975&r2=1408976&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java (original) +++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java Tue Nov 13 21:47:18 2012 @@ -34,10 +34,9 @@ import org.ofbiz.entity.GenericEntityExc import org.ofbiz.entity.GenericValue; import org.apache.lucene.document.Document; -import org.apache.lucene.document.Field; -import org.apache.lucene.document.Field.Index; import org.apache.lucene.document.Field.Store; -import org.apache.lucene.document.Field.TermVector; +import org.apache.lucene.document.StringField; +import org.apache.lucene.document.TextField; /** * DataResourceDocument Class @@ -60,7 +59,7 @@ public class DataResourceDocument { // make a new, empty document doc = new Document(); - doc.add(new Field("dataResourceId", id, Store.YES, Index.NOT_ANALYZED, TermVector.NO)); + doc.add(new StringField("dataResourceId", id, Store.YES)); String mimeTypeId = dataResource.getString("mimeTypeId"); if (UtilValidate.isEmpty(mimeTypeId)) { @@ -84,7 +83,7 @@ public class DataResourceDocument { String text = outWriter.toString(); Debug.logInfo("in DataResourceDocument, text:" + text, module); if (UtilValidate.isNotEmpty(text)) - doc.add(new Field("content", text, Store.NO, Index.ANALYZED, TermVector.NO)); + doc.add(new TextField("content", text, Store.NO)); return doc; } Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java?rev=1408976&r1=1408975&r2=1408976&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java (original) +++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java Tue Nov 13 21:47:18 2012 @@ -54,7 +54,7 @@ public class SearchWorker { public static final String module = SearchWorker.class.getName(); - public static final Version LUCENE_VERSION = Version.LUCENE_36; + public static final Version LUCENE_VERSION = Version.LUCENE_40; public static Map<String, Object> indexTree(LocalDispatcher dispatcher, Delegator delegator, String siteId, Map<String, Object> context, String path) throws Exception { Map<String, Object> results = FastMap.newInstance(); @@ -161,7 +161,7 @@ public class SearchWorker { } private static void deleteDocumentsByTerm(Term term, IndexWriter writer) throws Exception { - IndexReader reader = IndexReader.open(writer, false); + DirectoryReader reader = DirectoryReader.open(writer, false); int qtyBefore = reader.docFreq(term); //deletes documents, all the rest is for logging Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java?rev=1408976&r1=1408975&r2=1408976&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java (original) +++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java Tue Nov 13 21:47:18 2012 @@ -27,8 +27,8 @@ import javolution.util.FastMap; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.IndexSearcher; @@ -73,9 +73,9 @@ public class LuceneTests extends OFBizTe public void testSearchTermHand() throws Exception { Directory directory = FSDirectory.open(new File(SearchWorker.getIndexPath(null))); - IndexReader r = null; + DirectoryReader r = null; try { - r = IndexReader.open(directory); + r = DirectoryReader.open(directory); } catch (Exception e) { // ignore } Modified: ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy?rev=1408976&r1=1408975&r2=1408976&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy (original) +++ ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy Tue Nov 13 21:47:18 2012 @@ -17,12 +17,10 @@ * under the License. */ -import org.apache.lucene.analysis.Analyzer import org.apache.lucene.analysis.standard.StandardAnalyzer import org.apache.lucene.document.Document -import org.apache.lucene.index.IndexReader import org.apache.lucene.index.Term -import org.apache.lucene.queryParser.QueryParser +import org.apache.lucene.queryparser.classic.QueryParser import org.apache.lucene.store.FSDirectory import org.ofbiz.base.util.Debug import org.ofbiz.base.util.UtilHttp @@ -30,6 +28,7 @@ import org.ofbiz.content.search.SearchWo import org.ofbiz.product.feature.ParametricSearch import org.apache.lucene.search.* import org.apache.lucene.store.Directory +import org.apache.lucene.index.DirectoryReader paramMap = UtilHttp.getParameterMap(request); queryLine = paramMap.queryLine.toString(); @@ -47,9 +46,7 @@ Debug.logInfo("in search, featureIdByTyp combQuery = new BooleanQuery(); Directory directory = FSDirectory.open(new File(SearchWorker.getIndexPath(null))); -IndexReader reader = IndexReader.open(directory, true); // only searching, so read-only=true -Searcher searcher = null; -Analyzer analyzer = null; +DirectoryReader reader = DirectoryReader.open(directory); try { Debug.logInfo("in search, indexPath:" + directory.toString(), ""); Modified: ofbiz/branches/20120329_portletWidget/applications/humanres/config/HumanResEntityLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/humanres/config/HumanResEntityLabels.xml?rev=1408976&r1=1408975&r2=1408976&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/applications/humanres/config/HumanResEntityLabels.xml (original) +++ ofbiz/branches/20120329_portletWidget/applications/humanres/config/HumanResEntityLabels.xml Tue Nov 13 21:47:18 2012 @@ -23,31 +23,37 @@ <property key="EmplLeaveReasonType.description.CASUAL"> <value xml:lang="en">Casual</value> <value xml:lang="fr">Convenance</value> + <value xml:lang="ja">ç§äº</value> <value xml:lang="vi">Tình cá»</value> </property> <property key="EmplLeaveReasonType.description.MEDICAL"> <value xml:lang="en">Medical</value> <value xml:lang="fr">Maladie</value> + <value xml:lang="ja">ç¾ç </value> <value xml:lang="vi">Y tế</value> </property> <property key="EmplLeaveType.description.INLAND_EARNED"> <value xml:lang="en">Inland earned</value> <value xml:lang="fr">Congé payé</value> + <value xml:lang="ja">å½å åå¾</value> <value xml:lang="vi">Thu nháºp quá»c ná»i</value> </property> <property key="EmplLeaveType.description.LOSS_OF_PAY"> <value xml:lang="en">Loss of pay</value> <value xml:lang="fr">Sans solde</value> + <value xml:lang="ja">ç¡çµ¦</value> <value xml:lang="vi">Mất thanh toán</value> </property> <property key="EmplLeaveType.description.RESTRICTED_HOLIDAY"> <value xml:lang="en">Restricted holiday</value> <value xml:lang="fr">Jour férié</value> + <value xml:lang="ja">å¶éæ¥</value> <value xml:lang="vi">Kỳ nghá» hạn chế</value> </property> <property key="EmplLeaveType.description.SPECIAL_DAY_OFF"> <value xml:lang="en">Special day off</value> <value xml:lang="fr">Congé</value> + <value xml:lang="ja">ç¹å¥ä¼æ</value> <value xml:lang="vi">Ngà y nghá» Äặc biá»t</value> </property> </resource> \ No newline at end of file |
| Free forum by Nabble | Edit this page |
