Custom fields on results layout && ordering queries

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Custom fields on results layout && ordering queries

This topic contains 5 replies, has 2 voices, and was last updated by jtort jtort 6 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #16920
    jtort
    jtort
    Participant

    Hi Ernest!
    Already purchased Ajax Search Pro (Purchase Code: *moved*) ?
    I’m pretty familiar with the Lite version which I used previously for a couple of sites I developed.
    Really happy with my purchase.

    I’m trying to archive some goals, and would like you to please help me out with some questions.
    You’ll find them below, numbered so that it’s easier for you to answer.

    This will be an eCommerce (WooCommerce) where I’ll be selling music records.
    Being the Album Names the Product title, and the Artist Names a custom field generated with Advanced Custom Fields.

    FYI:
    For development purpose I have imported just 34 k products so far. But I’m planning to have around 2 million products on my WooCommerce. I’m hosting on a EC2 instance of Amazon with a scalable Relational Database in order to archive a good performance for such an eCommerce with such a big amount of products. Ajax Search PRO is responding smoothly with the 34 k products, and I have not yet indexed or cached.

    1) I can’t get the Advanced Description Field working. I placed some of the fields which I now have on the Advanced Title Field, on the Advanced Description Field; but I can get the output on the front end. This is not to important for me since putting all my fields on the Advanced Title Field gets the job done. But I would like to get a deep understanding on how the PRO version works.

    2) Include WooCommerce product attributes on the search results. Is this possible?
    The Artist Name (advanced custom field) its stored on the _postmeta table at the database. But the product attributes come from the _term tables ( _terms, _termmeta, _term_taxonomy and _term_relationship ). If it is possible indeed, would it be advisable for my project (where I’m expecting to have around 2 million products) not to include them on the search results layout?

    3) Regarding results ordering and keywords handling: I tried searching for an artist “eddy arnold” and on the search results box the products where the he is in fact the artist, are not showing on the first results. You can try this at the bottom (footer) of my shop https://musicono.com/shop/
    (see screenshot 02.png )

    Tks in advanced and my best regards,
    Juan

    • This topic was modified 6 years, 2 months ago by jtort jtort. Reason: removed credentials from public view on description
    • This topic was modified 5 years, 4 months ago by Ernest Marcinko Ernest Marcinko.
    Attachments:
    You must be logged in to view attached files.
    #16930
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Juan,

    Thank you for the proper details, it helps me a lot!

    1. It was not showing, because this option was turned off: https://i.imgur.com/Qp16h9M.png
    I have enabled that for you, and moved the contents to the advanced description field.

    2. It is possible, but with custom code only. I believe this knowledge base article will help you to get started: Showing category/term titles in title/content fields

    3. This was due to multiple reasons:
    – The default search logic is to give you as many search results as possible (OR keyword logic). But since you have a large set of products, changing that to ‘AND’ was already giving much more appropriate matches: https://i.imgur.com/3Z0QbFp.png
    – The ordering was set to title descending, instead of the default relevance, I have changed that as well: https://i.imgur.com/gV8op0D.png
    – I have also tweaked the relevance weights a tiny bit, so that titles and custom fields (like the artist field) has a much higher weight to match: https://i.imgur.com/DHUOoyi.png

    I believe this might give you the closest expected results possible.

    I hope this helps!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #16933
    jtort
    jtort
    Participant

    Thank you very much for the assistance Ernest
    It was of great help!!
    I’ll be checking the post on the knowledge base for Displaying the category titles (or taxonomy term titles) in the result title or content shortly!
    My best regards,
    Juan

    #16934
    jtort
    jtort
    Participant

    Hi Ernest,
    The filter on the knowledge base for Displaying the category titles (or taxonomy term titles) in the result title or content worked great for one product attribute.

    By interpreting the forearch loop I understand that is capable of handling more than one taxonomy.
    Is this correct? If so, I will need a bit of extra help on the synthaxis…

    I tried initializing an array like this:

      $taxonomy = []; // 'category', 'post_tag', 'product_tag', 'product_cat' etc..
      $taxonomy[] = 'pa_decade'; 
      $taxonomy[] = 'pa_format'; 
      $taxonomy[] = 'pa_genre'; 
      $taxonomy[] = 'pa_label'; 
    

    … but its not working.

    Thank you one more time.
    Juan

    #16939
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Juan,

    It won’t work that way, that custom code only supports one taxonomy.

    I have made a change to it, so using this one, will allow you to add multiple taxonomies, separated by comma like so:

    $taxonomy = 'category, post_tag';

    The updated code:

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #16942
    jtort
    jtort
    Participant

    Awesome Ernest!!
    Added 6 attributes and works perfectly!!
    And if one is not present for that result, it just doesn’t show it.

    Thank you very very much for the twitch!!

    Best regards,
    Juan

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Custom fields on results layout && ordering queries’ is closed to new replies.