bug fix take 2
authorjohn <john>
Tue, 28 Feb 2006 17:01:35 +0000 (17:01 +0000)
committerjohn <john>
Tue, 28 Feb 2006 17:01:35 +0000 (17:01 +0000)
source/mircoders/producer/IndexingProducerNode.java

index ffd6f8e..c0eb9e5 100755 (executable)
@@ -125,6 +125,7 @@ public class IndexingProducerNode extends AbstractProducerNode {
       int minutes;
       Date date;
       String formattedDate="";
+      String pathDate="";
 
       if (textValue!=null) {
         try {
@@ -138,6 +139,9 @@ public class IndexingProducerNode extends AbstractProducerNode {
           date = calendar.getTime();
           SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd hh:mm");
           formattedDate = formatter.format(date);
+
+          SimpleDateFormat pathFormatter = new SimpleDateFormat("/yyyy/MM/");
+          pathDate = pathFormatter.format(date);
         }
         catch (Throwable t) {
           aLogger.warn("Error while generating content date to index", t);
@@ -149,8 +153,7 @@ public class IndexingProducerNode extends AbstractProducerNode {
 
 
       (new UnIndexedSearchTerm("", "", "", "where", "where")).indexValue(theDoc,
-        "/"+ year +"/" + month + 
-        entity.getFieldValue("id") + ".shtml");
+        pathDate +  entity.getFieldValue("id") + ".shtml");
 
       (new TextSearchTerm("creator", "search_creator", "creator", "creator",
         "creator")).index(theDoc, entity);