Difference between client.indices.putTemplate and client.putTemplate - node.js

What is the difference between client.indices.putTemplate and client.putTemplate using the Javascript ElasticSearch Client, Elasticsearch.js

client.indices.putTemplate is to create index templates...
...while client.putTemplate is to create search templates.
If you follow the links given in the JS API documentation under the respective method, you'll land on the same links I shared above.

Related

How to use and access the preference in thunderbird , in Webextension environment ,not in the legacy

Currently using this method as a legacy method.
this.prefService = Components
.classes["#mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
this.prefBranch = this.prefService.getBranch(root);
but i did not get a complete idea about how to use this in the webextension environment thunderbird .any api in order to use this feature ?
I solved my issue, by using Web Extension experiment.
Implemented the same legacy extension function with the Web Extension Experiment Specification and that solved my need at this moment.
the link mentioned below.
https://thunderbird-webextensions.readthedocs.io/en/68/how-to/experiments.html
https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/functions.html
I think you can use the storage.local API (see documentation, it seems to work the same for Firefox and Thunderbird). This allows you to store data related to your add-on with something like:
let settingItem = browser.storage.local.set(
keys // object
)
and to retrieve or remove it after that (see available methods).

How Do I Update the Swagger UI Documentation in JHipster?

In my JHipster app, I have manually updated the OpenAPI spec file (api.yml), following official instructions for API-first development.
However, the documentation (generated via Springfox) does not update, and still lists the endpoints described in the original (default) content of the api.yml.
As per Springfox's documentation,
All content is served from a webjar convention, relative url taking the following form: webjars/springfox-swagger-ui/2.9.2/swagger-ui.html
But there's no word about how to update that. Any ideas/clues welcome.
Thanks!

How to create Index with custom analyzers from json file in Azure Search .NET SDK?

I had read that the Azure Search .NET SDK uses NewtonSoft.Json to convert it's models to/from json in it's underlying REST API calls so I've been doing the same in my own app.
I have a simple app which creates a new Index using the .NET SDK. To do this, I was defining my Index in a json file, using the format outlined here https://learn.microsoft.com/en-us/rest/api/searchservice/create-index and then I was converting this to a Microsoft.Azure.Search.Models.Index object using Newtonsoft.
var index = JsonConvert.DeserializeObject<Microsoft.Azure.Search.Models.Index>(System.IO.File.ReadAllText("config.json");
This was working fine before I configured custom Analyzers, but now that I have custom Analyzers in my config, the Analyzers, Tokenizers, and TokenFilters are not being resolved into the correct types. ie. my custom Analyzer is being deserialized as a Microsoft.Azure.Search.Models.Analyzer, instead of Microsoft.Azure.Search.Models.CustomAnalyzer, same goes for the Tokenizers and TokenFilters, they are being deserialized into the base types.
Is there an easy way I can create an Index like this in the .NET SDK from a json file?
Unfortunately this is not an officially supported scenario. While it works for simple index definitions, we're working to understand what we need to do to be able to support all cases.
Please post your feature request on our User Voice page to help us prioritize: https://feedback.azure.com/forums/263029-azure-search
In the meantime, you might be able to get it working yourself by adapting the JsonSerializerSettings initialization code at the bottom of this file.

MoreLikeThis in Azure Search

I'm currently evaluating the new Azure Search feature in Windows Azure. I'm wondering if there's a way to do a MoreLikeThis query similar to lucene/elasticsearch?—pass in a document text and get a list of documents that are similar to the passed in document. I know Azure Search uses elasticsearch in the background (Source).
I haven't found this anywhere in the API, but maybe I'm missing something hidden in the parameters. I think this is a very useful feature and it would be shame if it's not included.
Yes it comes in the new version of azure search : 2015-02-28-Preview
see here : http://azure.microsoft.com/en-us/documentation/articles/search-api-2015-02-28-preview/
moreLikeThis=[key]
Here a sample:
GET /indexes/[index name]/docs/suggest?[query parameters]
Host: [search service url]
accept: application/json
api-key: [admin key]
C#
Uri uri = new Uri(_serviceUri, "/indexes/catalog/docs/suggest?$filter=discontinuedDate eq null&$select=productNumber&search=" + Uri.EscapeDataString(searchText));
There's a sample project on Codeplex:
https://azuresearchadventureworksdemo.codeplex.com/
Suggestions (Azure Search API):
http://msdn.microsoft.com/en-us/library/azure/dn798936.aspx
(Azure Search API)
http://msdn.microsoft.com/en-us/library/azure/dn798927.aspx
Unfortunately this feature is not currently available in Azure Search.
See Pablo's comment on Scott Guthrie's blog.
I know that this is an antique question, but it's one of the first when googling for 'morelikethis azure search'.
Anyway, with the new API version 2019-05-06-Preview there is a new preview feature called moreLikeThis (not in the SDK yet) where you can pass in an id of an existing document (I know, not a text like the David asked for). E.g.
GET /indexes/[index]/docs?moreLikeThis=[documentId]&api-version=2019-05-06-Preview
You can filter the compared fields by defining a list of properties with the searchFields parameter, e.g.
GET /indexes/[index]/docs?moreLikeThis=[documentId]&searchFields=[field]&api-version=2019-05-06-Preview
Of course this can also be POSTed, for more details have a look here.

How do i access the Phabricator Maniphest restful APIs?

I'm trying to programmatically create tasks/bugs on Maniphest: https://www.phacility.com/phabricator/maniphest/
but i can't quite seem to find a RESTful API that can do this.
am i totally missing out on something? or does there not currently exist one
Conduit (https://secure.phabricator.com/book/phabricator/article/conduit/) should work for you. There is a method called createtask (looks like https://secure.phabricator.com/conduit/method/maniphest.createtask/) that is exactly what you are looking for.
You can access phabricator's api, to create task ,query user info etc.
here is the demo for access https api by postman .
Note: for multi value field such as "ccPHIDs" , you should use format like the image.
but in conduit UI Test. you have to use json format, like this: ["PHID-PROJ-xxx3", "PHID-PROJ-xx12"]
phabricator's API is the wrost api set, I have used by now. so sick...

Resources