Mailinglist Archive: opensuse-buildservice (131 mails)

< Previous Next >
[opensuse-buildservice] Search Interface
  • From: Andreas Bauer <abauer@xxxxxxx>
  • Date: Thu, 21 Dec 2006 17:50:30 +0100
  • Message-id: <200612211750.30742.abauer@xxxxxxx>
Hi,

api.opensuse.org is now able to search in project and package metadata using a
xpath-like syntax.

Following GET requests have been added:

/search/project?match=<predicate>
/search/project/id?match=<predicate>
/search/package?match=<predicate>
/search/package/id?match=<predicate>

Result documents are put into a <container></container> node. The paths ending
on /id return only the root node of the wanted metafile type, which speeds up
the request a lot. The other paths return the whole documents.

The match parameter is mandatory and specifies the predicate used to select
the wanted metafiles.

Not the whole xpath specification is supported, we only support a subset of
operators and functions, and only specific node tests.

Allowed node tests for projects:
@name
description
title
person/@userid
repository/path/@project

Allowed node tests for packages:
@name
@project
title
description
person/@userid

Allowed operators:
=
!=
and
or

Allowed functions:
not(expr)
contains(string,substring)
starts-with(string,substring)
ends-with(string,substring)


Examples:

/search/package/id?match=person/@userid='darix'
returns the root nodes of all package metafiles where darix is set as
maintainer

/search/project/id?match=starts-with(@name,'SUSE:')
returns the metafiles of all projects below the SUSE: namespace

/search/project/id?match=ends-with(@name,person/@userid)
returns the root nodes of all project metafiles where the project name
ends with the userid of one of the maintainers (that is, all home
projects)

/search/project?match=[not(starts-with(@name,'home'))%20and%20description='']
all projects not under the 'home:' namespace whose description element is
empty


More functions/operators/node tests might get implemented if the need for them
arises.


Happy Holidays

--
Andreas Bauer - Novell - SUSE Internal Tools
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages