simple search api (was Re: mimetype standardisation by testsets)

Joe Shaw joeshaw at
Mon Nov 27 21:31:18 EET 2006


Sorry, I am just now catching up on this thread, I'm a little behind.

On Sun, 2006-11-19 at 12:19 +0100, Jos van den Oever wrote:
> method countHits ( in s query , out i count )
> Count the number of instances of a file that match a particular query.
> Input:
> query
>     The query being performed.
> Output:
> count
>     The number of documents that match the query.

Throughout this you use the term "file".  I presume that you mean more
than just files (like emails, for instance).  Can the spec be updated to
reflect this?

> method query ( in s query, in i offset, in i limit , out as hits )
> Perform a query and return a list of files that match the query.
> Input:
> query
>     The query being performed.
> offset
>     The offset in the result list for the first returned result.
> limit
>     The maximum number of results that should be returned.
> Output:
> hits
>     A list if filenames that are the result of the query.

Again, this probably shouldn't be "filenames" but instead URIs.

> method getProperties ( in as files,in a(sa(sas)) properties )
> Get properties for the given files.
> Input:
> files
>     A list of files for which properties should be returned.
> properties
>     The properties belonging to each file. Each property is a name
> associated with a list of string values. The index of each property
> map in the list corresponds to the index of the filename in the list
> of files.

This method will be pretty inefficient in Beagle, as each file will
require a query to the index.  We could maybe cache these, but it seems
to be that it would be more useful to instead have two query methods:
one which returned only a list of URIs and one which returned URIs and
document properties.


More information about the xdg mailing list