mflbackend/src/helpers.py
def search_q(fullquery, searchfield, q, lexicon, isfilter=False):
    """
    Construct a Karp query string.
    Args:
        fullquery (list): previously composed queries
        searchfield (str): a karp search field
        q (str): a term to search for
        lexicon (str): the lexicon to search
        isfilter (bool, optional): search for q as a substring if true.
            Defaults to false.
    Returns:
       fullquery (list): the input fullquery list, with the new query appended.
    """
    if q:
        operator = 'equals' if not isfilter else 'regexp'
        if isfilter:
            q = '.*'+q+'.*'
        logging.debug('q is %s', q)
        fullquery.append('and|%s.search|%s|%s' % (searchfield, operator, q))
    if fullquery:
        fullquery = 'extended||' + '||'.join(fullquery)
    else:
        fullquery = 'extended||and|lexiconName|equals|%s' % lexicon
    return fullquery

    Construct a Karp query string.
    Args:
        fullquery (list): previously composed queries
        searchfield (str): a karp search field
        q (str): a term to search for
        lexicon (str): the lexicon to search
        isfilter (bool, optional): search for q as a substring if true.
            Defaults to false.
    Returns:
       fullquery (list): the input fullquery list, with the new query appended.
    
Construct a Karp query string.
Construct a Karp query string .
def search_q(fullquery, searchfield, q, lexicon, isfilter=False):
    if q:
        operator = 'equals' if not isfilter else 'regexp'
        if isfilter:
            q = '.*'+q+'.*'
        logging.debug('q is %s', q)
        fullquery.append('and|%s.search|%s|%s' % (searchfield, operator, q))
    if fullquery:
        fullquery = 'extended||' + '||'.join(fullquery)
    else:
        fullquery = 'extended||and|lexiconName|equals|%s' % lexicon
    return fullquery
def search_q ( fullquery , searchfield , q , lexicon , isfilter = False ) : if q : operator = 'equals' if not isfilter else 'regexp' if isfilter : q = '.*' + q + '.*' logging . debug ( 'q is %s' , q ) fullquery . append ( 'and|%s.search|%s|%s' % ( searchfield , operator , q ) ) if fullquery : fullquery = 'extended||' + '||' . join ( fullquery ) else : fullquery = 'extended||and|lexiconName|equals|%s' % lexicon return fullquery
Construct a Karp query string.
Construct a Karp query string .
"""
    Construct a Karp query string.
    Args:
        fullquery (list): previously composed queries
        searchfield (str): a karp search field
        q (str): a term to search for
        lexicon (str): the lexicon to search
        isfilter (bool, optional): search for q as a substring if true.
            Defaults to false.
    Returns:
       fullquery (list): the input fullquery list, with the new query appended.
    """
fullquery (list): the input fullquery list, with the new query appended.
fullquery ( list ) : the input fullquery list with the new query appended .
fullquery
previously composed queries
previously composed queries
searchfield
a karp search field
a karp search field
q
a term to search for
a term to search for
lexicon
the lexicon to search
the lexicon to search
isfilter
search for q as a substring if true.
Defaults to false.
search for q as a substring if true . Defaults to false .