E-mail Search

Email Search is one of the faceted search interfaces in SearchBlox v12.
It is used to search email archives that have been indexed using an Email Collection.

To open the Email plugin, use this link in your build:
https://localhost:8443/email/index.html

Prerequisite

Please create an Email collection and then index the PST files.

Features of Email Plugin

  • You can search all emails by just typing your search terms.
  • You can also use faceted search with filters like From, To, Subject, and Date range.
  • All different fields are combined using AND, and if you enter multiple values in the same field, they are searched using OR.

Steps to use Email Plugin

Fields in facets.js

The content of facet.js are as shown:

window.facets = {
    "facets": [{
            "field": "colname",
            "display": "Collection Name",
            "size": "10"
        },
        {
            "field": "contenttype",
            "display": "File Type",
            "size": "10"
        },
        {
            "field": "keywords",
            "display": "keywords",
            "size": "10"
        },
        {
            "field": "lastmodified",
            "display": "Last Modified",
            "dateRange": [{
                    "name": "Last 24 hours",
                    "calendar": "days",
                    "value": "1"
                },
                {
                    "name": "Past Week",
                    "calendar": "days",
                    "value": "7"
                },
                {
                    "name": "Past Month",
                    "calendar": "months",
                    "value": "1"
                },
                {
                    "name": "Past Year",
                    "calendar": "years",
                    "value": "1"
                }
            ]
        }
    ],
    "collection": [],
    "sortBtns": [{
            "field": "lastmodified",
            "display": "Sort by date"
        },
        {
            "field": "relevance",
            "display": "Sort by relevance"
        }
    ],
    "facetFiltersOrder": [
      "colname","keywords"
    ],
    "facetFiltersType": "AND",
    "sortDir": "desc",
    "matchAny": "off",
    "pageSize": "10",
    "showAutoSuggest": "true",
    "defaultCname": "",
    "adsDisplay": "true",
    "featuredResultsCount": "3",
    "predictSearch": "false",
    "predictResultSize": "3",
    "customDateDisplayText":"Custom",
    "customDateEnable":"true",
    "relatedQuery": true,
    "relatedQueryFields": {
        "apikey": "",
        "field": "content",
        "operator": "and",
        "limit": "5",
        "terms": "10",
        "type": "phrase",
        "col": ""
    },
    "dataToBeDisplayed": {
        "1": {
            "title": "Title",
            "description": "Description"
        },
        "other": {
            "description": "Description"
        },
        "displayAll": true
    },
    "tune": {
        "enable": "true",
        "tune.0": "5",
        "tune.1": "3",
        "tune.2": "2",
        "tune.3": "5",
        "tune.4": "180",
        "tune.5": "10"
    },
    "defaultType": "",
    "pluginDomain": ""
};
  • If you want to use a meta field as a facet, you must add it in mapping.json. For CSV, database, MongoDB, and AWS collections, you must update the correct file: csv.json, jdbc.json, mongodb.json, or amazonS3.json, all located in ../webapps/ROOT/WEB-INF/.
  • If you want to add a number or date field as a facet, update it in mapping.json for web and file collections. For CSV, database, MongoDB, and AWS collections, update the same files: csv.json, jdbc.json, mongodb.json, and amazonS3.json in ../webapps/ROOT/WEB-INF/. ref: Custom Fields in Search

The description of the fields in the preceding js file is provided in the following table:

FieldDescription
facetsFacets don’t work in tabbed search, so changing this won’t have any effect.
collectionPick which collection numbers to use. You can add more than one by separating them with commas.
SortBtnsAdd the “Sort By” options for sorting the results.
facetFiltersOrderDecide the order in which the facet filters are shown.
sortDirChoose the sort direction: ascending or descending.
pageSizeSet how many results should appear on each page.
showAutoSuggestTurn the AutoSuggest feature on or off.
defaultCnameChoose the default collection to search first.
adsDisplayTurn featured results (ads) on or off.
featuredResultsCountSet how many featured results to show.
predictSearchTurn on predicted search results.
predictResultSizeSet options for how many predicted search results to display.
customDateDisplayTextChange the label for the custom date filter.
customDateEnableTurn the custom date filter on or off.
relatedQueryEnable or disable related queries (default is true).
relatedQueryFieldsIf you want related queries in search results then specify the API key within the field. Also you can limit it based on collection by giving specific column number.
"apikey": "BFC82BE93A351C018CB27C32E1138047",
"field": "content",
"operator": "and",
"limit": "5",
"terms": "10",
"type": "phrase",
"col": ""
dataToBeDisplayedFor CSV or database collections, list the fields to show in table format. If "displayAll": true, all fields are shown.
tuneHelps improve search relevancy. Enable by setting "enable": "true".
defaultTypeSets the search operator: AND or OR (default is OR).
pluginDomainThe SearchBlox domain from which the plugin should get search results.

🚧

Email Plugin especially the filters will work only with Email collection as from, to subject fields are fetched in Email collection alone.