Exclude results by custom foelds

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Exclude results by custom foelds

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28373
    mb-netzwerk61
    mb-netzwerk61
    Participant

    Hello,
    I’m using Ajax search pro to make conference proceedings searchable.This works pretty good. Now I would like to exclude some pdf files from the search. Therefore I’ve read your tutorial about using custom fields to exclude results from the search.
    I’ve installed advanced custom fields and added a custom field to the pff attachements called nicht_durchsuchen
    Then I added a filter in ajax search pro to exclude all the pdf files with this custom field set to 1.
    If you type in the search string “patronage” there are a lof of results that should be supressed. What is wrong in my setup?
    regards
    Markus

    #28374
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Markus,

    Thank you very much for the details!

    If you are using attachments by any chance, then make sure to enable this option: https://i.imgur.com/hoc50t9.png
    That should resolve the issue.

    Best,
    Ernest Marcinko

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


    #28375
    mb-netzwerk61
    mb-netzwerk61
    Participant

    Thank you.
    Now I can tell the system which pdf files it should make searchable. But I can’t exclude several pdf files. If I use the LIKE operator only the files with the custom fields value 1 are searchable. If I use the operator NOT LIKE operator I get no results at all.
    I’m a bit confused.

    #28376
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Because “NOT LIKE 1” will exclude everything that has a value ot 1 on that field, as well as the results where the field is not defined – in your case everything.
    If you want to include results that does not have the field defined, then enable this option. Then using the NOT LIKE 1 will exclude everything where the value is 1, but include where it’s not defined.

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.