Skip to main content

Content Search

Search Settings

Setting default settings

Page size

By default the page size for returned results is 25.  To override this, add the following to the web config:

(code)

Use fuzzy search

To use a fuzzy search by default (i.e. a similar terms search) add the following to the web config.  Note that fuzzy search returns more results which by definition is less refined.

(code)

Get Fuzzy Search count pre-searching

If fuzzy search is off and you want to find out how results a fuzzy version of the current search would return, then add the following to the web config.  Note that this actually performs the fuzzy search, so you are searching twice, but the outlay is fairly lightweight.

(code)

Sorting searches

You can specify the sorted order of the searches by one field at the moment, e.g.

(code)

The parameters are as follows:

  • sortCol – the name of the field to sort on.  Note that the field must have been indexed as sortable=”true” (see also “Making the meta tag sortable”)
  • sortColType (optional) – this is only required for fields that have been indexed as “float” (see also “Indexing numbers and dates”)
  • sortDir (optional) – if specified as “desc” then the order of the sort is reversed.
  • sortOverrideEWPrefixes (optional) – expert use only.  By default eonicsearch adds prefixes to field names that are specified as sortable.  If you want to sort by a field that was not indexed as sortable and is not tokenized then you can by setting this to “true”.

If sortCol is not specified then results are returned sorted by relevance.  This order is not reversible.

Searching for ranges

To search for ranges use the following:

(code)

The parameters are as follows:

  • sf-name-? - the name of the field to search
  • sf-type-? (optional) – the type of field, if it’s numeric then use “float” otherwise a string search will be performed
  • sf-min-? (optional for numeric, required for string) – the lower bound of the range.
  • sf-max-? (optional for numeric, required for string) – the upper bound of the range

 

Search return values

An index search returns a Content node as follows:

(code)

The parameters returned are as follows:

  • fuzzy – was this a fuzzy search?
  • fuzzyCount – number of results would be returned if this had been a fuzzy search
  • pageStart –the index of the first item returned to the pagexml
  • pageCount – number of items are being returned per page
  • pageEnd - the index of the last item returned to the page xml
  • Time – time in milliseconds that the actual search took
  • SearchString – the string searched for
  • searchType – the type of search performed
  • type – SearchHeader is the content type for this information
  • Hits – total number of results found by this search.

 

Search activity tracking

To log search activity add the following to the web config.

(code)

The text of the search, and the number of results returned at the time will be added to the Activity Log table.