2007/2/18, Joe Shaw <<a href="mailto:joeshaw@novell.com">joeshaw@novell.com</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>Mikkel Kamstrup Erlandsen wrote:<br>> 2007/2/16, Joe Shaw <<a href="mailto:joeshaw@novell.com">joeshaw@novell.com</a> <mailto:<a href="mailto:joeshaw@novell.com">joeshaw@novell.com</a>>>:<br>> For people who want to index their data externally we provide
<br>> an indexing service. Apps can do one of two things: they can make an<br>> RPC call and pass in a document and metadata to be indexed, or they can<br>> drop the file into ~/.beagle/ToIndex with a control file that describes
<br>> its metadata and Beagle will automatically index it. (This latter<br>> method is how the Beagle Firefox extension works.)<br>><br>> What kind of rpc is available?<br><br>It's just the standard Beagle RPC mechanism (basically XML over a Unix
<br>domain socket).<br><br>C#:<br><a href="http://svn.gnome.org/viewcvs/beagle/trunk/beagle/BeagleClient/IndexingService.cs?view=markup">http://svn.gnome.org/viewcvs/beagle/trunk/beagle/BeagleClient/IndexingService.cs?view=markup
</a><br><br>C:<br><a href="http://svn.gnome.org/viewcvs/beagle/trunk/beagle/libbeagle/beagle/beagle-indexing-service-request.h?view=markup">http://svn.gnome.org/viewcvs/beagle/trunk/beagle/libbeagle/beagle/beagle-indexing-service-request.h?view=markup
</a></blockquote><div><br><br>Ok. If we are to standardize something like this, I would assume that we use dbus for rpc - as far as I can tell that doesn't seem to be a problem..? Fx a dbus api like:<br><br> - AddFile (in as metadata, in s input_file)
<br> - AddText (in as metadata, in s text)<br><br>where the metadata argument contains things such as uri, mime, and hit type (in some specified order (and maybe some filtering/stemming/whatnot info)). The AddFile method sorta replaces the "drop-in-special-dir" approach - the drop-in-special-dir method could still be allowed for apps not talking dbus. The AddText method should encapsulate the functionality of Beagles' current IndexServiceRequest/Indexable duo.
<br></div><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> Dropping files in a special directory sounds like a thing that most<br>
> indexers could support. Perhaps this can be standardized. Is there a<br>> place where I can find documentation/examples/code for this?<br><br>Sure, the format is described in the comment at the top of the<br>IndexingService backend file:
<br><br><a href="http://svn.gnome.org/viewcvs/beagle/trunk/beagle/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs?view=markup">http://svn.gnome.org/viewcvs/beagle/trunk/beagle/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs?view=markup
</a></blockquote><div><br><br>It seems like a compact form of what Jamie described a few mails back. If there is a heavy data flow compactness is good, but I honestly have no clue how much traffic there is for stuff like this...
<br></div><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">And an example implementation is in the (sorry, ugly) Firefox extension:<br>
<br><a href="http://svn.gnome.org/viewcvs/beagle/trunk/beagle/mozilla-extension/content/beagleOverlay.js?view=markup">http://svn.gnome.org/viewcvs/beagle/trunk/beagle/mozilla-extension/content/beagleOverlay.js?view=markup
</a><br><br>(the beagleWriteContent() and beagleWriteMetadata() methods)<br><br>> We could maybe create an external data source backend, but since the<br>> sources are so specific, all it would amount to would be calling some
<br>> sort of script that did the crawling and used one of the two methods<br>> above to signal Beagle. Unlike the external filters, there hasn't been<br>> any demand for it, and fitting it in to the scheduler so that it didn't
<br>> peg the indexer or fill up the disk would be tough to do externally.<br>><br>><br>> I'm not sure I understand what you are saying. Is it that polling many<br>> external data source "handles" would be to heavy?
<br><br>Sorry, I didn't describe it very well. The issue here is that in<br>Beagle, we extract only a subset of the data at a time. For example, on<br>a 300,000 message mailbox we obviously can't process them all at the
<br>same time. You'd want to have some similar sort of throttling for<br>external data sources, but doing that means that you basically have to<br>write code to do it. If you have to write code anyway, why not just<br>
make it a proper data source?</blockquote><div><br><br>By a data source you mean something that uses IndexServiceRequests and Indexables?<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The other thing is that data sources often have to maintain state. Our<br>file system backend, for instance, has to have inotify watches for every<br>directory it watches. It has to maintain state to know which<br>directories it has crawled. It has to know about the directory tree so
<br>that it can handle moves correctly, etc. To move all of these out of<br>process, you'd essentially have to create yet another daemon.</blockquote><div><br>Ok, I get the picture now, thanks for clearing it out.<br>
<br>In many cases the "daemon" would be the browser or a mail client - which keeps a lot of state anyway, so I don't see that as a big problem. In fx. an email client you can be pretty confident that other apps doesn't mess with your data while you are not running, so there is no need to "watch" the mailbox.
<br><br>Cheers,<br>Mikkel<br></div><br></div><br>