SearchBlox supports a wide array of search parameters. These parameters can be provided in the search API URL and in the faceted search parameters.

## **Facet Filter Request Parameters**

  • New search API and search servlet API support a list of facet filter parameters, these parameters are used in SearchBlox faceted search pages for facet filters and also can be used 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 and Search Servlet API:

**Sample New Search API URL with basic parameters**

http://localhost:8080/searchblox/rest/v2/api/search?pretty=true&col=1&query=*&facet.field=keywords&f.keywords.filter=africa

**Sample Search Servlet API URL with basic parameters**

http://localhost:8080/searchblox/servlet/SearchServlet?col=1&query=_&xsl=json&_&facet.field=keywords&f.keywords.filter=africa

ParameterDefault ValueRange of ValuesDescription
facetononEnable facets
facet.fieldNo default fieldAny standard or custom field including term, number or date fieldsProvides the ability to facet on any field
facet.field.filterNo default fieldPossible values of the meta field to be filteredThe facet value of the meta field that is used to filter the results
facet.field.notfilterNo default fieldPossible values of the meta field not to be filteredThe facet value of the meta field that is to be excluded in search results
f.{fieldname}.size101-1000Sets the number of values returned
f.{numericalFieldName}.rangeNo default fieldExamples of range [TO100000], [1000TO100000], [100TO]Sets of range of size for size field filtering
f.{numericalFieldName}.filterNo default fieldPossible values of size ranges (as in range above) to be filteredPossible size value to filter search results
f.{numericalFieldName}.range.notfilterNo default fieldPossible values of size ranges (as in range above) not to be filteredPossible size value to exclude in search results
f.{datefieldname}.rangeNo default fieldExamples of date ranges [*TO2012-02-28T00:00:26], [2010-02-28T00:00:26TO2012-02-28T00:00:26]Sets the range of dates for the date field filtering
f.{datefieldname}.intervalNo default fieldPossible values are minute, hour, day, week, month, quarter, yearSets the date histogram period for date field faceting
f.{datefieldname}.filterNo default fieldPossible values of date ranges (as in range above) to be filteredPossible date values to be filtered
f.{datefieldname}.range.notfilterNo default fieldPossible values of date ranges that is not to be filteredPossible date values to be excluded

## **Sample Search Query URLs with Parameters**

## **Filter parameter**

  • http://localhost:8080/searchblox/servlet/SearchServlet?query=news&filter=title:CNN

  • http://localhost:8080/searchblox/servlet/SearchServlet?query=news&filter=keywords:CNN

  • http://localhost:8080/searchblox/servlet/SearchServlet?query=news&filter=content:CNN

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=true&query=*&filter=title:(bbc%20OR%20Africa)&xsl=xml

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=true&query=*&filter=title:(bbc%20AND%20Africa)&xsl=xml

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=true&query=_&filter=title:(bbc%20NOT%20Africa)&xsl=xml http://localhost:8080/searchblox/servlet/SearchServlet?query=_&filter=NOT(contenttype:word)

## **Default Boolean operator**

  • search for `world OR news` http://localhost:8080/searchblox/servlet/SearchServlet?query=world news

  • search for `world AND news` http://localhost:8080/searchblox/servlet/SearchServlet?query=world news&default=AND

## **Facet Filters**

### Single Facet

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=on&xsl=xml&query=time&facet.field=keywords

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=on&xsl=xml&query=time&facet.field=keywords&f.keywords.filter=cnn

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=on&xsl=xml&query=time&facet.field=keywords&f.keywords.size=100&f.keywords.filter=cnn

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=on&xsl=xml&query=*&facet.field=keywords&f.keywords.size=100&f.keywords.notfilter=world

  • http://localhost:8080/searchblox/servlet/SearchServlet?facet=on&xsl=json&query=*&facet.field=colname&f.colname.notfilter=test

### Multiple Facets

  • http://localhost:8080/searchblox/servlet/SearchServlet?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

  • http://localhost:8080/searchblox/servlet/SearchServlet?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]

  • http://localhost:8080/searchblox/servlet/SearchServlet?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"/>`

  • http://localhost:8080/searchblox/servlet/SearchServlet?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&xsl=xml

**Pre-defined Date Facet**

  • http://localhost:8080/searchblox/servlet/SearchServlet?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&xsl=xml

  • http://localhost:8088/searchblox/servlet/SearchServlet?facet=on&sort=lastmodified&sortdir=des&query=*&facet.field=lastmodified&f.lastmodified.range.notfilter=[2012-06-20TO2015-10-22]&page=1&pagesize=100&xsl=xml

General Information

  • Facet filters display results count JSON/XML.

  • 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 or XML in a parametrized search to view the relevant response.* When using Advanced Search use parameters specific to the same.