Open sanand0 opened 5 years ago
?_q=text
?_qc
?_qc=firstname&_qc=lastname&_q=name
columns['firstname'].contains('name') or columns['lastname'].contains('name')
_qc
meta['ignored']
('_qc', col), ...
Implementation notes in gramex/data.py:
gramex/data.py
_pop_controls()
_q
_filter_db()
# Apply controls
if '_q' in controls:
meta['ignored'].append(('_qc', qc_ignored_cols))
columns[col].contains(query)
Origin:
Can I take this up?
Sure, @ranjith-p15
?_q=text
filters rows that match "text" in any of the chosen query columns?_qc
. For example,?_qc=firstname&_qc=lastname&_q=name
searches for "name" in the "firstname" and "lastname" columns.columns['firstname'].contains('name') or columns['lastname'].contains('name')
. See contains_qc
defaults to all string columns in the table_qc
contains non-string columns, these are added to metadata asmeta['ignored']
as('_qc', col), ...
Implementation notes in
gramex/data.py
:_pop_controls()
must pop out_q
and_qc
as controls_filter_db()
, under the# Apply controls
, add aif '_q' in controls:
section_qc
is in controls, pick only those columns._qc
columns are not in controls, add them tometa['ignored'].append(('_qc', qc_ignored_cols))
columns[col].contains(query)
for each column, using an OR join.Origin: