Title: Double search?
Last modified: August 2, 2017

---

# Double search?

 *  Resolved [pre20](https://wordpress.org/support/users/pre20/)
 * (@pre20)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/double-search/)
 * Hi,
 * Sorry for so many questions, I’ll try to explain well:
 * Let’s say I have a Title form field and a Description form.
    In Options I have
   selected in Quick Search Fields – Title and Description (both fields are Textfield),
   so when the search is done the system try to fin the word searched in both fields.
 * So, I go to the quick search and I write a word or words to search.
 * When I click on search, the system “opens” a new page and shows the advanced 
   search form and the results of the search.
 * Ok, everything ok but, now my question: in that advanced search form that is 
   opened, the word searched is repeated in the fields used by the quick search,
   Title and Description in that case.
    So if I want to use that advanced search
   form to continue searching, I have to delete the Description field word to search
   again.
 * This may seem not important, but if there are 10 fields and Title is the first
   and Description the last, when the search is donde and the advanced search is
   displayed, and I change the Title word to search and press Enter, the search 
   will show 0 results because the word I search first was repeated in the Title
   and Description so it searched both.
 * Example:
 * I write “Red Cars” on the quick search option (remember both Title and Description
   are selected in the Quick Search Fields)
    The system shows the advanced search
   with 5 listings as a result. In that page, I delete Red Cars and write Blue Cars
   and press enter. The system shows the advanced search with 0 listing as a result(
   but in fact exists 10 listings of Blue Cars) The reason: as I didn’t notice my
   quick search word was duplicated in Title and Description field, the systeam 
   searched Title: Red Cars and Description: Blue Cars, so obviously there are no
   results with that four words together.
 * I hope you understand my question.
 * So a solution I was thinking if it’s possible to the Quick Search word to be 
   saved only as a Title when the search is done, or at least not repeated in the
   other textfields that the quick search uses.
 * Thanks!
    -  This topic was modified 8 years, 9 months ago by [pre20](https://wordpress.org/support/users/pre20/).
    -  This topic was modified 8 years, 9 months ago by [pre20](https://wordpress.org/support/users/pre20/).
    -  This topic was modified 8 years, 9 months ago by [pre20](https://wordpress.org/support/users/pre20/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * (@businessdirectoryplugin)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/double-search/#post-9382407)
 * Hi [@pre20](https://wordpress.org/support/users/pre20/),
 * Sorry that you ran into issues here!
 * The way that Quick Search works, what you’re suggesting isn’t possible.
 * Say that you want Quick Search to search 9 fields: A-I. So when we create the
   WHERE clause, we have to do WHERE A like “*<whatever you typed>*” OR B like “*
   <whatever you typed>*” OR C like…
 * (you get the idea)
 * For each of those fields, once we return the results in order to show you WHAT
   we searched on, we populate ALL of the fields on the Advanced Search that we 
   used (A, B, C, D, etc). That’s why you see what you see.
 * However, if you click search again at that point, it switches from “OR” to “AND”
   and that’s definitely not obvious. We can work on making it more clear or looking
   at a different way to do that in the future. It’s not a quick fix though…and 
   we can’t “figure out” which fields matched without some serious post-processing.
 *  Thread Starter [pre20](https://wordpress.org/support/users/pre20/)
 * (@pre20)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/double-search/#post-9385989)
 * OK, I understand it.
 * So, to try to accomplish something similar in another way, is it possible this
   options?
 * – To automatically clear the fields when you click search.
    – To not show the
   advanced search when you click search (in the results). Instead a button like“
   New Search” that redirects to a search page.
 * And side question as you mentioned or/and: in the advanced search, is it possible
   to search “AND” in the same field? For example in a multiselect list or in the
   tags field to search two tags at same time so only show results if both are in
   the same listing. I’ve tried selecting two options in the multiselect or writing“
   tag & tag” but shows all results of each word not together.
 * Thanks for your help!
 *  Plugin Author [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * (@businessdirectoryplugin)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/double-search/#post-9398586)
 * Hi [@pre20](https://wordpress.org/support/users/pre20/),
 * Either of those options would be something that could be hacked into the plugin,
   but neither is supported out of the box today. That’s something we can consider
   for future development, but not something the plugin allows for now.
 * The first one would likely be confusing as most search forms retain their criteria
   between searches to allow you to refine it if you didn’t like what you got back.
   Clearing everything would likely make users unhappy.
 * When the users are searching from Advanced Search, the default use of the fields
   is “AND”‘d criteria. So if you entered a category and title to search the where
   would be:
 * WHERE category = “whatever” AND title like “other whatever”
 * The search behavior for multi-select fields should be doing internal ORs for 
   that criteria, like:
 * WHERE tag in (one, two, three, four)
 * If you are seeing otherwise, we’d need a specific search and some results that
   you’re getting back to understand the behavior better.
 * Please let me know.
 *  Thread Starter [pre20](https://wordpress.org/support/users/pre20/)
 * (@pre20)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/double-search/#post-9402382)
 * Ok, to solve the first “issue” I think I will offer only the advanced search 
   form so users must search for the specific field.
 * But the second “issue” could be important to improve user experience. Now we 
   are talking only about a field search in the advanced search (the quick search
   is OK), and I understand a multiselect could be a code topic but maybe a text
   field could be solved.
    If I search the tags “red car, blue bike” it shows a 
   listing that have “red boat, blue bike” tags listings
 * I downloaded some search plugins like Relevanssi and it have and option to select
   the default operator search (And or OR) and if AND finds no matches, it will 
   automatically does an OR search, so when I select And it works well (when I search
   the tags “red car, blue bike” it results only the posts that have both tags together
   on the same post) but it only works in post search, doesn’t work in the Directory
   Plugin search.
    -  This reply was modified 8 years, 9 months ago by [pre20](https://wordpress.org/support/users/pre20/).
 *  Plugin Author [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * (@businessdirectoryplugin)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/double-search/#post-9403152)
 * > I downloaded some search plugins like Relevanssi and it have and option to 
   > select the default operator search (And or OR) and if AND finds no matches,
   > it will automatically does an OR search, so when I select And it works well(
   > when I search the tags “red car, blue bike” it results only the posts that 
   > have both tags together on the same post) but it only works in post search,
   > doesn’t work in the Directory Plugin search.
 * I totally understand. At the moment, we don’t have a way to “switch” like that.
   Again, we will look to add that after our 5.0 release but we have a LOT of changes
   coming with that and we’re in the process of packaging them up so this will fall
   into the “post 5.0” releases at this point.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Double search?’ is closed to new replies.

 * ![](https://ps.w.org/business-directory-plugin/assets/icon-256x256.png?rev=2901888)
 * [Business Directory Plugin - Easy Listing Directories for WordPress](https://wordpress.org/plugins/business-directory-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/business-directory-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/business-directory-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/business-directory-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/business-directory-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/business-directory-plugin/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/double-search/#post-9403152)
 * Status: resolved