1

According to the documentation here: https://solspace.com/docs/super_search/search_syntax/#custom_fields

I should be able to pass values from multiple custom fields into my search query. For example, I want to pass the following:

doctors_services-exact=Surgery&doctors_locations-exact=My%20Medical%Center

These custom fields are relationship fields, where I'm trying to filter on the exact title of each relationship. So, I have a service named "Surgery" and a location named "My Medical Center". Trying each one of these individually works - I get the expected results.

Both of these queries work:

doctors_services-exact=Surgery

OR

doctors_locations-exact=My%20Medical%Center

But in combination, it does not work. Any help on this would be great!

UPDATE:

I'm using SuperSearch 2.2.3 and EE 2.10.1. I'm trying to pass two values in the search string - these are the only two search criteria I'm passing - there are no keywords or any other parameters.

This search string is intended to find all doctors with a relationship to a "Generic Hospital Name". It works correctly - the search results show only doctors with a relationship to "Generic Hospital Name":

search&channel=doctors&doctors_locations-exact=Generic%Hospital%Name

This search string is intended to find all doctors with a relationship to "Primary Care". It works correctly - the search results show only doctors with a relationship to "Primary Care":

search&channel=doctors&doctors_services-exact=Primary%20Care

I need to combine these in the event that someone needs to find a doctor specializing in "Primary Care" at "Generic Hospital Name". So, this is my search string for that:

search&channel=doctors&doctors_services-exact=Primary%20Care&doctors_locations-exact=Generic%20Hospital%20Name

This does not work. I get ALL doctors who work at "Generic Hospital Name", however, they are NOT ALL "Primary Care" doctors.

If I remove exact on doctors_services like this:

search&channel=doctors&doctors_services=Primary%20Care&doctors_locations-exact=Generic%20Hospital%20Name

The results for this returns a mixed bag of doctors. The -exact on doctors_locations doesn't limit the doctors from "Generic Hospital Name" nor does it return accurate results for doctors_services. I'd expect to see doctors with services that include the words "Primary" or "Care", but the first doctor in the list specializes in "Lung Transplants" and "Abdominal Surgery".

If I remove -exact from doctors_locations like this:

search&channel=doctors&doctors_services-exact=Primary%20Care&doctors_locations=Generic%20Hospital%20Name

I also get a mixed bag of the results that does not seem to obey either doctors_services or doctors_locations.

Removing exact from both doctors_services and doctors_locations does not produce a comprehensible list of search results either.

So I can pass -exact on doctors_locations OR doctors_services just as long as they do not exist in the same query. doctors_locations-exact works by itself, doctors_services-exact works by itself, but not together.

3
  • What version of Super Search are you using? (please provide a version number) Are those two search criteria the only criteria in your search? Is there a difference if the search is not an -exact search? When you mention that it doesn't work, do you mean you get no results, or that you get results from doctor_services OR doctors_locations instead of doctor_services AND doctors_locations? If the latter, "OR" searching is the current known behavior for searching 2 relationship fields?
    – Solspace
    Jun 12, 2015 at 7:45
  • If "OR" searching is the current known behavior for searching 2 relationship fields, is there a way to make it "AND" searching? I need the same functionality we have with categories where I can pass a double ampersand "&&" Jun 12, 2015 at 15:40
  • I'd second the question if there is a way to make custom fields be "and" instead of "or" so adding additional custom fields narrows down/filters the results.
    – Blair
    Aug 1, 2015 at 5:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.