Search form code is provided that you can copy and paste into the HTML of your site ( Design > Auto-Complete > Form Source).
See Copying the HTML code of the search form into the….
You can also set the parameters that are listed either in the search form itself, or from a script. In addition to the parameters that are listed below you can also use the backend search parameters to control search.
See Backend search CGI parameters.
Search requests consist of a base URL. The base URL indicates what account the customer is searching, and a set of CGI parameters (key-value pairs) that indicate how to return the desired search results for the associated account.
The base URL is associated with a specific account and a staged or live environment. You can request multiple aliases for the base URL from your account manager. For example, a company called Megacorp may have two base URLs associated with their account: https://search.megacorp.com
and https://stage.megacorp.com
. The former URL searches their live index and the latter URL searches their staged index.
Three formats of CGI Parameters are supported. By default your account is configured to separate CGI Parameters with a semi-colon as in the following example:
https://search.megacorp.com?q=shoes;page=2
If you prefer, you can have your account manager configure your account to use ampersands to separate the CGI parameters as in the following example:
https://search.megacorp.com?q=shoes&page=2
A third format, called the SEO format, is also supported where a forward slash /
is used in place of the separator and equal sign as in the following example:
https://search.megacorp.com/q/shoes/page/2
Any time the SEO format is used to send a request, all output links are returned in the same format.
Guided Search parameter | Example | Description |
---|---|---|
q | q=string |
Specifies the query string for the search. This parameter maps to the sp_q backend search parameter. See Backend search CGI parameters. |
q# | q#=string |
Faceting (searching within a given field) is done by way of numbered q and x parameters. The q parameter defines the term you are searching for in the facet as denoted by the corresponding numbered x parameter. For example, if you have two facets that are named size and color, you can have something like q1=small;x1=size;q2=red;x2=color. This parameter maps to the sp_q_exact_# backend search parameters. See Backend search CGI parameters. |
x# | q#=string |
Faceting (searching within a given field) is done by way of numbered q and x parameters. The q parameter defines the term you are searching for in the facet as denoted by the corresponding numbered x parameter. For example, if you have two facets that are named size and color, you can have something like q1=small;x1=size;q2=red;x2=color. This parameter maps to the sp_x_# backend search parameters. See Backend search CGI parameters. |
collection | collection=string |
Specifies the collection to use for the search. This parameter maps to the sp_k backend search parameter. See Backend search CGI parameters. |
count | count=number |
Specifies the total count of results that are shown. The default is defined in Settings > Searching > Searches . . This parameter maps to the sp_c backend search parameter. See Backend search CGI parameters. |
page | page=number |
Specifies the page of results that are returned. |
rank | rank=field |
Specifies the rank field to use for static ranking. The field must be a field of type Rank with relevance greater than 0. This parameter maps to the sp_sr backend parameter. See Backend search CGI parameters. |
sort | sort=number |
Specifies the sort order. “0” is the default and sorts by relevance score; “1” sorts by date; “-1” does not sort. Users can specify a field name for the value of the sp_s parameter. For example, sp_s=title sorts results according to the values that are contained in the title field. When a field name is used for the value of an sp_s parameter, results are sorted by that field and then sub-sorted by relevance. To enable this feature, click Settings > Metadata > Definitions . On the Definitions page, click Add New Field or click Edit for a particular field name. In the Sorting drop-down list, select either Ascending or Descending . This parameter maps to the sp_s backend search parameter. See [Backend search CGI parameters].(/docs/search-promote/using/appendices/c-cgiparameters.html?lang=en#reference_582E85C3886740C98FE88CA9DF7918E8). |
Typically customers interact with a presentation layer called Guided Search. However, it is theoretically possible to skip the Guided Search layer and interact with the backend core search directly using the CGI parameters that are described on this page.
You can select backend search CGI parameters from the following table:
Single query support |
Multiple query support |
Examples |
Description |
|
---|---|---|---|---|
1 |
sp_a |
|
|
Specifies the account number string. This parameter is required, and must be a valid account number string. You can find your account number string under Settings > Account Options > Account Settings . |
2 |
sp_advanced |
|
|
If |
3 |
sp_c |
|
|
Specifies the total count of results to show. The default is 10. |
4 |
sp_context_field |
|
|
Collects contextual information for the given field. Collected information is output in the search results by way of the |
5 |
sp_d |
|
|
Specifies the type of date range searching to perform. Possible values for type are any, which means do not perform date range searching, custom, which indicates that the value of |
6 |
|
sp_d_# |
|
Specifies the type of date range searching to perform for the corresponding You can set |
7 |
sp_date_range |
|
|
Specifies a pre-defined date range to apply to the search. Values greater than or equal to zero specify the number of days to search prior to today — for example, a value of "0" specifies "today," a value of "1" specifies "today and yesterday," a value of "30" specifies "within the last 30 days," and so forth. Values below zero specify a custom range as follows: -1 = "None," the same as specifying no date range. -2 = "This week," which searches from Sunday to Saturday of the current week. -3 = "Last week," which searches from Sunday to Saturday of the week prior to the current week. -4 = "This month," which searches dates within the current month. -5 = "Last month," which searches dates within the month prior to the current month. -6 = "This year," which searches dates within the current year. -7 = "Last year," which searches dates within the year prior to the current year. |
8 |
|
sp_date_range_# |
|
Specifies a pre-defined date range to apply to the corresponding Values greater than or equal to zero specify the number of days to search prior to today. For example, a value of 0 specifies today; a value of 1 specifies today and yesterday; a value of 30 specifies within the last 30 days, and so forth. Values below zero specify a custom range as follows: -1 = "None," the same as specifying no date range. -2 = "This week," which searches from Sunday to Saturday of the current week. -3 = "Last week," which searches from Sunday to Saturday of the week prior to the current week. -4 = "This month," which searches dates within the current month. -5 = "Last month," which searches dates within the month prior to the current month. -6 = "This year," which searches dates within the current year. -7 = "Last year," which searches dates within the year prior to the current year. |
9 |
sp_dedupe_field |
|
|
Specifies a single field to dedupe search results on. All duplicate results on that field are removed from the search results. For example, if for |
10 |
sp_e |
|
|
Specifies that automatic wildcard expansion should take place for any word from the query string with more than number characters. In other words, |
11 |
|
sp_e_# |
|
Specifies that automatic wildcard expansion takes place for any word from the corresponding |
12 |
sp_end_day, sp_end_month, sp_end_year |
|
|
This triplet of values specifies the end date range for the search and must be provided as a set. |
13 |
sp_f |
|
|
Specifies the character set of the query parameter strings (such as |
14 |
sp_field_table |
|
|
Defines a logical data table consisting of the given fields. For example, a table named "items" consisting of the fields "color," "size," and "price" would be defined as the following: Logical tables are most useful in conjunction with fields that have "Allow Lists" checked (under Settings > Metadata > Definitions ). All CGI parameters and template tags that take a field name as a value may optionally specify a table name followed by a "." prior to the field name (for example, For example, to perform a search for documents that contain one or more "red" items in size "large" (where items are represented as parallel rows of metadata), you could use the following: |
15 |
sp_i |
|
|
Ignores the search when you generate reports. Use this query to mask certain backend searches, such as searches that Did You Mean generates, or searches that an Administrator generates in the member center. Because an end user does not generate these types of searches, they do not show up in various Adobe Search&Promote reports. Valid values are |
16 |
sp_k |
|
|
Specifies the collection to use for the search. The default is no collection, meaning that the search should include the whole site. |
17 |
sp_l |
|
|
Specifies the language of the query parameter strings (such as |
18 |
sp_literal |
|
|
Setting Note that See About Dictionaries . |
19 |
sp_m |
|
|
Specifies whether summaries are displayed. 1 is yes, 0 is no. The default is 1. |
20 |
sp_n |
|
|
Specifies the number of the result that starts the search results. The default is 1. |
21 |
sp_not_found_page |
|
|
Specifies whether to redirect to the specified URL if there are no search results. |
22 |
sp_p |
|
|
Specifies the default type of searching to perform. The use of For See the Search Tips description for more information about using plus ("+") and minus ("-") in searches. See About Searches . See the sample advanced search form for examples on using the |
23 |
|
sp_p_# |
|
Specifies the default type of searching to be performed with the corresponding If you specify either |
24 |
sp_pt |
|
|
Specifies the type of target matching to apply. The use of |
25 |
|
sp_pt_# |
|
Specifies the type of target matching to apply with the corresponding |
26 |
sp_q |
|
|
Specifies the query string for the search. An empty string leads to no results being shown. |
27 |
|
sp_q_# |
|
This parameter allows for the creation of multiple queries on search forms. The For example, submitting the following form returns all documents that contain the words "great" and "books". |
28 |
sp_q_day, sp_q_month, sp_q_year |
sp_q _day_#, sp_q _month_#, sp_q _year_# |
|
These parameters are used to specify an exact date for a particular query. The The The following section of code lets a user to search for the word "orange" in documents dated "Jan. 1st, 2000" in a user-defined field named |
29 |
sp_q_location |
sp_q_location_# |
|
These parameters associate a location with the main or numbered query. The use of A value in the form DDD (three digits) is interpreted as a US telephone areacode; a value in the form DDDDD or DDDDD-DDDD is interpreted as a US zipcode; and a value in the form ±DD.DDDD±DDD.DDDD is interpreted as a latitude/longitude pair. The signs are required for each value. For example, +38.6317+120.5509 specifies latitude 38.6317, longitude 120.5509. See About proximity search . |
30 |
sp_q_max_relevant_distance |
sp_q_max _relevant _distance _# |
|
These parameters control the relevance calculation applied to proximity searches. The use of The default value of A perfect relevance score for the proximity component would represent a distance of 0. A minimum relevance score for the proximity component would represent a distance just over the specified See About proximity search . |
31 |
sp_q_min_day, sp_q_min_month, sp_q_min_year sp_q_max_day, sp_q_max_month, sp_q_max_year |
sp_q_min_day_#, sp_q_min_month_#, sp_q_min_year_# sp_q_max_day_#, sp_q_max_month_#, sp_q_max_year_# |
|
These parameters are used to set minimum and maximum date ranges for a particular query. The The It is legal to specify only a minimum date, only a maximum date, or both minimum and maximum date. However, for a given minimum or maximum set, all three date parameters must be specified (day, month and year). By default, all dates are searched relative to Greenwich Mean Time. The following section of code lets a user search for the word "orange" in documents with a date between Jan. 1st, 2000 and Dec. 31st, 2000 in a user-defined field named |
32 |
sp_q_min, sp_q_max |
sp_q _min_#, sp_q _max_#, sp_q _exact_# |
|
These parameters specify a minimum (and/or maximum) value to apply to the main or numbered query. The use of Replace The use of The |
33 |
sp_q_nocp |
sp_q _nocp _# |
|
The default parameter value is When set to Using
|
34 |
sp_q_required |
sp_q _required _# |
|
This parameter determines whether a match must (1), may (0), or must not (-1) occur in the corresponding query in order for a document to be returned on the result page. The use of To apply to a numbered query, replace the To search for documents that contain the word "calc" but do NOT contain "mac", "win" or "all" in the user-defined "platform" field, your HTML search form could contain the following lines: |
35 |
sp_redirect_ if_one_result |
|
|
Specifies whether to redirect to the search result URL if there is only one search result. |
36 |
sp_referrer |
|
|
Specifies the referrer URL for the search. Useful for search rewrite rules where the search results link back to the same site as the search form. The default value is the standard CGI HTTP_REFERRER value delivered by the browser. |
37 |
sp_ro |
|
|
Allows optional search time, per field name, relevance control. The For example, to set the relevance value for the field name "body" to 10, at the time a customer performs a search, the parameter would appears as follows: Or, to specify multiple field relevance overrides in the parameter string, you can use a pipe delimiter. For example, to set the relevance value for the field names "body" and "title" to 9, at the time a customer performs a search, the parameter would appear as follows:
Note: Specifying a field that is not involved in the associated search has no effect. For example, if you set |
38 |
sp_s |
|
|
Specifies the sort order. Zero (0) is the default and means to sort by relevance score. One (1) means to sort by date and -1 means to not sort. You can specify a field name for the value of the Set Sorting for the referenced field to either Ascending or Descending in Settings > Metadata > Definitions to enable this feature. You can also assign several sort fields to a single query by setting the It is also possible to sort on table matched field data by specifying a table name qualifier prior to the field name, for example, items.price. See the If searching by proximity, you may sort results according to proximity by specifying a "proximity output field". See About proximity search . |
39 |
sp_sr |
|
|
Specifies the rank field to use for static ranking. The field must be a field of type Rank with relevance greater than 0. If no To disable static ranking for a particular query, include a NULL value for |
40 |
sp_sfvl_field |
|
|
Specifies the name of a field to use in conjunction with the You can specify multiple |
41 |
sp_sfvl_df_count |
|
|
Requests up to The default value is 0. The maximum allowed value is the current number of dynamic-facet fields, dynamic-facet-field-count defined for a given index. Integer values that are below 0 are treated as 0. Integer values specified above A given slice's search is capped with a maximum allowed |
42 |
sp_sfvl_df_exclude |
|
|
Specifies a list of specific dynamic facet fields to exclude from consideration for this search. By default, all dynamic facet fields are considered. |
43 |
sp_sfvl_df_include |
|
|
Specifies a list of specific dynamic facet fields to include in the search results.
Note: The |
44 |
sp_staged |
|
|
If A staged search uses all the components that are currently staged including the index and templates. |
45 |
sp_start_day, sp_start_month, sp_start_year |
|
|
This triplet of values specifies the starting date range for the search and you provide it as a set. |
46 |
|
sp_ suggest _q |
|
The The default value of Set |
47 |
sp_t |
|
|
Specifies the transport template to use. This parameter is useful if you want to control the appearance of core search results across your website by using different search transport templates for each area in your Search account. The default transport template is "search". See Managing multiple transport templates for your website . |
48 |
sp_trace |
|
|
When set as See About Simulator .
Note: If this parameter is not specified, core search does not gather the tracing information and the related core search template tags have no output. |
49 |
sp_w, sp_w_control |
|
|
Specifies that sound-alike matching should be enabled or disabled for this particular query. The sp_w_control for `Exact` is Ignored. Sound-alike matching is Disabled. The sp_w_control for `Alike` is Ignored. Sound-alike matching is Enabled The sp_w_control for Anything else is 1. Sound-alike matching is Disabled. The sp_w_control for Anything else is anything else. Sound-alike matching is Enabled. Thesp_w_control parameter lets you create a negatively or positively worded checkbox for end-user control of sound-alike matching. If If See the sample advanced search form for more examples on using |
50 |
sp_x |
|
|
Specifies the fields to search for the query string. any means search all fields. title means search only title fields. desc means search only document description fields. keys means search only document keywords. body means search only body text. alt means search only alternate text. url means search only the URL values. target means search only target keywords. In any of these cases, user specification of "text:", "desc:", "keys:", "body:", "alt:", "url:", and "target:" field prefixes within the corresponding See About Searches . See the sample Advanced Search Form description for examples using the See Sample advanced search form . You can create queries that search all fields set to Search By Default under Options > Metadata > Definitions by setting You can also assign several fields to a single query by setting the |
51 |
|
sp_x_# |
|
This parameter specifies which field to search in the corresponding If no For example, submitting the following form returns all documents that contain the word "great" that also contain the word "Fitzgerald" in the "author" field: You can associate multiple field names with a particular query or numbered query by providing more than one instance of the same For example, to search for the word "flower" within both the "body" and "keys" fields, you could create a search form with the following information: |
The following link queries start a search using “Music” as the search query, and uses all the default parameters. Note that the URL is split across two lines for readability. In your HTML, this link should all be on one line.
<a href="https://search.atomz.com/search/?sp_q=Music&sp_a=sp99999999">
Testing...</a>
The same functionality is more typically defined with a form:
<form action="https://search.atomz.com/search/">
<input size=12 name="sp_q" value="Music"><br>
<input type=hidden name="sp_a" value="sp99999999">
<input type=submit value="Search"><br>
</form>
You should typically use default parameters when initiating a search. That way, the first page is shown, sorted by relevance, and allows the customer to choose other pages and other options. If the search form on your site includes options for collections, pass in the collection name as a parameter.
The following form queries display 25
results starting at result 10
. Summaries are not shown, the sort order is by date, and the collection named support
is used. Only documents dated within the last 30 days are returned.
<form action="https://search.atomz.com/search/">
<input size=12 name="sp_q"><br>
<input type=hidden name="sp_a" value="sp99999999">
<input type=submit value="Search"><br>
<input type=hidden name=sp_n value=10>
<input type=hidden name=sp_c value=25>
<input type=hidden name=sp_m value=0>
<input type=hidden name=sp_s value=1>
<input type=hidden name=sp_k value="support">
<input type=hidden name=sp_date_range value=30>
</form>