Support » Plugin: WP Extended Search » Using the AND feature to search 2 terms

  • Resolved jamesbn

    (@jamesbn)


    Hi there,
    Love the idea of the plugin so thanks for making it!

    I have an issue where I am trying to use the AND setting instead of OR.

    Let’s say I have the following taxonomies.

    TAXONOMY 1 GENERAL KEYWORDS: REPAIR, REPLACE, FIX
    TAXONOMY 2 SPECIFIC KEYWORDS: CAR, VAN, BIKE

    If I search BIKE > ALL RESULTS SHOW FOR ANY LISTING CONTAINING KEYWORD BIKE
    If I search REPAIR > ALL RESULTS SHOW FOR ANY LISTING USING THE KEYWORD REPAIR

    I have the EWPS set to AND

    But if I search BIKE REPAIR > NO RESULTS FOUND

    What is the AND setting supposed to do? I assumed it would return results which contain both keywords.

    Of course, I can use the OR setting.
    But the problem would be when searching BIKE REPAIR> RESULTS would show all LISTINGS containing the KEYWORD BIKE OR REPAIR, so this would also show results such as from listings for CAR REPAIR which would not be relevant.

    Any help appreciated 🙂

    Thanks

    Main question is, what does AND do?

    • This topic was modified 2 months, 4 weeks ago by jamesbn.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sumit Singh

    (@5um17)

    Hi,

    This is by design.
    AND control the relation between “BIKE” AND/OR “REPAIR” so a taxonomy term name should be “BIKE REPAIR” in order to match.

    You can read this detailed topic to understand this limitation better https://wordpress.org/support/topic/multiply-tag-search/

    Thanks

    Thread Starter jamesbn

    (@jamesbn)

    Hi there, thanks so much for your reply.
    Does this mean the “AND” option does not do anything?

    Let’s say I had a website of old football reports.

    There are over 100 professional teams in England.

    I would have the name of each team as a tag in a taxonomy called TEAMS.

    If somebody wanted to find all the old reports of “Manchester United” VS “Liverpool”.
    The user would search Manchester United and Liverpool.

    I would want the search result to show all games with BOTH Manchester United AND Liverpool.

    If I used the OR option.
    Then it would return all of the reports with the TAG Manchester United, including against all 100 of the other teams, and it would show all Liverpool including of of their games against 100 other teams. If they had each played all the other teams 10 times then there would be over 2000 results to look through just to find the ten relevant results.

    There MUST be a way? Please help.

    It would not e practical to write a tag for every single combination of teams playing each other.
    1 VS 2
    1 VS 3
    1 VS 4
    1 VS 5

    1 VS 100

    That’s 100 tags for the first team on the list.

    Then
    2 VS 1
    2 VS 3
    2 VS 4

    2 VS 100

    That’s another 100 tags,, for team 2 on the list.

    And then do that for all 100 teams.

    That’s 100 X 100 = TEN THOUSAND tags.

    Above, you said:
    AND control the relation between “BIKE” AND/OR “REPAIR” so a taxonomy term name should be “BIKE REPAIR” in order to match.

    Doesn’t that explanation mean that AND and OR are both the same?

    If I have to have “BIKE REPAIR” as a taxonomy term then isn’t it just the same as having exact match turned on?

    Thread Starter jamesbn

    (@jamesbn)

    I found an example:

    Themeforest.

    If I search WORDPRESS THEME = 13,000 results
    If I search GYM = 800 results
    If I search GYM WORDPRESS THEME = 300 results
    (the 3rd search only shows those results which contain both search terms, but they do not have a separate tag/term called “gym wordpress theme”)

    Hope you an understand what I mean.

    Thanks

    Plugin Author Sumit Singh

    (@5um17)

    Hi,

    I understand everything you said but have you read this thread https://wordpress.org/support/topic/multiply-tag-search/ ?

    As I explained this is by design for terms. Which is already explained here https://wpes.secretsofgeeks.com/

    Settings have OR relation with each other. For instance if user searches for “hello world” then both words or any word (You can customize this relation since version 1.1) should be present in title or content or tag or category etc whatever options are selected.

    What does AND/OR do:- AND is WordPress default option and only OR is introduced by WPES.
    So when AND is selected both words should be there in taxonomy, title, content, author or whatever option is selected.

    For example searching BIKE SERVICES:- You have a post title containing “BIKE” and there is tag containing “SERVICES” then only this post will show up not those one that containing only tag “SERVICES” and title “BIKE”.
    And now you will get what does OR option do. It will show all of the posts.

    Why it is not working with tags/category
    In WordPress table each taxonomy terms has separate row so when we join the table each term has different row so it is not possible to get the results using both the keywords and AND operator that’s why I added OR option and this is from initial version.

    You can combine, title + content + excerpt + meta keys + taxonomies + authors.

    Hope this helps.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.