FreeBSD Manual Pages
AFSEARCH(3) Amberfish AFSEARCH(3) NAME afsearch - query a set of databases SYNOPSIS #include af.h int afsearch(const Afsearch *r, Afsearch_r *rr); DESCRIPTION The afsearch function searches one or more databases and returns an un- ordered 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: AFQUERYBOOLEAN This is the standard Boolean query type. The score option specifies how relevance scores should be calculated: AFNOSCORE No score is calculated. All score values will be set to 0. AFSCOREDEFAULT Use the default similarity function. RETURN VALUE 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), afsort- docid(3), and afgetresultmd(3). ERRORS In addition to the set of "core" errors, this function can return: AFETERMLEN A query term exceeded the maximum number of characters allowed. AFEQUERYNEST The query was too highly nested. AFEQUERYSYN The query contained an error in syntax. AFSEARCH(3)
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=afsearch&sektion=3&manpath=FreeBSD+Ports+15.0>
