• Resolved johnkapr

    (@johnkapr)


    Thank you,
    Yes, the category restriction seems to work in the admin search if I put cat=15 in the parameters box. I am not sure what the “tax query” parameters are. I am not using any other search related plugins, though I am running a few other plugins (add simple css, a registration and front-end posting plugin, and the bbpress plugin.)
    Any thoughts on how to proceed?

    On another note, sometimes the search returns excerpts from pages that are not clickable, so I can’t even figure out what page they are from to exclude them from the search.

    “Does the category restriction work in the Relevanssi admin search if you put cat=15 in the search parameters box? Is it possible you have other plugins that change the tax_query parameters of the query? Please answer these questions in a new thread, not here.”

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Tax query parameters are taxonomy restrictions: categories, tags, custom taxonomies. Some plugins use these and may override Relevanssi settings. Common causes are multilingual plugins that use taxonomies for the language and WooCommerce, which uses taxonomies for stock status.

    A good next step would be to look at the front end search with Query Monitor. What does the Relevanssi MySQL query look like there, if you have the category parameter included? This will show us if something is overriding the parameter. Instructions for Query Monitor use can be found here: https://www.relevanssi.com/knowledge-base/debugging-with-query-monitor/

    Thread Starter johnkapr

    (@johnkapr)

    Thank you, I will try that first thing tomorrow. I will run it with the admin search, the relevanssi search box, and the default search widget and see how they compare. Sometimes with the Relevanssi search box without the category limiter it also stalls, while the default widget always seems to run fine, and DOES search tags, so it is obviously using the Relevanssi index. Could there be an incompatibility between my Zakra theme and the shortcode form?

    Plugin Author Mikko Saari

    (@msaari)

    Is the form different? It shouldn’t be. If Zakra has a search form (in searchform.php), the Relevanssi search form shortcode uses that form; otherwise, Relevanssi uses the default WP search form for the shortcode. The form should be the same, no matter which way you generate it, that is.

    Thread Starter johnkapr

    (@johnkapr)

    Well, at the very least it is styled differently. There is a search icon in the header that seems to work intermittently with Relevanssi active. If I insert the shortcode I get a half-width search bar with an internal search button, and that works inconsistently, and if I select the search widget with the block editor I get a full width search bar with an adjacent button. That one works consistently and appears to be using Relevanssi, but I can’t easily customize it.like I can with the shortcode.

    Plugin Author Mikko Saari

    (@msaari)

    What do you mean by “work intermittently”? There should no middle ground here – a search form works correctly or not. If the search stalls, that should not be related to the search form. After all, all search forms with the same parameters should lead you to exactly the same search results page URL. (If they don’t, that’s interesting and enlightening in itself.)

    The forms may look different, but that’s just a question of CSS, and the forms can be made to look the same if necessary.

    • This reply was modified 3 years, 3 months ago by Mikko Saari.
    Thread Starter johnkapr

    (@johnkapr)

    I have Query Monitor set up. Should I be looking at all callers? It reports back a huge amount of data. What would you want to see? I can restrict it to calls from Relevanssi if that is better.

    Thread Starter johnkapr

    (@johnkapr)

    So the query is working! The problem is, that it only works if a query is entered into the search bar and then you hit return. Clicking the magnifying glass does not generate the search. Is that the way it is supposed to work? Because that is not what I would expect (I would expect either to work)
    The WP default (or theme, I am not sure which) search widget has an actual “search” button adjacent to the entry field.
    Hmm. This board won’t let me show you what the search looks like. Here is a link to the page. The search bar ON THIS PAGE should only return audio files. you can try searching for “fish” or “summer” both should have one audio file, but more files in general. You can search generally from the search icon in the menu bar at the top of the page.

    https://lis564.byethost7.com/audio/

    If that is the way the search bar is supposed to function, I will try it and test with some potential users. I know I was surprised at the behavior. I may have to use another plugin instead because of this, if I can find another that does the same sort of search. Is there any way of modifying the behavior?

    John

    Plugin Author Mikko Saari

    (@msaari)

    That magnifying glass is not a button. It’s just an image of a magnifying glass. I agree it’s misleading. Relevanssi, however, has nothing to do with the way the form looks like, that’s up to your theme (even when you’re using the Relevanssi shortcode; the base search form comes from your theme). So you may

    That form does have an actual “Search” button, but it’s hidden with this bit of CSS in your theme style.css file:

    .search-form .search-submit {
        display: none;
    }

    Remove that, and the search button comes up. The magnifying glass comes from this CSS:

    .search-form label {
        position: relative;
    }

    So, to get rid of the magnifying glass, either remove that CSS or override it:

    #main .search-form label {
        display: none;
    }

    Searching for “summer” returns two files, but both are in the Audio category, so the search in itself seems to work fine.

    Thread Starter johnkapr

    (@johnkapr)

    Thank you, that is very helpful! I appreciate your time and patience with me. Relevanssi is an outstanding plugin!

    John

    Plugin Author Mikko Saari

    (@msaari)

    Could you please consider telling that in a review? Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Category search short code not working’ is closed to new replies.