beagle r4440 - in trunk/beagle: beagled/IndexingServiceQueryable firefox-extension firefox-extension/chrome/content



Author: dbera
Date: Sat Feb  2 16:25:03 2008
New Revision: 4440
URL: http://svn.gnome.org/viewvc/beagle?rev=4440&view=rev

Log:
Make the firefox extension also store a tokenized form of the URL. Make the IndexingService backend treat any text property with the name beagle:inuri for inuri: queries. Up the firefox extension version.


Modified:
   trunk/beagle/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs
   trunk/beagle/firefox-extension/chrome/content/beagleOverlay.js
   trunk/beagle/firefox-extension/install.rdf

Modified: trunk/beagle/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs
==============================================================================
--- trunk/beagle/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs	(original)
+++ trunk/beagle/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs	Sat Feb  2 16:25:03 2008
@@ -41,6 +41,9 @@
 // "type" is either 't' for text or 'k' for keyword.  This method is a lot
 // easier to use, but requires that Beagle have inotify support enabled to
 // work.
+//
+// Any text property with the name beagle:inuri would be used for inuri: queries.
+//
 
 using System;
 using System.Collections;
@@ -390,6 +393,23 @@
 			return new EmptyResponse ();
 		}
 
+		protected override QueryPart QueryPartHook (QueryPart part)
+		{
+			if (part is QueryPart_Property) {
+				QueryPart_Property prop_part = (QueryPart_Property) part;
+				if (prop_part.Key == "inuri") { // special case
+					QueryPart_Property new_part = new QueryPart_Property ();
+					new_part.Logic = prop_part.Logic;
+					new_part.Key = "beagle:inuri";
+					new_part.Type = PropertyType.Text;
+					new_part.Value = prop_part.Value;
+
+					return new_part;
+				}
+			}
+
+			return part;
+		}
 	}
 
 }

Modified: trunk/beagle/firefox-extension/chrome/content/beagleOverlay.js
==============================================================================
--- trunk/beagle/firefox-extension/chrome/content/beagleOverlay.js	(original)
+++ trunk/beagle/firefox-extension/chrome/content/beagleOverlay.js	Sat Feb  2 16:25:03 2008
@@ -421,6 +421,13 @@
         {
             meta.push("t:fixme:referrer=" + page.referrer);
         }
+
+	// Tokenize the url
+	var loc = page.location;
+	var url_tokenized = loc.host + " " + loc.port + " " + loc.pathname + " " + loc.hash + " " + loc.search;
+	url_tokenized = url_tokenized.replace(/\./g, " ").replace(/\//g, " ").replace(/&/g, " ").replace (/\+/g, " ").replace (/=/g, " ").replace(/%../g, " ");
+	meta.push("t:beagle:inuri=" + url_tokenized);
+
         meta = meta.concat(this.tasks[url]['meta'])
         beagle.writeRawMetadata(meta,tmpfilepath);
     },

Modified: trunk/beagle/firefox-extension/install.rdf
==============================================================================
Binary files. No diff available.



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