Elasticsearch version: 5.1.1
OS version: centos 7
Description of the problem including expected versus actual behavior:
ES 5.1 version does not support delete-by-query plugin.
so i need to change the javaAPI code.
The following code is from the previous 2.3 version.
new DeleteByQueryRequestBuilder(ElasticConnector.getInstance().getJavaClient(), DeleteByQueryAction.INSTANCE)
.setIndices(GLOBAL_ID)
.setTypes(MessageService.DEVICE)
.setQuery(QueryBuilders.boolQuery().should(QueryBuilders.termQuery("user_id", user_id))
.should(QueryBuilders.termQuery("device_id", device_id)
.mustNot(QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("user_id", user_id))
.must(QueryBuilders.termQuery("device_id", device_id)) ))
.execute().actionGet();
This code has a problem with
DeleteByQueryRequestBuilder cannot be resolved to a type
How do I change?
I think this can solve your problem
BulkIndexByScrollResponse response =
DeleteByQueryAction.INSTANCE
.newRequestBuilder(ESClient)
.filter(yourQuery)
.source(your index)
.get();
regards
Related
I recently updated a Symfony app to 4.4 from 4.2 and now my getRepository calls no longer work.
I was calling getting my repos like this:
$oems = $em->getRepository('App:OEM')->findAll();
After reading about the issue I changed to this:
$oems = $this->getDoctrine()->getRepository(OEM::class)->findAll();
But now I get this error:
Class "App\Controller\OEM" does not exist
Fixed it. I wasn't including the class. Added this and it worked:
use App\Entity\OEM;
I started to use firebase for a project around a year ago at the suggestion of my son who wrote an android application for a project I got. We were able to figure how to do some basic requests and everything worked fine. I noticed that the version of the firebase-admin changed a lot(I was using 5.2 and now the latest version is 6.3 and when I tried my code in a development environment for my surprise It doesn't work and I couldn't find so far documentation on the changes. Here is a snippet of my code which works with version 5.2 and would not work in version 5.11(or 6.3).
ValueEventListener eventListener;
eventListener = jobRef.addValueEventListener(new ValueEventListener() {
#Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot technicianSnaps : dataSnapshot.getChildren()) {
if (!technicianSnaps.getKey().equals("filler")) {
for (DataSnapshot serviceRequestsSnap : technicianSnaps.getChildren()) {
for (DataSnapshot srSnap : serviceRequestsSnap.getChildren()) {
if (srSnap.child("Date").getValue() == null){
jobRef.child(technicianSnaps.getKey()).child(serviceRequestsSnap.getKey()).child(srSnap.getKey()).setValue(null);
}
so basically I want to delete a record which was incorrectly set in firebase and i'm trying to set the value to null. everything is set correctly and when I change to version 5.2 it deletes the record, but in version 5.11 it just gets out of the loop. it seems that the method setValue(Object value) was deprecated and other methods replaced it - setValue(Object Value, CompletionListener listener). I cannot find much info about what how CompletionListener is set and how to use it. If anyone has a link to the documentation I will try to read and understand how to change it. thank you
Use setValueAsync(), which returns a Future and then wait on the Future. The main thing that has changed is that the SDK no longer uses the Task API for async operations. You can find more details here: https://medium.com/google-cloud/firebase-asynchronous-operations-with-admin-java-sdk-82ca9b4f6022
I came across on this issue on ectd #2646, it is quite old post but I can't find anything on the docs.
Does etcd has its own storage engine, or it is using boltdb or some other backend?
Thanks
it appears so:
https://github.com/coreos/etcd/blob/master/Gopkg.lock
[[projects]]
name = "github.com/coreos/bbolt"
packages = ["."]
revision = "48ea1b39c25fc1bab3506fbc712ecbaa842c4d2d"
version = "v1.3.1-coreos.6"
https://github.com/coreos/etcd/search?utf8=%E2%9C%93&q=bbolt&type=
I'm using AlchemyAPI "AlchemyAPI.TextGetTaxonomy(String)" method and it's returning exception: "unsupported-text-language". My input is: "factorial carrot".
Please advise where to set language ? My preferred language is "English".
Your response is highly appreciated.
Thanks Vlad for your help.
I'm doing REST calls and after testing and debugging, this issues is fixed finally.
If anyone facing same problem (using REST call) then just set:
data.append("&language=english");
in class:
com.alchemyapi.api.AlchemyAPI
Are you using an SDK or Rest calls?
If you are using the Java SDK, the following thread helped me out with the same type of problem, but for a different service: Github Issue 1
Basically it suggests to set the "language" paramater to "english".
params.put("language", "english");
I believe this can be adapted for any SDK or Rest Call.
I find it strange that this parameter is not specified in the documentation, nor in the Java SDK Constants, but it works.
UPDATE:
Apparently newer versions of the java SDK have a setLanguage()
method. Source Github Issue 2
Example:
final AlchemyLanguage service = new AlchemyLanguage();
service.setLanguage(LanguageSelection.ENGLISH); // <--
final Map<String, Object> params = new HashMap<String, Object>();
params.put(AlchemyLanguage.TEXT, "delete laboratory record");
final SAORelations relations = service.getRelations(params).execute();
I use gravatar_image_tag to generate user avatars. It works perfectly fine in Rails 3.0.10, but breaks when I upgrade to Rails 3.1.0. Unfortunately, it doesn't produce any error message/warning. It just stops showing images. I have no clue how to debug this.
I know this is very limited information, but hopefully someone who ran into this issue before may help me out.
Thank you.
I found out that in Rails 3.0, I can write:
- link_to(#user) do
= avatar_for(#user, size = 80)
but in Rails 3.1, I have to write:
= link_to(#user) do
= avatar_for(#user, size = 80)
This is the reason why gravatar_image_tag doesn't work for me after upgrading to Rails 3.1