No search results searching title for entries that starts_with the letter R
Hello,
We have a site running EE 2.8.1, and low search 4.3.1.
We have a page that lists entries by letter using low_search. As far as we know this worked and still works fine except for entries with starting with the letter 'R'.
An example URL: http://example.com/mychannel/alphabet...
Our results template:
{exp:low_search:results collection="mychannel" limit="10" search:title="{segment_3}" starts_with="search:title" orderby="title" sort=“asc”}
low_search {title}
{/exp:low_search:results}
This works for all letters exact R, if we change segment_3 to ‘RA’ it works!
http://example.com/mychannel/alphabet...
To test we have even added a query to the template:
{exp:query sql="SELECT title FROM exp_channel_titles WHERE channel_id=1 AND title LIKE '{segment_3}%' GROUP BY title order by title LIMIT 10"}
Query: {title}
{/exp:query}
The page output and screen grab of the template are attached.
Replies
Paul Cripps 12 Jun 2017 12:06
Here's the debug info:
(0.079942 / 12.05MB) Tag: {exp:query sql="SELECT title FROM exp_channel_titles WHERE channel_id=1 AND title LIKE 'r%' GROUP BY title order by title LIMIT 10" paginate="bottom"}
(0.080022 / 12.05MB) Closing Tag Found
(0.080093 / 12.06MB) Tag: {exp:low_search:results collection="mychannel" limit="10" search:title="r" starts_with="search:title" orderby="title" sort="asc" disable="member_data|categories|playa" paginate="bottom"}
(0.080180 / 12.06MB) Closing Tag Found
(0.080258 / 12.06MB) Processing Tags
(0.080331 / 12.06MB) Module Tag: Query/
(0.080353 / 12.07MB) Module Tag: Low_search/results
(0.080367 / 12.07MB) Including Files for Plugins and Modules
(0.085411 / 12.36MB) Files for Plugins and Modules All Included
(0.086087 / 12.39MB) Beginning Final Tag Data Processing
(0.086109 / 12.39MB) Calling Class/Method: Query/
(0.086700 / 12.39MB) -> Class Called: Query
(0.095493 / 12.57MB) -> Method Called: __construct
(0.095584 / 12.57MB) -> Data Returned
(0.095612 / 12.57MB) Calling Class/Method: Low_search/results
(0.096474 / 12.57MB) -> Class Called: Low_search
(0.104310 / 13.04MB) -> Method Called: results
(0.104391 / 13.04MB) Low Search: Prepping if low_search_no_results conditional
(0.117406 / 13.62MB) Low Search: Applying Low_search_filter_field_search
(0.124594 / 13.68MB) Low Search: Applying Low_search_filter_keywords
(0.124759 / 13.69MB) Low Search: No keyword search
(0.125676 / 13.69MB) Low Search: Setting entry_id param
(0.126280 / 13.69MB) Low Search: Parameters set: collection="mychannel" limit="10" search:title="r" starts_with="search:title" orderby="title" sort="asc" disable="member_data|categories|playa" paginate="bottom" channel="mychannel" entry_id="451|329|351|352|353|387|441|456|498|499|525|621|624|651|664|836|866|1034|1041|1915|1920|1919|1917|1914|1901|1902|1903|1905|1906|1907|1908|1909|1910|1911|1912|1913|1916|1918|1921|1922|1923|1924|1925|1926|1950|2839|3071|3070|3072|3073|3076|3077|3078|3079|4089|4348|4749|4954|4981|5091|5826|6239|6292|6582|6797|7422|7432"
(0.126294 / 13.69MB) Low Search: Pre-applying search vars to tagdata
(0.126794 / 13.70MB) Low Search: Calling the channel module
(0.192438 / 17.43MB) Calling Extension Class/Method: Structure_ext/channel_module_create_pagination
(0.193245 / 17.30MB) Returning No Results Content
(0.193295 / 17.29MB) Low Search: Found low_search variables in no_results block, calling filters to parse
(0.195298 / 17.31MB) -> Data Returned
(0.195428 / 17.28MB) Parsing Tags in Template
(0.195504 / 17.28MB) Tag: {exp:low_search:suggestions keywords="" keywords:lang="en" limit="2"}
(0.195643 / 17.28MB) Closing Tag Found
(0.195720 / 17.28MB) Processing Tags
(0.195780 / 17.28MB) Module Tag: Low_search/suggestions
(0.195831 / 17.28MB) Including Files for Plugins and Modules
(0.195844 / 17.28MB) Files for Plugins and Modules All Included
(0.195853 / 17.28MB) Beginning Final Tag Data Processing
(0.195865 / 17.28MB) Calling Class/Method: Low_search/suggestions
(0.196060 / 17.28MB) -> Class Called: Low_search
Paul Cripps 12 Jun 2017 12:19
I've also rebuilt the collecion indexes.
Low 12 Jun 2017 12:20
Collections are irrelevant for this type of filtering.
If you enable the output profiler and look up the queries generated by Low Search, what do those say?
Low 12 Jun 2017 12:46
Actually, this looks like a bug that was fixed in version 4.4.0: try adding
dynamic="no"
.Paul Cripps 12 Jun 2017 14:29
Genius, looks like dynamic="no" did the trick, thanks low :)