Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:19
    solicode commented #1793
  • 02:16
    sksamuel commented #1865
  • 02:16
    sksamuel closed #1865
  • 02:04
    sksamuel commented #1867
  • 02:04
    sksamuel closed #1867
  • 02:03
    sksamuel closed #1866
  • 02:03
    sksamuel closed #1864
  • Sep 18 19:37
    sksamuel closed #1869
  • Sep 18 19:24
    borsik opened #1869
  • Sep 18 14:36
    jdcohen220 opened #1868
  • Sep 18 14:21
    jdcohen220 opened #1867
  • Sep 18 00:01
    scala-steward opened #1866
  • Sep 17 15:54
    eric-taix-teads commented #1865
  • Sep 17 15:38
    eric-taix-teads opened #1865
  • Sep 17 07:37
    radufiser commented #1841
  • Sep 16 16:16
    sksamuel commented #1863
  • Sep 16 13:50
    alexklibisz commented #1863
  • Sep 16 07:06
    scala-steward opened #1864
  • Sep 15 17:26
    sksamuel commented #1854
  • Sep 15 17:25
    sksamuel closed #1854
Marcell
@yohannesm
please @ me if anyone can help.
Quynh Anh "Emma" Nguyen
@qaemma
@yohannesm your import is import com.sksamuel.elastic4s.http.ElasticDsl., maybe it should be import com.sksamuel.elastic4s.http.ElasticDsl._?
nixiehi
@nixiehi
Hey. Could you update the readMe for the new changes like ElasticClient,?
Abdhesh Kumar
@abdheshkumar
Is there a way to mock elasticsearch response. LikeSearchResponse?
Dmitrii Naumenko
@unkarjedy
@yohannesm Is your issue still actual?
Rafael Grillo
@grillorafael
@sksamuel do you have a planned date for next release?
Derya Aydede
@Derya
how do you guys typically handle the ES json response? i've just been parsing it as json, but is there any better way? if I do an aggregation for example, and maybe it's nested or whatever right, so with the path to the buckets I want I have to build the ES query based on that obviously and then again walk the JSON tree based on that path as well
also, great library! this thing has been a life saver for me
Alice Fuzier Cayla
@alicefuzier
Hi, I've just commented on a very old and closed issue: sksamuel/elastic4s#1093. Basically, we need to pass search_type parameter to a 5.6.x cluster but the 5.6.x release of elastic4s has a bug where it sends the search_type in all capitals when it should be lowercase. According to the issue the bug was fixed in 6.x versions of the library but not 5.6.x. Any reason for that? Any objections to me raising a PR to backport this fix to 5.6.x?
Inigo Mediavilla
@txominpelu
Hi, is it possible to do this kind of authentication with elastic4s https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html ?
I mean, do I need to create a custom client or it is already included in the library ?
Saurabh Rawat
@eklavya
hi, I am getting could not find implicit value for parameter handler: com.sksamuel.elastic4s.http.Handler[com.sksamuel.elastic4s.mappings.MappingDefinition, _]
I imported everything under the sun
import com.sksamuel.elastic4s.ElasticImplicits._
import com.sksamuel.elastic4s.indexes._
import com.sksamuel.elastic4s.http.ElasticDsl._
import com.sksamuel.elastic4s._
import com.sksamuel.elastic4s.mappings._
import com.sksamuel.elastic4s.mappings.MappingDefinition._
import com.sksamuel.elastic4s.mappings.dynamictemplate._
import com.sksamuel.elastic4s.analyzers._
import com.sksamuel.elastic4s.mappings.dynamictemplate.DynamicMapping
import com.sksamuel.elastic4s.circe._
where is it?
Saurabh Rawat
@eklavya
it's supposed to be getMapping instead of mapping as shown in the issue, added a comment
Abdullah Velioğlu
@abdvel

Hi everybody,

I have a question.

This is my elastic4s query
.query( functionScoreQuery( boolQuery() .must( matchQuery("username", searchText), existsQuery("photoUrl")) .not( termQuery("photoUrl", pudraConfig.defaultUserPhotoUrl), termsQuery("id", blockedUserIds ::: List(0))) ).functions( fieldFactorScore("popularity") modifier SQRT factor 1 missing 1 ))

This is my elasticsearch api query

{ "query": { "function_score": { "query": { "match": { "username": "exampleusername" } }, "field_value_factor": { "field": "popularity", "factor": 1, "modifier": "sqrt", "missing": 1 } } } }

2 request looks like some but response not equal. This problem is modifier field. If I don't send modifier tag from elasticsearch api; it will response is same.

What am I wrong?

Sebastian Bruckner
@Sebruck

Good morning together!

Is it possible to activate the Host Sniffer (https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/sniffer.html) with the Elastic4s HTTP Client?

Nepomuk Seiler
@muuki88
@Sebruck I guess opening a pull request is the best action here :kissing_heart: . Hope you are doing fine :heart:
techla
@techla
hi
I try to do an upsert but i'm confused with the documentation
i don't know how to pass the id field to the request
any suggestion ?
in `val resp = client.execute { update(5).in("scifi/startrek").doc( "name" -> "spock", "race" -> "vulcan" ) }, how do we specify the field that stands for the id ?
Iliescu Cristian-Teodor
@ctiliescu

Hi. I try do update a field from a document that is an object , i've tried like this
doc ("query" -> obj,
doc ("query" -> obj.asJson,
doc ("query" -> obj.asJson.noSpaces and I receive

BulkError(mapper_parsing_exception,object mapping for [result] tried to parse field [result] as object, but found a concrete value.

Any suggestion?

Daulet Kabdiyev
@SirMullich

Hi all,
I have the following problem: during the request to Elasticsearch, service raises the following exception:

com.sksamuel.elastic4s.http.JavaClientExceptionWrapper: java.io.IOException: Connection reset by peer
    at com.sksamuel.elastic4s.http.ElasticsearchJavaRestClient$$anon$1.onFailure(ElasticsearchJavaRestClient.scala:53)
    at org.elasticsearch.client.RestClient$FailureTrackingResponseListener.onDefinitiveFailure(RestClient.java:629)
    at org.elasticsearch.client.RestClient$1.retryIfPossible(RestClient.java:419)
    at org.elasticsearch.client.RestClient$1.failed(RestClient.java:398)

I couldn't find solution after googling. Elasticsearch server version is 6.5.3, while elastic4s version used by service is 6.2.10. I was wondering if the problem can be related to library version and if I should upgrade it to 6.5.1?

John
@John82245292_twitter

did someone use copy_to with elastic4s? I have a query where i need the ability to use cross field query, but using cross_fields query type is not allowed with fuzziness...

my query currently looks like:

  val query = should(
      multiMatchQuery(term)
        .fields(Seq(
          "taxId",
          "vatId"
         ))
        .field("formalName", 4)
        .matchType("PHRASE_PREFIX")
        .lenient(true)
    ).minimumShouldMatch(1)

and it workds great, I just want to add the ability to search by vatId and formal name together...

Nir Ohayon
@nir_ohayon_twitter
i need this too...:/
Santiago Suárez P.
@ssuarez6_twitter
Hi everybody.
I have an index in ES that contains, among other fields, a long field and a text field that has an Id
I need to group by the id field, sort by the long field and get the whole source. Been reading a while and trying some stuff but I'm not sure how to do it. I know I need an aggregation, but how can I tell ES to return just one source per group?
search("index").query(matchAllQuery()).aggregations(termsAggregation("group_by_id").field("id"))
Santiago Suárez P.
@ssuarez6_twitter
Hello, I've been trying to use the composite aggregation but it is not referenced in AggregationApi. Any reasons for this?
xuskorea
@xuskorea
Hi all
I have a question what is the best way to use geodistance query
jdcohen220
@jdcohen220
I have a quick question on the SearchIterator. The example you must specify a keepAlive value for ES scrolling. I noticed when implementing this myself you also must specify an implicit val Duration. What is the purpose of this versus the keepAlive?
nizos
@nizos
I have a few questions about getting request and response results but I’m not sure if anybody is here.
Gabriele Favaretto
@gabriele83
Hi, how can I get a client like this with version 7
ElasticClient(
      ElasticProperties(esHost),
      new RequestConfigCallback {
        override def customizeRequestConfig(requestConfigBuilder: Builder): Builder = {
          requestConfigBuilder
        }
      },
      new HttpClientConfigCallback {
        override def customizeHttpClient(httpClientBuilder: HttpAsyncClientBuilder): HttpAsyncClientBuilder = {
          httpClientBuilder.setDefaultCredentialsProvider(elasticCredentialsProvider)
        }
      }
    )
Gabriele Favaretto
@gabriele83
with Akka Http client
Gabriele Favaretto
@gabriele83
nobody can help me with the Akka client??
Yianni G
@yianni
Is the latest HTTP client compatable w/ V7?
muhmadtabrez
@muhmadtabrez
Hello i am getting elastic search following error while creating a document java.lang.IllegalArgumentException: mapper [variables.actions.variables.value] of different type, current_type [date], merged_type [keyword]
my Request json is
{
"StartUserUserId":"mohammed.i@exceego.com",
"ProcessName":"HSE Observation",
"EventType":"ProcessInstance",
"SuperProcessInstanceId":null,
"ProcessInstanceName":"HSE Observation",
"ProcessDefinitionId":"HSEObservation:2:38535",
"AppName":"HSE Observation",
"ProcessStartDate":"06-May-2019 11:49:04",
"StartUserName":"Mohammed Ibrahim",
"StartUserEmail":"mohammed.i@exceego.com",
"variables":{
"form9124outcome":"submit",
"Archive":"false",
"proceduresorderlines":null,
"form9126outcome":"close",
"observationmade_LABEL":"Safe",
"toolsandequipment":null,
"initiator":"7",
"taskDescription":"test 6519 518",
"moduleName":"HSE Observation",
"assignees":"4",
"reactionofpeople":null,
"reviewedby":"Yunus Khan",
"company_LABEL":"Barik Group",
"positionofpeople":null,
"companyifothers":null,
"greetingTask":"Hello World!",
"roadsafety":null,
"roadsafet":null,
"company":"BarikGroup",
"observedby":"Mohammed Ibrahim",
"immediateactionstaken":"test 6519 518",
"locationName":"Barik IT Solutions",
"datereviewed":1557100800000,
"RecordNo":"78",
"dateofobservation":1557100800000,
"observationrating_LABEL":"1 = has minimal impact (accepted)",
"greeting2ProcLocal":"Hello World Local!",
"describelocation":"test 6519 518",
"reviewerscomment":"test 6519 523",
"greeting2Proc":"Hello World!",
"OpenCloseStatus":"Closed",
"unsafecondition":null,
"personalprotectiveequipment":null,
"observationrating":"1 = has minimal impact (accepted)",
"location":"003",
"observationmade":"Safe",
"actions":[
{
"id":"42548",
"url":"http://172.17.0.9/activiti-app/activiti-app/api/history/historic-process-instances/42548",
"businessKey":null,
"processDefinitionId":"HSESubActions:29:38533",
"processDefinitionUrl":"http://172.17.0.9/activiti-app/activiti-app/api/repository/process-definitions/HSESubActions:29:38533",
"startTime":"2019-05-06T11:51:09.365Z",
"endTime":null,
"durationInMillis":null,
"startUserId":"4",
"startActivityId":"sid-9A93FB4A-2B12-4954-B7BB-CDE19F3F767E",
"endActivityId":null,
"deleteReason":null,
"superProcessInstanceId":null,
"variables":[
{
"name":"completionnotes",
"type":"string",
"value":"test 6519 522",
"scope":"local"
},
{
"name":"form9132outcome",
"type":"string",
"value":"close",
"scope":"local"
},
{
"name":"Archive",
"type":"string",
"value":"false",
"scope":"local"
},
{
"name":"starter",
"type":"string",
"value":"4",
"scope":"local"
},
{
"name":"RecordNo",
"type":"string",
"value":"36",
"scope":"local"
},
{
"name":"actionrequired",
"type":"string",
"value":"test 6519 521",
"scope":"local"
},
{
"name":"moduleName",
"type":"string",
"value":"HSESubActions",
"scope":"local"
},
{
"name":"priority_LABEL",
"type":"string",
"value":"Medium",
"scope":"local"
},
{
"name":"approvedby",
"type":"string",
"value":"Yunus Khan",
and my template is

{
"template": "bpmanalyticseventlog",
"settings": {
"index": {
"analysis": {
"analyzer": {
"standard": {
"filter": [
"asciifolding",
"lowercase"
],
"type": "standard",
"tokenizer": "keyword"
}
}
}
}
},
"mappings": {
"bpmanalyticsevent": {
"dynamic": "true",
"dynamic_templates": [
{
"string_fields": {
"mapping": {
"omit_norms": true,
"type": "keyword"
},
"match_mapping_type": "string",
"match": "
"
}
},
{
"variable_mappings": {
"path_match": "variables.",
"mapping": {
"type": "{dynamic_type}"
}
}
},
{
"tasks_mappings": {
"path_match": "tasks.
",
"mapping": {
"type": "{dynamic_type}"
}
}
},
{
"startprocess_variable_mappings": {
"path_match": "processStartVariables.",
"mapping": {
"type": "{dynamic_type}"
}
}
},
{
"custom_processmappings": {
"path_match": "processSpecificCustomMap.
",
"mapping": {
"type": "{dynamic_type}"
}
}
},
{
"task_complete_variable_mappings": {
"path_match": "taskCompleteVariables.*",
"mapping": {
"type": "{dynamic_type}"
}
}
}
],
"properties": {
"ProcessStartDate": {
"format": "dd-MMM-yyyy HH:mm:ss",
"type": "date"
},
"TaskDueDate": {
"format": "dd-MMM-yyyy HH:mm:ss",
"type": "date"
},
"TaskStartDate": {
"format": "dd-MMM-yyyy HH:mm:ss",
"type": "date"
},
"ProcessEndDate": {
"format": "dd-MMM-yyyy HH:mm:ss",
"type": "date"
},
"TaskEndDate": {
"format": "dd-MMM-yyyy HH:mm:ss",
"type": "date"
},
"TaskClaimDate": {
"format": "dd-MMM-yyyy HH:mm:ss",
"type": "date"
}
}
}
},
"aliases": {}

}

can any one please suggest whats wrong with my _template for the above document
ruslan
@unoexperto
@sksamuel Hi ! How is it going with release for Scala 2.13?
James Gorrie
@jamesgorrie
Hi all - having an easy time migrating from 6 => 7, with one exception, not understanding how to implement language analysers with the new analysis package, any pointers?
xuskorea
@xuskorea
Hi I've got a quetion is possible use The hitReader typeclass with circe
Declan Neilson
@decyg
hi all, wondering if anyone can help me with my issue, i'm running a trivial query that i can't share but it's just a search, query, size, aggs however every time i run it i'm getting a [error] Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.sksamuel.elastic4s.requests.searches.Total (although at least one Creator exists): no int/Int-argument constructor/factory method to deserialize from Number value (92543)` and i can't seem to figure out why, would appreciate any advice
Dragutin Marjanović
@drmarjanovic

Hey, do you know how I can handle error in stream?

I'm using elastic4s streams. When Elasticsearch responds with "error" (e.g. Connection Refused), it kills stream. I found

// if an error we will cancel the subscription as we cannot for sure handle further elements
    // and the error may be from outside the subscriber
    subscription.cancel()
    config.errorFn(t)
    buffer.clear()
    context.stop(self)

part of code which cancel subscription. Can I avoid this? And possible provide retry strategy instead?

Thanks in advance.

Tim Cropper
@cropper-tim

Hello,
I'm trying to apply a fieldSort to an innerhit, and the entire fieldSortDefinition is being returned. Please see code below for more info. I'm currently using elastic4s 5.5.6.
inner hit query:

.inner(innerHits("<inner_hits>").from(startIndex).size(itemsPerPage).sortBy(fieldSort("<field.innerfield.sortfield>")))

sort field of executed query:

"sort": [
    "FieldSortDefinition(<field.innerfield.sortfield>,None,None,None,None,None,asc)" 
]

expected sort field:

"sort":[
    {
        "<field.innerfield.sortfield>":{
            "order":"asc"
        }
    }
]

Thanks, and let me know if I can provide any additional information.