beagle r4592 - branches/beagle-rdf/beagled



Author: dbera
Date: Sat Mar  8 17:18:00 2008
New Revision: 4592
URL: http://svn.gnome.org/viewvc/beagle?rev=4592&view=rev

Log:
Backport a fix from trunk (cleanup of deferred indexables) and correctly construct the URIs when supplied from an RDFQuery.


Modified:
   branches/beagle-rdf/beagled/LuceneIndexingDriver.cs
   branches/beagle-rdf/beagled/LuceneQueryingDriver.cs

Modified: branches/beagle-rdf/beagled/LuceneIndexingDriver.cs
==============================================================================
--- branches/beagle-rdf/beagled/LuceneIndexingDriver.cs	(original)
+++ branches/beagle-rdf/beagled/LuceneIndexingDriver.cs	Sat Mar  8 17:18:00 2008
@@ -50,6 +50,8 @@
 
 			if (build_usercache)
 				text_cache = TextCache.UserCache;
+
+			Shutdown.ShutdownEvent += OnShutdown;
 		}
 
 		public LuceneIndexingDriver (string index_name, int minor_version)
@@ -715,5 +717,15 @@
 			secondary_writer.AddIndexes (secondary_store);
 			secondary_writer.Close ();
 		}
+
+		//////////////////////////////////////////////////////
+
+		public void OnShutdown ()
+		{
+			lock (flush_lock) {
+				foreach (DeferredInfo di in deferred_indexables)
+					di.Cleanup ();
+			}
+		}
 	}
 }

Modified: branches/beagle-rdf/beagled/LuceneQueryingDriver.cs
==============================================================================
--- branches/beagle-rdf/beagled/LuceneQueryingDriver.cs	(original)
+++ branches/beagle-rdf/beagled/LuceneQueryingDriver.cs	Sat Mar  8 17:18:00 2008
@@ -380,7 +380,7 @@
 			// Return if the URI exists
 			if (subject != String.Empty && predicate == String.Empty && _object == String.Empty) {
 				QueryPart_Uri part = new QueryPart_Uri ();
-				part.Uri = new Uri (subject); // better be URI!
+				part.Uri = UriFu.UserUritoEscapedUri (subject); // better be URI!
 				query.AddPart (part);
 				// FIXME: Which properties to return in the hit? All or none ?
 				return DoLowLevelRDFQuery (query, null, null);
@@ -389,7 +389,7 @@
 			// Normal query in the document with this URI
 			if (subject != String.Empty && predicate == String.Empty && _object != String.Empty) {
 				QueryPart_Uri uri_part = new QueryPart_Uri ();
-				uri_part.Uri = new Uri (subject); // better be URI!
+				uri_part.Uri = UriFu.UserUritoEscapedUri (subject); // better be URI!
 				query.AddPart (uri_part);
 
 				QueryPart_Text part = new QueryPart_Text ();
@@ -405,7 +405,7 @@
 				ArrayList returned_uris = new ArrayList (1);
 
 				ArrayList uri_list = new ArrayList (1);
-				uri_list.Add (new Uri (subject));
+				uri_list.Add (UriFu.UserUritoEscapedUri (subject));
 
 				string field_name = PropertyToFieldName (pred_type, predicate);
 				FieldSelector fields = new MapFieldSelector (new string[] { "Uri", "Timestamp", field_name });
@@ -417,7 +417,7 @@
 			// Property query in the document with this URI
 			if (subject != String.Empty && predicate != String.Empty && _object != String.Empty) {
 				QueryPart_Uri uri_part = new QueryPart_Uri ();
-				uri_part.Uri = new Uri (subject); // better be URI!
+				uri_part.Uri = UriFu.UserUritoEscapedUri (subject); // better be URI!
 				query.AddPart (uri_part);
 
 				QueryPart_Property part = new QueryPart_Property ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]