PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Limit search to Custom Meta Search Fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • lajones3
    replied
    Thanks, I got it working. Is there a way to order the search results alphabetically?

    Leave a comment:


  • Ray
    replied
    There's a number of problems with your search form.
    1. The select field dropdown on that page has a name="zoom_query" attribute which means it is currently selecting the value for your general search term, not your meta field.
    2. If you have selected "Dropdown text" as the Custom Meta Field Type in your Zoom configuration, then the search form dropdown text will need to have matching numeric values based on the order of the drop downs specified.

      For example, it would look something like this (changes in bold):
      Code:
      	<p class="tab-heading">Search by Specialty:</p>
      	<select class="search-input-docs" id="select" name="[B]SPECIALTY[/B]">
      	[b]<option value=-1>All</option>[/b]
      	<option [B]value=0[/B]>Addiction Medicine</option>
      	<option [B]value=1[/B]>Anesthesiology</option>
      	<option [B]value=2[/B]>Audiology</option>
      	<option [B]value=3[/B]>Cardiology</option>
      	<option [B]value=4[/B]>Cardiovascular Disease</option>
      	<option [B]value=5[/B]>Critical Care Medicine</option>
      	... etc.
      (you can include or exclude the "All" option as you see fit)

      The easiest way to acquire this list is to actually have the Search Form enabled in Zoom (under "Configure"->"Search Page"->Change Search Form dropdown from "Do not generate" to "Advanced"), reindex, open the search.php page in your browser, right click and "View Source" then copy the HTML for the dropdowns.

      Alternatively, you don't create your own search form at all, and use the generated search form on the search page and simply use CSS to hide the other controls you don't want (with the "display: none;" style)
    3. Lastly, you need an empty search query to be passed on to the search script. This can be done by having a hidden input tag like:
      Code:
      	<input type="hidden" name="zoom_query">
    Hope that helps.

    Leave a comment:


  • lajones3
    replied
    We have this test page with just a select field. It still returning results for the search terms if they are in the body of the page, not just the meta tag.
    https://www.citizensmemorial.com/sea...ndex-test.html

    Leave a comment:


  • Ray
    replied
    If you simply hide or omit the search box (zoom_query) text field then any search query with the meta field specified would be limited to that only.

    You can do that with CSS or if you're already custom defining your search form, just omit the input text field.

    Leave a comment:


  • lajones3
    started a topic Limit search to Custom Meta Search Fields

    Limit search to Custom Meta Search Fields

    We have a custom meta search field setup. Then we created a custom drop down on a search page.

    Is there a way to limit the search, so that it only looks to the custom meta search field and not any of the other page content?

    Thanks,
    Lauren
Working...
X