mflbackend/src/helpers.py
def multi_query(lexicon, fullquery, fields, query, isfilter):
    """
    Construct a Karp query string, searching for different terms in different
    fields.
    Args:
        lexicon (str): the lexicon name
        fullquery (list): previously composed queries
        fields (list): a list of fields to search
        query (list): a list of terms to search for
        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.
    """
    operator = 'equals' if not isfilter else 'regexp'
    for ix, field in enumerate(fields):
        q = query[ix]
        if isfilter:
            q = '.*'+q+'.*'
        fullquery.append('and|%s.search|%s|%s' %
                         (lexconfig.get_field(lexicon, field, field),
                          operator, q))
    return fullquery

    Construct a Karp query string, searching for different terms in different
    fields.
    Args:
        lexicon (str): the lexicon name
        fullquery (list): previously composed queries
        fields (list): a list of fields to search
        query (list): a list of terms to search for
        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, searching for different terms in different
fields.
Construct a Karp query string searching for different terms in different fields .
def multi_query(lexicon, fullquery, fields, query, isfilter):
    operator = 'equals' if not isfilter else 'regexp'
    for ix, field in enumerate(fields):
        q = query[ix]
        if isfilter:
            q = '.*'+q+'.*'
        fullquery.append('and|%s.search|%s|%s' %
                         (lexconfig.get_field(lexicon, field, field),
                          operator, q))
    return fullquery
def multi_query ( lexicon , fullquery , fields , query , isfilter ) : operator = 'equals' if not isfilter else 'regexp' for ix , field in enumerate ( fields ) : q = query [ ix ] if isfilter : q = '.*' + q + '.*' fullquery . append ( 'and|%s.search|%s|%s' % ( lexconfig . get_field ( lexicon , field , field ) , operator , q ) ) return fullquery
Construct a Karp query string, searching for different terms in different
fields.
Construct a Karp query string searching for different terms in different fields .
"""
    Construct a Karp query string, searching for different terms in different
    fields.
    Args:
        lexicon (str): the lexicon name
        fullquery (list): previously composed queries
        fields (list): a list of fields to search
        query (list): a list of terms to search for
        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 .
lexicon
the lexicon name
the lexicon name
fullquery
previously composed queries
previously composed queries
fields
a list of fields to search
a list of fields to search
query
a list of terms to search for
a list of terms to search for
isfilter
search for q as a substring if true.
Defaults to false.
search for q as a substring if true . Defaults to false .