If you want to do so, you can change an existing search filter to meet your library needs. You can also create your own search filter. If you want to create your own search filter, you can do so by copying an existing one that closely matches your needs, and then by modifying the copied search filter.
If you want to change an existing search filter or create your own by copying an existing one, you may need some experience writing SQL queries, and have a good background with Horizon tables and SQL views.
To edit an existing search filter or create your own search filter
1 | Open the search_filter_query (Search Filter Queries) view in the Table Editor. |
Horizon displays the List Search Filters Queries window.
2 | Do one of these options: |
To do this |
Do this |
||||||
Change an existing search filter |
Choose the search filter that you want to change. Horizon displays the Edit Search Filters Queries window for that search filter. |
||||||
Create a search filter by copying another one |
Horizon displays a copy of the search filter in the Edit Search Filters Queries window. |
3 | Complete these fields, as necessary: |
Field |
Action |
|||||||||
Description |
Enter a descriptive name of the search filter. (For example, enter “POs created in 2000” for a search filter that sends back search results of purchase orders created 2000.) |
|||||||||
Enter the name of a table or SQL view. (For example, if you want to have Horizon return a search result set of purchase orders created in 2000, then Horizon would find this information from the “po_with_vendor” SQL view.) Horizon uses this table or SQL view as the database object against which Horizon uses the query string. If the existing table name or SQL view is not what you want, then open other existing search filters to find a suitable table name or SQL view. (For more information about Horizon tables and SQL views, see the Table Structures Guide.) Note: Horizon checks your database to be sure that the table of SQL view name you enter is valid. |
||||||||||
Mark this box if you want Horizon to use the search filter. You can have search filters on your Horizon system without enabling them for Horizon to use. If you are not ready now to use the search filter, you can enable it later. (For instructions, see Enabling or Disabling a Search Filter.) |
||||||||||
Do one of these options:
You can specify only one search filter to be first per table name. (For example, choose “Open POs” as the first search filter for the po_with_vendor table, “Open vendors” as the first search filter for the vendor_with_credit table, and so forth.) |
||||||||||
Enter a SQL query string segment that represents the logic of the search filter. This is a SQL query string that contains parameters to limit the search of the target table. If the existing SQL query string is not what you want, then open other existing search filters to find a suitable SQL query string that you can modify for your needs. For example, if you want Horizon to return a search result set of POs created in 2000, then you would copy and modify the “POs created in 2002” search filter’s query string to this: creation_date >= (datediff(day, “Jan 1 1970”, “Jan 1 2000”)) AND creation_date <= (datediff(day, “Jan 1 1970”, “Dec 31 2000”)) Note: Horizon checks to be sure that the query string that you enter is a valid SQL query. |
Here is how Horizon uses the table or SQL view name and the query string:
SELECT a list of columns FROM table or SQL view name WHERE search criteria produced by the search involved AND query string
From this depiction, you can see that Horizon must know the table or SQL view name before the searching even begins. This way, Horizon produces a search filter for that particular search. If you create a search filter by copying an existing one, you should not typically have a problem discovering the table or SQL view name, or modifying parts of an existing SQL query string.
4 | Save your changes. |
If you have an invalid Horizon table name or SQL view, or an invalid query string, Horizon does not let you save the search filter.
© 1998-2017 Sirsi Corporation