Info |
---|
Valid from Datafari 6.2 |
...
The /vector
handler is used to perform vector search. Vector search features must be enabled before indexing (see Chunking and Solr Vector Search - France Labs Only ). Instead of returning whole documents from the main Solr collection, this handler returns documents snippets from the VectorMain collection. This handler accepts the following parameters:
...
Code Block |
---|
GET {DATAFARI_BASE_URL}/rest/v2.0/search/vector?q=who%20are%20France%20Labs%20founders&topK=5&fl=title,exact_contentexactContent,url |
In this example, a vector search wil be processed using the query “who are France Labs founders”, returning title, content and url of the top 5 results.
The /proposals
handler works just like /suggest
. However, instead of providing autocomplete suggestions, it processes a search based on the query. This one is meant to be used for autoproposals. The service only returns those fields:
title
preview_content
url
exactContent
url
The resulting json will look as follows:
Code Block |
---|
{"response":
{"docs":
[
{
"folder_url":"https://tatetitotu.datafari.com/Datafari/rest/v2.0/url?url=https%3A%2F%2Fwww.francelabs.com%2Fen",
"exactContent":
["Our company France Labs was established in 2011. Its founders come from SAP Research in Sophia-Antipolis, and they love open source and innovation. France Labs is the only startup that was accepted at the two incubators of Sophia Antipolis. We aim at creating the best enterprise search solution with Datafari, as well as being the recognised leader in France on Apache Lucene/Solr and Elasticsearch expertise.\n\nTEST DATAFARI \n or look at our services"
],
"title":["About << France Labs: Open source enterprise search","about.html"],
"click_url":"https://tatetitotu.datafari.com/Datafari/rest/v2.0/url?url=https%3A%2F%2Fwww.francelabs.com%2Fen%2Fabout.html&id=a4f51fe2-a9b5-4e59-90fd-913233e94b14",
"url":"https://www.francelabs.com/en/about.html "
},
{
"folder_url":"https://tatetitotu.datafari.com/Datafari/rest/v2.0/url?url=https%3A%2F%2Fwww.francelabs.com%2Fen",
"exactContent":
["# WebTimeMedias \n WebTimeMedias presents France Labs and its platinum partnership with Doculibre in Europe.\n\nApril 18th 2012\n\nThe article\n\n# L'Avenir Côte d'Azur \n L’Avenir Côte d’Azur did a short article to present France Labs.\n\nFeb. 24th 2012\n\nScreenshot of article\n\n# Nice Matin \n Nice Matin did a nice article about the kick off of France Labs.\n\nFeb. 7th 2012\n\nScreenshot of article\n\nKeep in touch\n\nNewsletter \n Subscribe to our newsletter to stay informed.\n\nCongratulations! You have successfully subscribed.\n\nSend\n\nLast Tweets\n\nPlease wait...\n\nContact\n\nAddress: Résidence du Grand Large - La Goelette, 2 rue de la Foux, 06800 Cagnes-sur-Mer \n Phone: +33 (0)9 72 43 72 85\n\nFollow us\n\n© Copyright 2024 France Labs.\n\nHome \n Sitemap \n Contact"
],
"title":["Press review << France Labs: Open source enterprise search","news_articles.html"],
"click_url":"https://tatetitotu.datafari.com/Datafari/rest/v2.0/url?url=https%3A%2F%2Fwww.francelabs.com%2Fen%2Fnews_articles.html&id=a4f51fe2-a9b5-4e59-90fd-913233e94b14",
"url":"https://www.francelabs.com/en/news_articles.html "
}
],
"numFound":2,
"start":0,
"numFoundExact":true
},
"responseHeader":
{
"zkConnected":true,
"QTime":41,
"params":
{
"topK":"2",
"org.springframework.web.util.UrlPathHelper.PATH":"/rest/v2.0/search/vector",
"qt":"/vector",
"stateVer":"VectorMain:7",
"org.apache.tomcat.util.net.secure_protocol_version":"TLSv1.3",
"AuthenticatedUserName":"topolino",
"fl":"title,exactContent,url",
"queryrag":"who are France Labs founders",
"javax.servlet.request.cipher_suite":"TLS_AES_128_GCM_SHA256",
"version":"2.2",
"javax.servlet.request.ssl_session_id":"cd1586af3dc44a0f687b394a598637f95ae6d508c9bbcde751568937cd2e4204",
"q":"who are France Labs founders",
"org.springframework.web.servlet.HandlerMapping.bestMatchingPattern":"/rest/v2.0/search/*",
"org.springframework.web.servlet.HandlerMapping.pathWithinHandlerMapping":"/rest/v2.0/search/vector",
"model":"default_model",
"id":"a4f51fe2-a9b5-4e59-90fd-913233e94b14",
"vectorField":"vector_384",
"wt":"json"
},
"status":0
}
} |
Info |
---|
Note that we also provide |
...
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IntroductionThe new Datafari API is trying to respect the principles of RESTFUL applications as much as possible and use json as the mean to exchange data. This means that everything returned by the API will be JSON, and any payload in POST and PUT requests made to the API will be in JSON too. On GET and DELETE requests, some parameter may be passed through url parmeters (either as part of the URL or in the search parameter String - anything that is after the “?”) PrefixEvery endpoint in this API are prefixed by /rest/VX.Y/ where X and Y are the major and minor versions of this API. Do also remember to add the relevant path to your Datafari web app (https://datafaridomain/Datafari/rest/VX.Y/endpoint) Response StructureAll responses are formatted using the following template:
In the following, any object presented as the response is showing the format of the content key in the above template. For errors, the content follows the following structure:
Do keep in mind that on some occasions the server might respond with an HTTP error code without any JSON payload, you must handle this case in your applications. EndpointsV2.0
GET /rest/v2.0/search/*This is the endpoint to perform a search request. This endpoint expects a search handler to be provided as well as all the elements of a solr query as URL parameters. A simple example for a search query would be:
Note that {DATAFARI_BASE_URL} is by default of the following shape: [DATAFARI_DOMAIN_NAME]/Datafari This endpoints allows the use of only a few selected search handlers for security reasons. The handlers that can be called are different depending on the value of the special “action” URL parameter.
The main handlers to keep in mind are
The If you wonder how to format your queries (either for search or query), please refer to the Solr documentation as well as the rest of Datafari’s documentation for the fields available.
Response formatThe response format of this endpoint does not follow the standard response format of this API. The payload of the response is the response from solr (please refer to the Solr documentation to see what those response look like or experiment with the endpoint). If an error occurred while Datafari is querying Solr, the response may be a 500 or 5xx http response with possibly no JSON (and maybe an html page as a response body). For each document in the response, they have two fields for the url:
GET /rest/v2.0/results/export?*This is the endpoint to perform an export of the result of a provided query. Here are the parameters to provide:
Here is an example of a GET request to the export API:
The response of this endpoint is a bytes input stream of the generated export file. In a standard web browser like chrome, it will trigger a download process V1.0Bellow is a set of API endpoints that are implemented or in the roadmap. Endpoints that are not implemented are clearly identified by the “NOT IMPLEMENTED” string in the response column. Those endpoints return a 501 HTTP Response code when queried (which is the code for the NOT_IMPLEMENTED http error). For implemented endpoints, query body and format for the content object of the response in case of success are provided.
Keep in mind that for now, this API is meant to cover standard users actions only. Admin actions are out of the scope for the time being. DetailsSpecial casesAuthFor use authentication, the browser must be redirected to the auth endpoint. Once Datafari has finished the authentication process, the user is redirected to the callback URL provided as a URL parameter. The URL to redirect the user to is:
Provide any URL you need the user to be send back to as the value for the callback parameter. GET /rest/v1.0/search/*This is the endpoint to perform a search request. This endpoint expects a search handler to be provided as well as all the elements of a solr query as URL parameters. A simple example for a search query would be:
This endpoints allows the use of only a few selected search handlers for security reasons. The handlers that can be called are different depending on the value of the special “action” URL parameter.
The main handlers to keep in mind are /select and /suggest. The /select handlers is used to perform search queries while the suggest handler is used to get suggestions for autocomplete. For how to format you queries (either for search or query), please refer to the Solr documentation as well as the rest of Datafari’s documentation for the fields available. Response formatThe response format of this endpoint does not follow the standard response format of this API. The payload of the response is the response from solr unfiltered (please refer to the Solr documentation to see what those response look like or experiment with the endpoint). If an error occurred while Datafari is querying Solr, the response may be a 500 or 5xx http response with possibly no JSON (and maybe an html page as a response body). Standard endpointsGET /rest/v1.0/users/currentThis endpoints returns the information about the currently connected user in the following form:
Exemple request / responseRequest:
Response:
|