I used this code…
{exp:channel:entries channel="services" search:service_description="hello"}
<div>
{title}
</div>
{/exp:channel:entries}
…where service_description is an existing field, so it still lives in the channel_data table. Using it in a search:
parameter throws this error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ee4-0.exp_channel_data_field_8' doesn't exist:
SELECT t.entry_id , exp_channels.channel_id FROM exp_channel_titles AS t LEFT JOIN exp_channels ON t.channel_id = exp_channels.channel_id LEFT JOIN exp_channel_data AS wd ON wd.entry_id = t.entry_id LEFT JOIN exp_channel_data_field_8 ON exp_channel_data_field_8.entry_id = t.entry_id WHERE t.entry_id !='' AND t.site_id IN ('1') AND t.entry_date < 1509694881 AND (t.expiration_date = 0 OR t.expiration_date > 1509694881) AND t.channel_id IN (3,11) AND t.status = 'open' AND ( (wd.site_id=1 AND exp_channel_data_field_8.field_id_8 LIKE "%hello%") )ORDER BY t.sticky desc, t.entry_date desc, t.entry_id desc LIMIT 0, 100
So I’m guessing it’s not taking ‘old’ fields into account.
I’m gonna run into this issue for Low Search as well, so I’m hoping there’s gonna be a way to natively target the field’s location for similar queries.
That’s only the Keywords filter. LS als has its own Field Search filter, (ie. search:field_name), so it supports additional syntax (like search:field="^foo"
, search:field="bar$"
), it can target native fields (like search:title="lorem"
) and it can target Grid columns (search:grid_field:column="baz"
). I’m already targeting different tables here, so I need to elaborate on that.
Same goes for the Ranges filter (queries the DB directly) and the Distance filter (same).
Preferably, I’d like to see a Field Service of some sort in EE, where you can input a field name, and get back a field ID along with the database location of its content.
I can see the legacy channel fields API is still in use, right? Or is there an alternative now?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.