Search issues

  • robpl1
    Participant
    3 years, 2 months ago #23489

    Using Divi Builder for my design work. I wanted to put a search box on the home page so created a file, searcfh.php, in my child template folder and placed the code “echo do_shortcode(‘solr_search_shortcode’); ” between php tags. I then placed [solr_search_shortcode] in a text module on the page. However, what happens then is that immediately below the header bar a search bocx appears after which it appears to be listing all 36,000 records (paginated) before the body of the home page.
    I’ve ticked the box “Do not load WPSOLR front-end css. You can then use your own theme css.” so surely that shouldn’t happen? I’ve also created a page for search results and given the name of it to the section “Ajax search page slug”. The index that’s been created is set as the one to be used.
    In the data section (2.2) I’ve checked all the ACF fields I want to use but either they’re not being indexed or the index isn’t used. I’ve tested this with a known unique value in one of those fields but all the search boxes I have return “no value”. One of these is a search bar (created by php code in the functions.php file) and another is the Yith Ajax search plugin. I’ve also created a dedicated Search Results template in Divi.
    Aslo the Send Data page states ‘A total of 35935 documents are currently in your index “chimes”‘ but WooCommerce thinks I’ve only got 34,627 products. There are no blogs and only 19 pages in total. Would the difference be due to tags, brands and categories perhaps?

    MTIA

    Rob

    wpsolr
    Keymaster
    3 years, 2 months ago #23490

    Fortunately, you do not need to do all that.

    Just select “Use my own theme search template” in screen 2.1, and your DIVI theme will use its standard search boxes and search page (The WPSOLR Ajax theme is deprecated).

    Here is a DIVI demo with WPSOLR and Elasticsearch: https://demo-woocommerce-divi-cloudways.wpsolr.com/shop/

    robpl1
    Participant
    3 years, 2 months ago #23499

    Unfortunately that’s not happening for me. I’ve turned all the other stuff off and just tried the Search from Divi search module. I placed something in an ACF field (my surname), indexed it and searched and get not a found message. The fifth line on page 2.1 is labelled “Search template” and I have it set to “Use my current theme search template with Ajax”. I’ve tried it set to ‘without Ajax’ but that makes no difference. I’ve also got a search bar in my header (from Divi’s Menu module) and that too returns Not Found. It seems either the search isn’t using the Solr index or the index isn’t indexing the field. However I think that it is indexing because there are changes that can be seen on the Send Data page when I do something like adding data to a field that needs indexing.

    That Demo site is interesting but all it really tells me is that it can be done, and not how. Is there any way of seeing “behind the scenes”?

    wpsolr
    Keymaster
    3 years, 2 months ago #23500

    Did you check “index categories and custom fields” in screen 2.2?

    robpl1
    Participant
    3 years, 2 months ago #23509

    Yes, that’s been ticked, along with each individual field in the products section on the same page.

    wpsolr
    Keymaster
    3 years, 2 months ago #23510

    Did you install the WPSOLR facets widget on your search page sidebar, and do you see it?

    robpl1
    Participant
    3 years, 2 months ago #23515

    I don’t normally use side bars but I created a page with one on. When the wp-solr widgets are enabled they don’t show, but others do. There’s a standard search widget on there but it only finds things like titles.

    Something you said though made me think sideways, so I created a Divi template assigned to Search and a simple text box with [solr_search_shortcode] in it. It now seems to be getting through to the Solr index. Now it would appear to be just a matter of styling the page and the layout of the information that I want on it.
    I’d still like to know why the widgets don’t show since that might be important in the searches.

    wpsolr
    Keymaster
    3 years, 2 months ago #23516

    Can you attach here screenshots of your screen 2.1 and 2.4?

    robpl1
    Participant
    3 years, 2 months ago #23517

    I noticed before that there was a button on your page to upload jpegs but can’t see that now.

    wpsolr
    Keymaster
    3 years, 2 months ago #23518

    You can use any image sharing service to insert a link in here.

    robpl1
    Participant
    3 years, 2 months ago #23522

    Sorry the system won’t let me paste links in. It insists that it’s spam if I do
    Would it be possible to turn the Search Results page you had for that demo site into a Divi Layout or Module? Whatever I try to do gets ignored.

    wpsolr
    Keymaster
    3 years, 2 months ago #23523

    You should be able to paste links now. Can you retry?

    robpl1
    Participant
    3 years, 2 months ago #23525

    That just cleared the links and didn’t post anything. Should they be enclosed in anything?

    R

    wpsolr
    Keymaster
    3 years, 2 months ago #23527

    No, juste paste your link.

    robpl1
    Participant
Viewing 15 posts - 1 through 15 (of 29 total)

You must be logged in to reply to this topic.