PassMark Logo
Home » Forum


No announcement yet.

Limit search to Custom Meta Search Fields

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?


  • #2
    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.

    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine


    • #3
      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.


      • #4
        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):
          	<p class="tab-heading">Search by Specialty:</p>
          	<select class="search-input-docs" id="select" name="SPECIALTY">
          	<option value=-1>All</option>
          	<option value=0>Addiction Medicine</option>
          	<option value=1>Anesthesiology</option>
          	<option value=2>Audiology</option>
          	<option value=3>Cardiology</option>
          	<option value=4>Cardiovascular Disease</option>
          	<option value=5>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:
          	<input type="hidden" name="zoom_query">
        Hope that helps.
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine


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