Search Parameters
SearchBlox supports a wide range of search parameters, which can be used in the search API URL or directly on the search page.
Facet Filter Request Parameters
The new search API supports facet filter parameters. These are used on faceted search pages and can also be applied in customized searches.
- To learn more on faceted search filter read: Facets Set up
Sample Search URLs with Facet Search Parameters
Sample search URLs with parameters for New Search API:
Sample New Search API URL with basic parameters
https://localhost:8443/rest/v2/api/search?pretty=true&col=1&query=*&facet.field=keywords&f.keywords.filter=africa
| Parameter | Default Value | Range of Values | Description |
|---|---|---|---|
| facet | on | on | Enable facets |
| facet.field | No default field | Any standard or custom field including term, number or date fields | Facet on any field |
| f.field.filter | No default field | Possible values of the meta field | Include only these values in search results |
| f.field.notfilter | No default field | Possible values of the meta field | Exclude these values from search results |
| f.{fieldname}.size | 10 | 1-1000 | Number of facet values to return |
| f.{numericalFieldName}.range | No default field | Examples of range [TO100000], [1000TO100000], [100TO] | Range of numerical field for filtering |
| f.{numericalFieldName}.filter | No default field | Possible numerical values in range | Include only these numerical values |
| f.{numericalFieldName}.range.notfilter | No default field | Possible numerical values in range | Exclude these numerical values |
| f.{datefieldname}.range | No default field | Examples: [*TO2012-02-28T00:00:26], [2010-02-28T00:00:26TO2012-02-28T00:00:26] | Range of dates for date field filtering |
| f.{datefieldname}.interval | No default field | minute, hour, day, week, month, quarter, year | Set the histogram period for date field faceting |
| f.{datefieldname}.filter | No default field | Possible date ranges | Include only these date values |
| f.{datefieldname}.range.notfilter | No default field | Possible date ranges | Exclude these date values |
Sample Search Query URLs with Parameters
Filter parameter
- https://localhost:8443/rest/v2/api/search?query=news&filter=title:CNN
- https://localhost:8443/rest/v2/api/search?query=news&filter=keywords:CNN
- https://localhost:8443/rest/v2/api/search?query=news&filter=content:CNN
- https://localhost:8443/rest/v2/api/search?facet=true&query=*&filter=title:(bbc%20OR%20Africa)
- https://localhost:8443/rest/v2/api/search?facet=true&query=*&filter=title:(bbc%20AND%20Africa)
- https://localhost:8443/rest/v2/api/search?facet=true&query=*&filter=title:(bbc%20NOT%20Africa)
- https://localhost:8443/rest/v2/api/search?query=*&filter=NOT(contenttype:word)
Default Boolean operator
- search for
world OR news
https://localhost:8443/rest/v2/api/search?query=world news - search for
world AND news
https://localhost:8443/rest/v2/api/search?query=world news&default=AND
Facet Filters
Single Facet
- https://localhost:8443/rest/v2/api/search?facet=on&query=time&facet.field=keywords
- https://localhost:8443/rest/v2/api/search?facet=on&query=time&facet.field=keywords&f.keywords.filter=cnn
- https://localhost:8443/rest/v2/api/search?facet=on&query=time&facet.field=keywords&f.keywords.size=100&f.keywords.filter=cnn
- https://localhost:8443/rest/v2/api/search?facet=on&query=*&facet.field=keywords&f.keywords.size=100&f.keywords.notfilter=world
- https://localhost:8443/rest/v2/api/search?facet=on&xsl=json&query=*&facet.field=colname&f.colname.notfilter=test
Multiple Facets
- https://localhost:8443/rest/v2/api/search?facet=on&query=news&facet.field=title&facet.field=keywords&f.keywords.size=5&f.title.size=15&f.keywords.filter=cnn&f.title.filter=world
- https://localhost:8443/rest/v2/api/search?facet=on&query=news&facet.field=keywords&f.keywords.size=5&f.keywords.filter=cnn&facet.field=size&f.size.range=[*TO100000]&&f.size.range=[100001TO*]&facet.field=indexdate&f.indexdate.range=[*TO2013-07-28T00:00:26]
- https://localhost:8443/rest/v2/api/search?facet=on&query=news&facet.field=title&facet.field=keywords&f.keywords.size=5&f.title.size=15&f.keywords.notfilter=cnn&f.title.notfilter=world
Date Facets
Customized Date Facet
- date format to be given in html file
<meta name="published" content="2015-03-17T01:50:58"/> - https://localhost:8443/rest/v2/api/search?facet=on&sort=published&sortdir=desc&query=*&facet.field=published&f.published.range=[2013-05-18T01:50:58TO2013-12-17T01:50:58]&f.published.filter=[2013-05-18T01:50:58TO2013-12-17T01:50:58]&page=1&pagesize=60
Pre-defined Date Facet
- https://localhost:8443/rest/v2/api/search?facet=on&sort=lastmodified&sortdir=des&col=1&col=3&col=2&query=*&facet.field=lastmodified&f.lastmodified.range=[2012-06-20TO2013-10-22]&f.lastmodified.filter=[2012-06-20TO2013-10-25]&page=1&pagesize=100
- https://localhost:8443/rest/v2/api/search?facet=on&sort=lastmodified&sortdir=des&query=*&facet.field=lastmodified&f.lastmodified.range.notfilter=[2012-06-20TO2015-10-22]&page=1&pagesize=100
General Information
- Facet filters are AND filters.
- Normal Filters can be used with AND as well as OR.
- Facet filters can only be given in URL.
- Filters can be given as a URL parameter or as fielded search.
- Use default=AND to enable AND search.
- View results in JSON using &debug=true
Updated about 1 month ago
