All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low Search to filter entries by relationship field

Digital Designs 19 Jan 2018 18:28 question, complete

We would like to filter a list of entries by a relationship field. The entries are related to an "author" channel. We would like to display only entries by that author when visiting a url such as: http://domain.com/entries/author/auth...

In our case the "author-name" is the same as the url_title for the authors channel entry. Here is our code now:
{exp:low_search:results channel="activities" query="{segment_3}" child:activity_author="{segment_3}" orderby="entry_date"}
{title}
{/exp:low_search:results}


When I remove the child:activity_author...all the entries are displayed. When I add it back, nothing shows up. What are we missing here?

Replies

  1. Low 19 Jan 2018 19:34

    If {segment_3} is not an encoded query, then remove the query="{segment_3}" parameter.

    Otherwise, try and turn on template debugging and copy/paste all lines that mention Low Search here. That can provide you with some insight.

  2. Digital Designs 20 Jan 2018 13:16

    It looks like it is coming up with entries, but they arent showing up for some reason:

    (0.083391 / 5.11MB) Beginning Final Tag Data Processing
    (0.083404 / 5.11MB) Calling Class/Method: Low_search/results
    (0.083860 / 5.11MB) -> Class Called: Low_search
    (0.085436 / 5.23MB) -> Method Called: results
    (0.088819 / 5.35MB) Low Search: Applying Low_search_filter_relationships
    (0.088850 / 5.35MB) Low Search: Getting channel field info from API
    (0.106326 / 7.52MB) Low Search: Getting entry IDs for given relationship url_titles (field 710)
    (0.107816 / 7.53MB) Low Search: Applying Low_search_filter_keywords
    (0.107911 / 7.53MB) Low Search: No keyword search
    (0.108544 / 7.54MB) Low Search: Setting entry_id param
    (0.109732 / 7.60MB) Calling Extension Class/Method: Low_reorder_ext/low_search_post_search
    (0.110006 / 7.59MB) Low Search: Parameters set: channel="activities" child:activity_author="jason-boke" orderby="entry_date" entry_id="2444|19886|22820|22829|22834"
    (0.110022 / 7.59MB) Low Search: Pre-applying search vars to tagdata
    (0.110352 / 7.60MB) Low Search: Calling the channel module
    (0.113952 / 7.69MB) Returning No Results Content
    (0.113999 / 7.68MB) Returning No Results Content
    (0.114074 / 7.68MB) -> Data Returned
    (0.114192 / 7.62MB) Stash: processing inner tags
    (0.126112 / 7.69MB) Calling Extension Class/Method: Stash_ext/template_post_parse

  3. Low 20 Jan 2018 20:26

    Then the entries are probably negated by default parameters like status (which defaults to 'open' only) or show_expired/show_future_entries (which both default to 'no').

  4. Digital Designs 23 Jan 2018 17:21

    I ensured the status was included in the tag, and made sure the entries weren't expired or future entries. I also removed the stash wrapper template in case that could be causing problems. Still no results are showing, but it appears its finding the correct entry_id's just not displaying the entries. What else can we do to troubleshoot?

    (0.022802 / 2.84MB) Tag: {exp:low_search:results channel="activities" status="featured|open" child:activity_author="jon-phillips" orderby="entry_date"}
    (0.022889 / 2.83MB) Closing Tag Found
    (0.022976 / 2.84MB) Tag: {exp:forms:form form_name="help" output_js="no"}
    (0.023045 / 2.84MB) Closing Tag Found
    (0.023099 / 2.84MB) Processing Tags
    (0.023132 / 2.85MB) Module Tag: Low_search/results
    (0.023150 / 2.85MB) Module Tag: Forms/form
    (0.023164 / 2.85MB) Including Files for Plugins and Modules
    (0.023557 / 2.88MB) Files for Plugins and Modules All Included
    (0.024021 / 2.92MB) Beginning Final Tag Data Processing
    (0.024064 / 2.92MB) Calling Class/Method: Low_search/results
    (0.024615 / 2.93MB) -> Class Called: Low_search
    (0.026201 / 3.05MB) -> Method Called: results
    (0.029257 / 3.16MB) Low Search: Applying Low_search_filter_relationships
    (0.029289 / 3.16MB) Low Search: Getting channel field info from API
    (0.047778 / 5.35MB) Low Search: Getting entry IDs for given relationship url_titles (field 710)
    (0.048747 / 5.36MB) Low Search: Applying Low_search_filter_keywords
    (0.048809 / 5.36MB) Low Search: No keyword search
    (0.049340 / 5.36MB) Low Search: Setting entry_id param
    (0.050502 / 5.41MB) Calling Extension Class/Method: Low_reorder_ext/low_search_post_search
    (0.050785 / 5.41MB) Low Search: Parameters set: channel="activities" status="featured|open" child:activity_author="jon-phillips" orderby="entry_date" entry_id="2467|2627|22827|22833|22839"
    (0.050799 / 5.41MB) Low Search: Pre-applying search vars to tagdata
    (0.052424 / 5.41MB) Low Search: Calling the channel module
    (0.055493 / 5.50MB) Returning No Results Content
    (0.055535 / 5.49MB) Returning No Results Content

  5. Digital Designs 23 Jan 2018 18:29

    Just figured it out, I needed to add dynamic="no" to the results tag.

  6. Low 24 Jan 2018 09:10

    Okay! Just wondering, what version of EE and LS are you using?