Low Search Not Returning All Entries Based on Solspace Tag
Our client is using ExpressionEngine 2.11.9 with Low Search 4.4.5 and Solspace Tag 4.2.9. Low Search only seems to return some of the resulting records from searching tags.
This wasn't fully noticeable at first, since most of the tags have 75 to 3 or 400 records associated to them. But we recently (6 months ago) added the total results or absolute results to the number of records returned, and trained a few more people to use the backend of Solspace Tag.
Someone noticed that, while a tag might list 260 results, The search results page would only list, say 115. I tried to troubleshoot this, by finding a couple of low use tags (with associated records under 20), searching on just that tag, no other variables, except for status (they use statuses other than open and closed, so they must be included on every query).
The same thing happens. "Credit Unions" has just seven uses of that tag. Low only returns 5 of the 7 records. I went through each record to see if there was some other potential issue, such as 'no status was added', does the tag display on the record. Nothing noticeable.
I rebuilt Index in Low and Tag, and still the same issue. Only some of the results are being returned.
I can't see anything wrong with the template debugger, though I admittedly don't understand everything that is going on. I'm not certain what the character limit for this platform is, so here's a truncated template debug...
TEMPLATE DEBUGGING
(0.000017 / 1.12MB) - Begin Template Processing -
(0.000036 / 1.12MB) URI: search/results
(0.000040 / 1.12MB) Path.php Template: /
(0.000047 / 1.12MB) Retrieving Template
(0.000051 / 1.12MB) Parsing Template URI
(0.001528 / 1.14MB) Template Group Found: search
(0.002207 / 1.14MB) Retrieving Template from Database: search/results
(0.003083 / 1.16MB) Template Found
(0.004515 / 1.12MB) Template Type: webpage
(0.004527 / 1.12MB) Parsing Site Variables
(0.004683 / 1.13MB) Snippets (Keys): freelancer_version|member_id_snippet|status_list|name|returned-records|site_id|site_label|site_short_name|last_segment|current_url|current_path|current_query_string|is_core
(0.004690 / 1.13MB) Snippets (Values): FALSE|{member_id}|pending|assigned|answered|re-opened|no-reach|{if screen_name != ""}{screen_name}{/if}|Records Returned: {exp:query sql="SELECT COUNT(entry_id) AS statusCount FROM 'exp_category_posts' p LEFT JOIN 'exp_categories' c ON c.cat_id = p.cat_id WHERE c.cat_url_title ='{segment_4}'; "}{statusCount}{/exp:query}Missing Options: Print as PDF | Download CSV|1|Hotline Administration|default_site|results|https://complaints.consumer-action.or...|
(0.004849 / 1.13MB) Parse Date Format String Constants
(0.004855 / 1.13MB) Parse Current Time Variables
(0.004900 / 1.13MB) Parsing Segment, Embed, Layout, logged_in_*, and Global Vars Conditionals
(0.008462 / 1.21MB) - Beginning Tag Processing -
(0.008477 / 1.21MB) Parsing Tags in Template
(0.008494 / 1.21MB) Tag: {exp:low_search:param get="keywords" query=""}
(0.008526 / 1.22MB) No Closing Tag
(0.008552 / 1.22MB) Tag: {exp:low_search:results query="" status="pending|assigned|answered|re-opened|no-reach" limit="15000" orderby="entry_date" sort="desc" pagination="bottom"}
(0.008578 / 1.22MB) Closing Tag Found
(0.008606 / 1.22MB) Tag: {exp:low_search:results query="" status="pending|assigned|answered|re-opened|no-reach" limit="100" orderby="entry_date" sort="desc" pagination="bottom"}
(0.008630 / 1.22MB) Closing Tag Found
(0.008673 / 1.22MB) Tag: {exp:low_search:save query="" group_id="2"}
(0.008688 / 1.22MB) Closing Tag Found
(0.008707 / 1.22MB) Processing Tags
(0.008722 / 1.22MB) Module Tag: Low_search/param
(0.008727 / 1.22MB) Module Tag: Low_search/results
(0.008732 / 1.22MB) Module Tag: Low_search/results
(0.008736 / 1.22MB) Module Tag: Low_search/save
(0.008744 / 1.22MB) Including Files for Plugins and Modules
(0.008786 / 1.23MB) Files for Plugins and Modules All Included
(0.012617 / 1.26MB) Beginning Final Tag Data Processing
(0.012632 / 1.26MB) Calling Class/Method: Low_search/param
(0.012674 / 1.26MB) -> Class Called: Low_search
(0.013052 / 1.28MB) -> Method Called: param
(0.013579 / 1.32MB) -> Data Returned
(0.013596 / 1.32MB) Calling Class/Method: Low_search/results
(0.013647 / 1.32MB) -> Class Called: Low_search
(0.013722 / 1.32MB) -> Method Called: results
(0.014597 / 1.40MB) Low Search: Applying Low_search_filter_field_search
(0.014725 / 1.40MB) Low Search: Getting channel field info from API
(0.019623 / 1.60MB) Low Search: Applying Low_search_filter_keywords
(0.019710 / 1.60MB) Low Search: No keyword search
(0.020068 / 1.60MB) Low Search: Setting entry_id param
(0.020132 / 1.60MB) Low Search: Parameters set: query="" status="pending|assigned|answered|re-opened|no-reach" limit="15000" orderby="entry_date" sort="desc" pagination="bottom" entry_id="2356|2195|5510|6647|12164"
(0.020136 / 1.60MB) Low Search: Pre-applying search vars to tagdata
(0.020472 / 1.61MB) Low Search: Calling the channel module
(0.025560 / 1.79MB) Calling Extension Class/Method: Low_search_ext/channel_entries_query_result
(0.037106 / 1.93MB) -> Data Returned
(0.037128 / 1.93MB) Calling Class/Method: Low_search/results
(0.039855 / 1.93MB) -> Class Called: Low_search
(0.039965 / 1.93MB) -> Method Called: results
(0.040077 / 1.93MB) Low Search: Applying Low_search_filter_field_search
(0.043347 / 1.95MB) Low Search: Applying Low_search_filter_keywords
(0.043372 / 1.95MB) Low Search: No keyword search
(0.043634 / 1.96MB) Low Search: Setting entry_id param
(0.043694 / 1.96MB) Low Search: Parameters set: query="" status="pending|assigned|answered|re-opened|no-reach" limit="100" orderby="entry_date" sort="desc" pagination="bottom" entry_id="2356|2195|5510|6647|12164"
(0.043698 / 1.96MB) Low Search: Pre-applying search vars to tagdata
(0.043806 / 1.96MB) Low Search: Calling the channel module
(0.050180 / 2.01MB) Calling Extension Class/Method: Low_search_ext/channel_entries_query_result
(0.058293 / 1.96MB) -> Data Returned
(0.058312 / 1.97MB) Calling Class/Method: Low_search/save
(0.058343 / 1.96MB) -> Class Called: Low_search
(0.058421 / 1.96MB) -> Method Called: save
(0.058597 / 1.97MB) -> Data Returned
(0.058626 / 1.93MB) Parsing Tags in Template
(0.058639 / 1.93MB) Tag: {exp:char_limit total="20"}
(0.058660 / 1.94MB) Closing Tag Found
(0.058687 / 1.93MB) Tag: {exp:char_limit total="20"}
(0.058704 / 1.94MB) Closing Tag Found
(0.058725 / 1.93MB) Tag: {exp:char_limit total="20"}
(0.058740 / 1.94MB) Closing Tag Found
(0.058761 / 1.94MB) Tag: {exp:char_limit total="20"}
(0.058774 / 1.94MB) Closing Tag Found
(0.058796 / 1.94MB) Tag: {exp:char_limit total="20"}
(0.058810 / 1.95MB) Closing Tag Found
(0.058831 / 1.94MB) Tag: {exp:char_limit total="20"}
(0.058845 / 1.95MB) Closing Tag Found
(0.058867 / 1.94MB) Tag: {exp:char_limit total="20"}
(0.058880 / 1.95MB) Closing Tag Found
(0.058903 / 1.94MB) Tag: {exp:char_limit total="20"}
(0.058915 / 1.95MB) Closing Tag Found
(0.058938 / 1.94MB) Tag: {exp:char_limit total="20"}
(0.058951 / 1.95MB) Closing Tag Found
(0.058974 / 1.95MB) Tag: {exp:char_limit total="20"}
(0.058986 / 1.95MB) Closing Tag Found
(0.059006 / 1.95MB) Processing Tags
(0.059016 / 1.95MB) Plugin Tag: Char_limit/
(0.059022 / 1.95MB) Plugin Tag: Char_limit/
(0.059027 / 1.95MB) Plugin Tag: Char_limit/
(0.059032 / 1.95MB) Plugin Tag: Char_limit/
(0.059037 / 1.95MB) Plugin Tag: Char_limit/
(0.059042 / 1.95MB) Plugin Tag: Char_limit/
(0.059047 / 1.95MB) Plugin Tag: Char_limit/
(0.059052 / 1.95MB) Plugin Tag: Char_limit/
(0.059057 / 1.95MB) Plugin Tag: Char_limit/
(0.059062 / 1.95MB) Plugin Tag: Char_limit/
Replies
Low 19 Jun 2018 16:02
Looking at the debugging info, you're not using the Tags filter, but just the Field Search and Keywords filters. Not sure what you're Form is, but the best way to filter entries by Tags, is to use the Tags filter.
I reckon using the Field Search filter to target a Tag field can wield unexpected results.
nonprofit_tech 19 Jun 2018 21:31
I assumed we'd need to use the field, since most searches contain more than just the tag— a date range, a location, keywords, etc. I limited it specifically to just a tag with their custom statuses, as a test case.
How would a filter work with custom search parameters, say a date range, which is their most frequent use. Finding all the records with a specific tag during the month of June, for example.
Low 20 Jun 2018 06:26
You can combine the Tag filter with any other filter. You'd need something like
tag_id="1"
(see https://gotolow.com/addons/low-search...) And for more examples, see https://gotolow.com/addons/low-search...