Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Metalist

Metalist items. Functions, structures, defines, etc. associated with metalists. More...

Data Structures

struct  searchm_nodeelem
 node elements of a list. More...

struct  searchm_metaelem
 A metaname element in the meta list. More...

struct  searchm_metalist
 The meta list. More...


Functions

int searchm_nullstrcmp (const char *const t1, const char *const t2, const int bCase)
 compares t1 and t2, allowing for t1 and/or t2 to be NULL. if t1 and t2 are NULL, strings are considered equal The NULL string is considered less than a non NULL string. return: 0 strings are equal 1 strings are not equal

apr_status_t searchm_metalist_process (p_query_info_t p_qi)
 called during results phase to create the meta list

apr_status_t searchm_subquery_process (p_searchm_metalist_t const p_ml, const char **sl, unsigned int *index_sl, const char *meta_def, apr_pool_t *p)
 process a Swish-e subquery (as opposed to a searchm sub-query)

searchm_termtype_e searchm_gettermtype (const char *t)
 determines a term type.

searchm_termtype_e searchm_conjtype (const char *const t)
 Determines if t is a conjunction. Case is irrelevant.

apr_status_t searchm_addterm (p_searchm_metalist_t p_ml, const char **sl, int *index_sl, const char *m, int bP, int nterms, apr_pool_t *p)
apr_status_t searchm_metalist_add (p_searchm_metalist_t const p_ml, const char *mn, p_searchm_metaelem_t *pp_me, apr_pool_t *p)
p_searchm_metaelem_t searchm_metalist_get (p_searchm_metalist_t p_ml, const char *mn, int *bFound)
apr_status_t searchm_nodelist_add (p_searchm_metaelem_t const p_me, const char **sl, int *index_sl, int bP, int nterms, apr_pool_t *p)
 adds the term(s) at index_sl in sl to nodelist of me. me->l may be null. if nterms==1, then in phrase with one term. When added to nodelist, will become a single term, with phrase distinction lost. return:

void searchm_metalist_destroy (p_searchm_metalist_t const p_ml)
 destroys the metalist.

apr_status_t searchm_nodelist_match (p_searchm_metaelem_t const p_me, const char **sl, const int index_sl, const int bP, const int nterms, int *bFound, apr_pool_t *p)
apr_status_t searchm_phrase_match (p_searchm_metaelem_t const p_me, const char **sl, const int index_sl, const int bP, const int nterms, int *bResult, apr_pool_t *p)
 Checks if this phrase at ls[index_sl] is a match of an existing phrase in nodelist. If an existing phrase may be modified to match this phrase, it is modified, and match is successful. A match: If each term of a phrase is exaclty equal. Ex: "jack and jill" matches "jack and jill" If each term in phrase matches, with swap if necessary, match. Ex: "ja* and ji*" match "jack and jill" Ex: "jack and jill" match "ja* and ji*", with swap. Ex: "blackja* and ji*" match "ja* and ji*" with swap. If nterms in this phrase is not equal to the the number of terms in match phrase, then assume never equal.

apr_status_t searchm_single_match (const char *t1, const char *t2, const int bWay, int *Result, apr_pool_t *p)

Detailed Description

Metalist items. Functions, structures, defines, etc. associated with metalists.


Function Documentation

searchm_addterm p_searchm_metalist_t  p_ml,
const char **  sl,
int *  index_sl,
const char *  m,
int  bP,
int  nterms,
apr_pool_t *  p
[static]
 

Parameters:
p_ml metalist to add term to. p_ml->l may be NULL.
sl The term string list.
index_sl IN:The element within term string list to begin. OUT:The next element to process.
m pointer to metaname of term/ phrase (may be NULL)
bP True if in phrase.
nterms If bP true (in phrase) number of consecutive terms in phrase. (may be zero)
p The memory pool.
Returns:
: APR_SUCCESS: term added APR_SUCCESS: duplicate term APR_SUCCESS: nterms was zero

searchm_conjtype const char *const  t  )  [static]
 

Determines if t is a conjunction. Case is irrelevant.

Parameters:
t The string to check.

searchm_gettermtype const char *  t  )  [static]
 

determines a term type.

Parameters:
t The term string to check.
Returns:
The term type.

searchm_metalist_add p_searchm_metalist_t const  p_ml,
const char *  mn,
p_searchm_metaelem_t pp_me,
apr_pool_t *  p
[static]
 

Parameters:
p_ml metalist
mn metaname (may be NULL)
pp_me pointer to pointer of a metaelement.
p memory pool.
Returns:
: NULL error pointer to the metaname in list If metaname is not present in list, adds to list. if p_ml->l is NULL, then creates list. A NULL metaname is added to metaname NULL.

APR_SUCCESS successfully added

SEARCHM_INTERNAL_SERVER_ERROR

searchm_metalist_destroy p_searchm_metalist_t const  p_ml  )  [static]
 

destroys the metalist.

Parameters:
p_ml the metalist

searchm_metalist_get p_searchm_metalist_t  p_ml,
const char *  mn,
int *  bFound
[static]
 

Parameters:
p_ml IN:metalist
mn IN:metaname to get (may be NULL)
bFound OUT: if mn in list, true.
Returns:
pointer to metaelem AND bFound is true.

pointer to last item in list AND bFound is false.

If bFound False, and return NULL, then list empty.

searchm_metalist_process p_query_info_t  p_qi  )  [static]
 

called during results phase to create the meta list

Parameters:
p_qi Query Information
Returns:
APR_SUCCESS list created

SEARCHM_INTERNAL_SERVER_ERROR

SEARCHM_ERROR_DOC

searchm_nodelist_add p_searchm_metaelem_t const  p_me,
const char **  sl,
int *  index_sl,
int  bP,
int  nterms,
apr_pool_t *  p
[static]
 

adds the term(s) at index_sl in sl to nodelist of me. me->l may be null. if nterms==1, then in phrase with one term. When added to nodelist, will become a single term, with phrase distinction lost. return:

Parameters:
p_me The metaelement's nodelist to add to.
sl string_list
index_sl pointer to term to add in string_list
bP If within a phrase
nterms number of terms. 0 single, >=1 phrase terms.
p the memory pool

Returns:
APR_SUCCESS: term added, nodelist.i incremented.

APR_SUCCESS: term one of and, not, or

APR_SUCCESS: term a duplicate

APR_SUCCESS: term a duplicate, and switched

APR_SUCCESS: empty phrase

SEARCHM_INTERNAL_SERVER_ERROR

searchm_nodelist_match p_searchm_metaelem_t const  p_me,
const char **  sl,
const int  index_sl,
const int  bP,
const int  nterms,
int *  bFound,
apr_pool_t *  p
[static]
 

Parameters:
p_me IN:The metaelem node list to use.
sl IN:The string_list.
index_sl IN:The first term in the sl.
bP IN:True if phrase.
nterms IN:The number of terms. 0=single term. >=1 a phrase.
bFound OUT: True - match found. Terms may have been swapped. False - match not found.
p the memory pool Determines if the term or phrase at index_sl is a duplicate of one already in this metaelement's nodelist. A single term: A exact duplicate term, match. Ex: joe matches JOE A wildcard term with the same beginning as another term, match. Keep small. Ex: swi* matches swis*. Ex: swis* matches swi*, and swap. A term that is a substring of another term, match. Keep smallest. Ex: 'and' matches 'sandy' Ex: 'sandy' matches 'and', and swap. Ex: 'and*' matches 'sandy' Ex: 'sandy' matches 'and*', and swap. If a term is swapped for a more generalized term. This depends on the matching RE being constructed properly. A single term 'and', 'or', 'not' always matches. A single phrase 'and', 'or', 'not',
Returns:
APR_SUCCESS No errors.

SEARCHM_INTERNAL_SERVER_ERROR

int searchm_nullstrcmp const char *const  t1,
const char *const  t2,
const int  bCase
[static]
 

compares t1 and t2, allowing for t1 and/or t2 to be NULL. if t1 and t2 are NULL, strings are considered equal The NULL string is considered less than a non NULL string. return: 0 strings are equal 1 strings are not equal

fn searchm_nullstrcmp(const char * const t1, const char * const t2, const int bCase)

Parameters:
t1 string 1
t2 string 2
bCase NULL_STRCMP_CASE (0), use strcmp NULL_STRCMP_NOCASE (1), use strcasecmp

searchm_phrase_match p_searchm_metaelem_t const  p_me,
const char **  sl,
const int  index_sl,
const int  bP,
const int  nterms,
int *  bResult,
apr_pool_t *  p
[static]
 

Checks if this phrase at ls[index_sl] is a match of an existing phrase in nodelist. If an existing phrase may be modified to match this phrase, it is modified, and match is successful. A match: If each term of a phrase is exaclty equal. Ex: "jack and jill" matches "jack and jill" If each term in phrase matches, with swap if necessary, match. Ex: "ja* and ji*" match "jack and jill" Ex: "jack and jill" match "ja* and ji*", with swap. Ex: "blackja* and ji*" match "ja* and ji*" with swap. If nterms in this phrase is not equal to the the number of terms in match phrase, then assume never equal.

Parameters:
p_me IN:The metaelem node list to use.
sl IN:The string_list.
index_sl IN:The first term in the sl.
bP IN:True if phrase.
nterms IN:The number of terms. 0=single term. >=1 a phrase.
bResult OUT:True - phrase matched an existing phrase in nodelist, possible swap. False - phrase does not match any phrase in nodelist.
p the memory pool

a phrase, with 2 to nterms terms a phrase with one term is considered a single term

Returns:
APR_SUCCESS no errors

SEARCHM_INTERNAL_SERVER_ERROR

searchm_single_match const char *  t1,
const char *  t2,
const int  bWay,
int *  Result,
apr_pool_t *  p
[static]
 

Parameters:
t1 IN:term1
t2 IN:term2
bWay IN:1 start of term significant, 0 start of term not significant. bWay 0 is used for single terms, and the first term of a phrase. bWay 1 is used for terms in a phrase.
Result OUT:0, terms are not duplicates 1 terms are duplicates. Term 1 should be kept/ t1==t2. 2 terms are duplicates. Term 2 should be kept/ t1!=t2.
p Memory pool. Order is important Checks to see if t1 is equal to t2 t1=swish is a duplicate of t2=sw* t1=swi* is a duplicate of t2=sw* and is a duplicate of and the most generalized term is kept.
Returns:
APR_SUCCESS no errors

SEARCHM_INTERNAL_SERVER_ERROR

searchm_subquery_process p_searchm_metalist_t const  p_ml,
const char **  sl,
unsigned int *  index_sl,
const char *  meta_def,
apr_pool_t *  p
[static]
 

process a Swish-e subquery (as opposed to a searchm sub-query)

Parameters:
p_ml metalist
sl the start of sub-query.
index_sl index into sl currently at. (avoids pointers). is automatically adjusted
meta_def the default metaname for this sub-query. (may be NULL)
p the memory pool
Returns:
0 Success

1 error


Generated on Wed Mar 30 09:40:29 2005 for Mod_Searchm by doxygen 1.3.6