GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AFSEARCH(3) Amberfish AFSEARCH(3)

afsearch - query a set of databases

#include af.h

int afsearch(const Afsearch *r, Afsearch_r *rr);

The afsearch function searches one or more databases and returns an unordered list of resultant documents.

The argument r specifies a set of options defined by the following structure:

typedef struct {
	Uint2 *dbid;
	int dbidn;
	Afchar *query;
	int qtype;
	int score;
} Afsearch;

The dbid option specifies an array of databases to be searched. The databases are referred to by their database descriptors, as returned by afopen(3).

The dbidn option specifies how many databases are in the array dbid.

The query option specifies the query string to be applied in the search.

The qtype option describes the query type used in query. Currently there is only one query type supported:

This is the standard Boolean query type.

The score option specifies how relevance scores should be calculated:

No score is calculated. All score values will be set to 0.

Use the default similarity function.

This function returns 0 if it exited normally. If an error occurred, it returns -1 and aferrno is set.

If the function exited normally, the structure pointed to by rr is filled in with the following values:

typedef struct {
	Afresult *result;
	int resultn;
} Afsearch_r;

The result value is an array of results, each corresponding to a unique document that matched the query.

The resultn value is the number of elements in result.

Each element of result is of the following type:

typedef struct {
	Uint4 docid;
	Uint2 score;
	Uint2 dbid;
} Afresult;

The docid is the document identifier.

The score is the computed relevance score, normally a value in the range, 0 to 10000.

The dbid is the descriptor of the database containing the document.

Additional processing of results is provided by afsortscore(3), afsortdocid(3), and afgetresultmd(3).

In addition to the set of "core" errors, this function can return:

A query term exceeded the maximum number of characters allowed.

The query was too highly nested.

The query contained an error in syntax.

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.