Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Search Query is sent when searching in Datafari and pressing the “Enter” key or clicking on the magnifying glass:

...

GET https://[DATAFARI_BASE_URL]/Datafari/rest/v2.0/search/select?parameters

Example https://datafariui.datafari.com/Datafari/rest/v2.0/search/select?parameters

Query parameters:

Parameter

Value

Description

Data Type

q

User input (default: *:*)

The user input from search bar.

When the user does not enter any term in the search bar, use the default value “*:*” to retrieve all documents indexed in Datafari.

String

fl

List from ui-config.json

Used to display items on the search page about the document, like title, preview content, url, etc...

The list of values from "queryParams": { "fields": [ ] } in the configuration file: ui-config.json. The default values in this file are:

Code Block
languagejson
  "queryParams": {
    "fields": [
      "title",
      "url",
      "id",
      "extension",
      "preview_content",
      "last_modified",
      "crawl_date",
      "author",
      "original_file_size",
      "emptied",
      "repo_source"
    ]
  },

String

sort

score desc

Fixed value to sort the result list of documents.

String

q.op

AND

Fixed value that configure the type of search in Solr.

String

rows

10

Number of documents retrieved by the query. Fixed value.

number

start

Computed value

Is used to retrieve next page of result list. The search query must be sent with a value computed as follow: page_index * rows.

image-20240611-131205.png

Starts with 0. To have the first result page start=0, then second page is start=1*10, etc…

number

aggregator

From ui-config.json

The value of this parameter must be retrieved from this object in the ui-config.json file:

image-20240611-131738.png

“aggregator” value from searchBar.suggesters[x].type=”BASIC”.aggregator.

boolean

facet

true

Always true for filtering results with facet selections.

boolean

facet.field

{!ex=field_name}field_name

made from ui-config.json

This parameter is used for result arrangement into categories (Solr functionality).

It is made with all objects of type FieldFacet and the object of type HierarchicalFacet in ui-config.json:

image-20240612-081611.png

All objects left[x].type="FieldFacet" and left[x].type="HierarchicalFacet" are used to create parameters facet.field={!ex=field_name}field_name. field_name = left[x].type="FieldFacet".field.

With the current ui-config.json content the parameters to generate are:

Code Block
&facet.field={!ex=author}author
&facet.field={!ex=repo_source}repo_source
&facet.field={!ex=extension}extension
&facet.field={!ex=language}language
&facet.field={!ex=urlHierarchy}urlHierarchy

String multiple

facet.query

{!key=id_index}query

made from ui-config.json

This parameter is used for result arrangement into categories (Solr functionality).

It is made with one object of type QueryFacet in ui-config.json:

image-20240612-095806.png

The object left[x].id="date__lastmodified_facet"is used to create multiple parameters: facet.query={!key=id_index}query. To do this, browse the "queries" table of the object.

  • id: date__lastmodified_facet

  • index: an index for making the “key” unique. Start with 0.

  • query: is a query item in "queries" table.

String multiple

...

For these examples, we use https://demo.datafari.com/ to illustrate another configuration and see how parameters can vary.

Empty search

Here is the default request sent to the Datafari API for an empty input in the search bar:

https://datafariui.datafari.com/Datafari/rest/v2.0/search/select q: *:* fl: title,url,id,extension,preview_content,last_modified,crawl_date,author,original_file_size,emptied,repo_source sort: score desc q.op: AND rows: 10 start: 0 aggregator: facet: true facet.field: {!ex=author}author facet.field: {!ex=repo_source}repo_source facet.field: {!ex=extension}extension facet.field: {!ex=entity_phone_present}entity_phone_present facet.field: {!ex=entity_special_present}entity_special_present facet.field: {!ex=language}language facet.field: {!ex=urlHierarchy}urlHierarchy facet.query: {!key=date__lastmodified_facet_0}last_modified:[NOW/DAY TO NOW] facet.query: {!key=date__lastmodified_facet_1}last_modified:[NOW/DAY-7DAY TO NOW/DAY] facet.query: {!key=date__lastmodified_facet_2}last_modified:[NOW/DAY-30DAY TO NOW/DAY-8DAY] facet.query: {!key=date__lastmodified_facet_3}last_modified:([1970-09-01T00:01:00Z TO NOW/DAY-31DAY] || [* TO 1970-08-31T23:59:59Z]) facet.query: {!key=date__lastmodified_facet_4}last_modified:[1970-09-01T00:00:00Z TO 1970-09-01T00:00:00Z]

Pay attention to the bold parameter in the query. This is the only parameter that will be modified when searching for one or several words.

See also facet.field parameters. The entity_phone_present and entity_special_present values reflect the new facets present in this Datafari. See below its ui-config.json:

...

titleExpand to see ui-config.json...

...

languagejson

...

See below its ui-config.json:

Expand
titleExpand to see ui-config.json...
Code Block
languagejson
{
  "left": [
    {
      "type": "QueryFacet",
      "title": "Modification Date",
      "queries": [
        "last_modified:[NOW/DAY TO NOW]",
        "last_modified:[NOW/DAY-7DAY TO NOW/DAY]",
        "last_modified:[NOW/DAY-30DAY TO NOW/DAY-8DAY]",
        "last_modified:([1970-09-01T00:01:00Z TO NOW/DAY-31DAY] || [* TO 1970-08-31T23:59:59Z])",
        "last_modified:[1970-09-01T00:00:00Z TO 1970-09-01T00:00:00Z]"
      ],
      "labels": ["Today", "From Yesterday Up To 7 days", "From 8 Days Up To 30 days", "Older than 31 days", "No date"],
      "id": "date__lastmodified_facet",
      "minShow": 5,
      "show": true,
      "variant": "children_only",
      "children": [
        {
          "type": "DateFacetModificationDateCustom"
        }
      ]
    },
    {
      "type": "FieldFacet",
      "title": "Authors",
      "field": "author",
      "op": "OR",
      "variant": "autocomplete",
      "minShow": 3,
      "maxShow": 15,
      "show": true
    },
    {
      "type": "FieldFacet",
      "title": "Source",
      "typefield": "QueryFacetrepo_source",
      "titleop": "Modification DateOR",
      "queriesminShow": [2,
        "last_modified:[NOW/DAY TO NOW]""maxShow": 5,
      "show":  "last_modified:[NOW/DAY-7DAY TO NOW/DAY]",true
    },
    {
      "last_modified:[NOW/DAY-30DAY TO NOW/DAY-8DAY]type": "FieldFacet",
      "title":  "last_modified:([1970-09-01T00:01:00Z TO NOW/DAY-31DAY] || [* TO 1970-08-31T23:59:59Z])"Extension",
      "field": "extension",
        "last_modified:[1970-09-01T00:00:00Z TO 1970-09-01T00:00:00Z]""op": "OR",
      "minShow": ]3,
      "labelsmaxShow": ["Today", "From Yesterday Up To 7 days", "From 8 Days Up To 30 days", "Older than 31 days", "No date"]15
    },
     {
      "type": "FieldFacet",
      "idtitle": "date__lastmodified_facetPhone numbers present",
      "minShowfield": 5,
      "show": true"entity_phone_present",
      "variantop": "children_onlyOR",
      "childrenminShow": [
 3,
      {
          "type"maxShow": "DateFacetModificationDateCustom"
15
       }
      ]
    },
    {
      "type": "FieldFacet",
      "title": "AuthorsEmail addresses present",
      "field": "authorentity_special_present",
      "op": "OR",
      "variant": "autocomplete",
      "minShow": 3,
      "maxShow": 15,
 
    "show": true
    },
    {
      "type": "FieldFacet",
      "title": "SourceLanguage",
      "field": "repo_sourcelanguage",
      "op": "OR",
      "minShow": 23,
      "maxShow": 515,
      "show": true
    },
    {
      "type": "FieldFacetQueryFacet",
      "title": "ExtensionCreation Date",
      "fieldqueries": "extension", [
        "op": "ORcreation_date:[NOW/DAY TO NOW]",
      "minShow": 3,  "creation_date:[NOW/DAY-7DAY TO NOW/DAY]",
        "maxShow": 15
creation_date:[NOW/DAY-30DAY TO NOW/DAY-8DAY]",
   },      {
      "type": "FieldFacet","creation_date:([1970-09-01T00:01:00Z TO NOW/DAY-31DAY] || [* TO 1970-08-31T23:59:59Z])",
        "title": "Phone numbers present",creation_date:[1970-09-01T00:00:00Z TO 1970-09-01T00:00:00Z]"
      ],
      "fieldlabels": "entity_phone_present ["Today", "From Yesterday Up To 7 days", "From 8 Days Up To 30 days", "op": "OR"Older than 31 days", "No date"],
      "minShowid": 3"date_facet",
      "maxShowminShow": 155,
    },     {"show": false,
      "typevariant": "FieldFacetchildren_only",
      "titlechildren": [
"Email   addresses present",    {
  "field": "entity_special_present",       "optype": "ORDateFacetCustom",
      "minShow": 3, }
     "maxShow": 15]
    },
    {
      "type": "FieldFacetQueryFacet",
      "title": "LanguageFile size",
      "fieldqueries": "language",[
        "op": "OR"original_file_size:[0 TO 102400]",
      "minShow": 3  "original_file_size:[102400 TO 10485760]",
      "maxShow": 15  "original_file_size:[10485760 TO *]"
      ],
      "showlabels": true
    },
    { ["Less than 100 KB", "From 100 KB to 10 MB", "More than 10 MB"],
      "typeid": "QueryFacetfilesize_facet",
      "titleminShow": "Creation Date"5,
      "queriesshow": [false,
        "creation_date:[NOW/DAY TO NOW]","children": [
          "creation_date:[NOW/DAY-7DAY TO NOW/DAY]",{
          "creation_date:[NOW/DAY-30DAY TO NOW/DAY-8DAY]",type": "FileSizeFacetCustom"
        "creation_date:([1970-09-01T00:01:00Z TO NOW/DAY-31DAY] || [* TO 1970-08-31T23:59:59Z])",}
      ]
    },
   "creation_date:[1970-09-01T00:00:00Z TO 1970-09-01T00:00:00Z]" {
       ]"type": "HierarchicalFacet",
      "labelsfield": ["TodayurlHierarchy",
"From  Yesterday Up To 7 days"title",: "Fromhierarchical 8facet",
Days Up To 30 days", "Older than 31 days", "No date"]"show": false,
      "idseparator": "date_facet/",
    },
 "minShow": 5,   {
      "showtype": false"AggregatorFacet",
      "varianttitle": "children_onlyAggregator facet",
      "childrenshow": false
[    }
  ],
  "center": {
    "main": [
      {
        "type": "DateFacetCustomNotConnectedUser",  
      }  "displayNotConnectedUserWarning": true
   ]   },
 },     {
        "type": "QueryFacetSearchInformation",
        "titledata": ["File size"filters", "facets"]
      },
      "queries": [{
        "original_file_size:[0 TO 102400]type": "ResultsList",
        "original_file_size:[102400 TO 10485760]"data": ["title", "url", "logo", "previewButton", "extract"],
        "folderLinkSources"original_file_size: [10485760"enron"],
TO *]"       ]"folderTarget": "_blank",
        "labelspreviewTarget": ["Less than 100 KB", "From 100 KB to 10 MB", "More than 10 MB"],"_self"
      }
    ]
  },
  "right": [
    {
      "idtype": "filesize_facetDirectLinksWidget",
      "minShowtitle": 5"Direct Links",
      "show": falsetrue,
      "childrenvisible": [1
    },
    {
      "type": "YellowPagesWidget",
      "typetitle": "FileSizeFacetCustomYellow Pages",
      "show": true,
}      "visible": ]1
    },
  ],
 { "searchBar": {
    "typesuggesters": "HierarchicalFacet",[
      {
"field": "urlHierarchy",       "titletype": "hierarchical facetBASIC",
        "showprops": false,{
      "separator": "/"     }"maxSuggestion": 5,
    {       "typetitle": "AggregatorFacetSUGGESTED QUERIES",
          "titlesubtitle": "AggregatorQueries facet",extending your current query terms"
  "show": false     },
  ],      "centeraggregator": false
{     "main": [ },
      {
        "type": "NotConnectedUserENTITY", 
         "displayNotConnectedUserWarningprops": true{
      },    "field": "entity_person",
 {         "typesuggester": "SearchInformationsuggestEntityAuthors",
          "datadictionary": ["filterssuggesterEntityAuthors",
"facets"]       },   "asFacet": false,
  {         "typemaxSuggestion": "ResultsList"5,
        "data":  ["title",: "url",Authors suggested"logo",
"previewButton", "extract"],         "folderLinkSourcessubtitle": ["enron"],Queries extending your current query terms"
   "folderTarget": "_blank",    }
    "previewTarget": "_self" }
    ]
}  },
  ]"queryParams": {
 },   "rightfields": [
     { "title",
     "type": "DirectLinksWidgeturl",
      "title": "Direct Links"id",
      "showextension": true,
      "visible": 1preview_content",
      }"last_modified",
    {  "crawl_date",
    "type":  "YellowPagesWidgetauthor",
      "title": "Yellow Pagesoriginal_file_size",
      "showemptied": true,
      "visiblerepo_source":
1    ]
}   ]},
  "searchBarhotkeys": {
    "suggestersactiveSearchBar": [{
      {
"cmd": "shift",
       "typekey": "BASICS",

       "propsenable": {false
    },
     "maxSuggestiondeactiveSearchBar": 5,
 {
        "titlecmd": "SUGGESTED QUERIESescape",
 
        "subtitleenable": "Queriesfalse
 extending your current query terms"
   }
     },
  "exportResults": {
    "aggregatorexcel": false{
      },
"minResults": 1,
     {         "type"maxResults": "ENTITY"5000,
        "propsdefaultResults": {100
    }
  },
  "fieldssoForcedAuthentication": "entity_person", {
    "enable": false
  },
  "suggesterdevMode": "suggestEntityAuthors",{
    "enable": false,
    "dictionarybanner": "suggesterEntityAuthors",
 {
        "asFacetlocation": false"BOTTOM",
          "maxSuggestioncontent": 5,"Dev mode banner content",
       "titleprops": "Authors suggested",
{
         "subtitlebackgroundColor": "Queries extending your current query termsorange"
        }
 
    }
  }
 ]
  },
  "queryParams": {
    "fields": [
      "title",
      "url",
      "id",
      "extension",
      "preview_content",
      "last_modified",
      "crawl_date",
      "author",
      "original_file_size",
      "emptied",
      "repo_source"
    ]
  },
  "hotkeys": {
    "activeSearchBar": {
      "cmd": "shift",
      "key": "S",
      "enable": false
    },
    "deactiveSearchBar": {
      "cmd": "escape",
      "enable": false
    }
  },
  "exportResults": {
    "excel": {
      "minResults": 1,
      "maxResults": 5000,
      "defaultResults": 100
    }
  },
  "ssoForcedAuthentication": {
    "enable": false
  },
  "devMode": {
    "enable": false,
    "banner": {
      "location": "BOTTOM",
      "content": "Dev mode banner content",
      "props": {
        "backgroundColor": "orange"
      }
    }
  }
}

Empty search

Here is the default request sent to the Datafari API for an empty input in the search bar:

https://datafariui.datafari.com/Datafari/rest/v2.0/search/select q: *:* fl: title,url,id,extension,preview_content,last_modified,crawl_date,author,original_file_size,emptied,repo_source sort: score desc q.op: AND rows: 10 start: 0 aggregator: facet: true facet.field: {!ex=author}author facet.field: {!ex=repo_source}repo_source facet.field: {!ex=extension}extension facet.field: {!ex=entity_phone_present}entity_phone_present facet.field: {!ex=entity_special_present}entity_special_present facet.field: {!ex=language}language facet.field: {!ex=urlHierarchy}urlHierarchy facet.query: {!key=date__lastmodified_facet_0}last_modified:[NOW/DAY TO NOW] facet.query: {!key=date__lastmodified_facet_1}last_modified:[NOW/DAY-7DAY TO NOW/DAY] facet.query: {!key=date__lastmodified_facet_2}last_modified:[NOW/DAY-30DAY TO NOW/DAY-8DAY] facet.query: {!key=date__lastmodified_facet_3}last_modified:([1970-09-01T00:01:00Z TO NOW/DAY-31DAY] || [* TO 1970-08-31T23:59:59Z]) facet.query: {!key=date__lastmodified_facet_4}last_modified:[1970-09-01T00:00:00Z TO 1970-09-01T00:00:00Z]

Pay attention to the bold parameter in the query. This is the only parameter that will be modified when searching for one or several words.

See also facet.field parameters. The entity_phone_present and entity_special_present values reflect the new facets present in this Datafari (refer to the ui-config.json provided above).

Response:

...

image-20240614-083343.png

In the detailed response below, you find the first 10 documents in the response.docs objects with response.numFound=14. This last value is used to display the number of pages. 10 documents because of the default number of rows to be retrieved, which you will find the value in parameter rows in the query.

...