Content Search REST Endpoints
3Sixty Content Search Services provides a RESTful service to your indexes via a Content Search Connection
Configuration
A working Content Search Connection is required. When using these connections strictly for APIs, only the authentication connection and default queries, are used.
SELECT
GET /api/search/<connectorId>/<collection>/select?
or
GET /api/search/<connectorId>/select?
Note:
If no collection is provided, the configured collection will be used. If none is present, an error will occur.
Clustering
Note: Required Fields
For clustering to function the following fields must be in the field list (fl) parameter:
-
simflofy_filename
-
source_repository_id
-
content
These fields are used to form clusters and associate them with their documents.
Clustering(cluster) Parameter
Boolean, defaults to false. If true 3Sixty will feed search results through a clustering aglorithm.
Algorithm(algorithm) Parameter
algorithm - String. Default is lingo. Requires clustering to be true. If left off the call, will use lingo. Options are 'lingo','stc','kmeans'
https://carrot2.github.io/release/4.0.0/doc/tuning-quality/#choosing-the-algorithm
|
Lingo |
STC |
Kmeans |
---|---|---|---|
Cluster diversity |
High, many small (outlier) clusters highlighted. |
Low, small (outlier) clusters rarely highlighted |
Low, small (outlier) clusters rarely highlighted |
Cluster labels |
Longer, often more descriptive |
Shorter, but still appropriate |
One-word only, may not always describe all documents in the cluster |
Scalability |
Low. For more than about 1000 documents, Lingo clustering will take a long time and large memory . |
High |
Low, based on similar data structures as Lingo. |
Overlapping clusters |
Yes. A document can belong to more than one cluster. |
Yes. A document can belong to more than one cluster. |
No. A document can belong to only one cluster. |

Boolean, defaults to false. If true, a map that contains cluster names and their associated document ids from the search results will be included in the response.
Example Return for clusters and clusterMap
{
"response": {
"clusterMap": {
"Nuclear Latency": [
"/Documents/wikis2/Nuclear latency.pdf",
"/Documents/wikis2/Iran and weapons of mass destruction.pdf"
],
"Accidents and Incidents": [
"/Documents/wikis2/List of nuclear close calls.pdf",
"/Documents/wikis2/List of military nuclear accidents.pdf"
],
"Given Yield": [
"/Documents/wikis2/Neutron bomb.pdf",
"/Documents/wikis2/List of nuclear close calls.pdf",
"/Documents/wikis2/Blue Danube (nuclear weapon).pdf"
],
"India's Bid": [
"/Documents/wikis2/Nuclear Suppliers Group.pdf",
"/Documents/wikis2/Iran and weapons of mass destruction.pdf"
],
"Israel Institute for Biological Research": [
"/Documents/wikis2/Iran and weapons of mass destruction.pdf",
"/Documents/wikis2/Israel and weapons of mass destruction.pdf"
],
"Iran's Right": [
"/Documents/wikis2/Operation Opera.pdf",
"/Documents/wikis2/Iran and weapons of mass destruction.pdf"
],
"NATO Preparations": [
"/Documents/wikis2/Neutron bomb.pdf",
"/Documents/wikis2/List of nuclear close calls.pdf"
],
"Enhanced Neutron": [
"/Documents/wikis2/Neutron bomb.pdf",
"/Documents/wikis2/Iran and weapons of mass destruction.pdf"
]
},
"took": 6,
"docs": [...],
"numFound": 10,
"start": 0,
"clusters": {
"Nuclear Latency": 2,
"Accidents and Incidents": 2,
"Given Yield": 3,
"India's Bid": 2,
"Israel Institute for Biological Research": 2,
"Iran's Right": 2,
"NATO Preparations": 2,
"Enhanced Neutron": 2
}
}
}
Return Count(rows) Parameter
-Default 10. Controls the number of documents returned.
Query (q) Parameter
There is one query parameter allowed per search request. Mostly used for full text searches.
q=<field>:<value>
If a field is not included, the field will be set to content
Examples:
Query all:
q=*:*
Full text query:
q=3Sixty Rocks or q=content:3Sixty Rocks
Query name field with an OR clause:
q=name:Mike OR Ted
Query with NOT and AND clause:
q=location:London AND Frankfurt NOT Lebanon
Inclusion operators (+,-):
q=location:+London +Frankfurt -LebanonF
Field List (fl) Parameter
The majority of the time you do not want to return all fields in the result set. Similar to SQL where you only select the fields you want.
Example: fl=name,age,height
Example Complete Query:
Search users where age is 20-40 years old and live in the state of Tennessee return the name field as well as the facet statistics for the age field.
http://localhost:8080/3sixty-admin/api/search/users/select?q=*:*&facet=true&facet.field=age&fq=age:[20 TO 40]&fq=state:TN&fl=name&json.nl=map
Facet Field (facet.field) Parameter
This argument will take a list of fields that you want broken down into distinct values, such as counting content types.
facet.field=simflofy_content_type,age
Facet Query (fq) Parameter
You can have an unlimited number of facet query parameters.
Note:
Facet query fields must also be included in the facet.field list
Examples:
FQ by name:
fq=name:Mike
FQ date range:
fq=simflofy_lastmodified:[1995-12-31T23:59:59.999ZTO2007-03-06T00:00:00Z]
FQ number range:
fq=age:[20 TO 40]
FQ OR: (SOLR ONLY)
fq=age:((20) OR (40))
QUERY
POST /api/search/<connectorId>/<collection>/query
or
POST /api/search/<connectorId>/query
Note:
If no collection is provided, the configured collection will be used. If none is present, an error will occur.
Usage
None. This endpoint only accepts a body which is a raw query for the underlying indexing engine.
ElasticSearch - Performs a search using the /<index>/_search endpoint.
MongoDB - Performs a search as if using <collection>.find()
Solr - Same as SELECT, passes the full query to Solr.