Giter Club home page Giter Club logo

zio-elasticsearch's People

Contributors

arnoldlacko avatar dbulaja98 avatar drmarjanovic avatar filipmilo avatar ioleo avatar jlcanela avatar kevchuang avatar leonanedeljkovic avatar markaya avatar mihajlo-ra92 avatar milanatucakov avatar milicns avatar mitep avatar mvelimir avatar petarcurcin avatar renovate[bot] avatar saksofon997 avatar scala-steward avatar tenzki avatar vanjaftn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zio-elasticsearch's Issues

Swap List[_] with Chunk[_]

Swap usage of List collection with Chunk in all places, except if there would be significant hit on performance.

Research 'rewrite' parameter

Description:

The rewrite parameter can be used in queries:

  • fuzzy
  • prefix
  • query_string
  • regexp
  • wildcard

It determines:

  • How Apache Lucene calculates the relevance scores for each matching document
  • Whether Apache Lucene changes the original query to a bool query or bit set
  • If changed to a bool query, which term query clauses are included

Replace WireMock with STTP

Description

Replace the current implementation of WireMock with STTP. You can refer to the documentation here.

WireMock is used to confirm that HttpElasticExecutor is creating and executing expected HTTP requests.

JVM 8 support

Description:

The current version of the sttp does not support JVM 8.

Currently we use latest version of sttp for zio2.
"com.softwaremill.sttp.client3" %% "zio" % "3.8.3"

We have following issue with
sttp/client3/SttpBackend has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0, which means it is not compatible with JRE 8.

For compatibility we can use some earlier version of sttp which can be found here: https://github.com/softwaremill/sttp/releases

Implement Query API

Queries

  • fuzzyQuery
  • geoBoundingBoxQuery
  • geoDistanceQuery
  • geoPolygonQuery
  • geoShapeQuery
  • hasChildQuery
  • hasParentQuery
  • idsQuery
  • intervalsQuery
  • matchBooleanPrefixQuery
  • matchPhraseQuery
  • matchPhrasePrefixQuery
  • multiMatchQuery
  • nestedQuery
  • prefixQuery
  • regexpQuery
  • scriptQuery
  • scriptScoreQuery
  • shapeQuery
  • simpleQueryStringQuery
  • termsQuery
  • termsSetQuery
  • queryStringQuery

Tips

  • Find comprehensive info about the query you are going to implement here
  • Define query in zio.elasticsearch.query.Queries
  • Define the public method that represents DSL for the query in the zio.elasticsearch.ElasticQuery, add scaladoc and website documentation for it
  • Support additional parameters such as "boost", "case insensitive", etc. in the zio.elasticsearch.query package
  • Provide unit tests in the zio.elasticsearch.ElasticQuerySpec to confirm behavior
  • Provide integration tests (it module) in the zio.elasticsearch.HttpExectorSpec to confirm the behavior
  • ๐Ÿ˜‡ Feel free to extend other tests as well
  • ๐Ÿ˜Š Feel free to address any follow-up issue either for the query you are implementing or implemented one already

Note: You can use #48 as a reference. If you feel that the pull request size is growing out of control, feel free to split it but make sure to link this issue in each of the related PRs.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yml
  • elasticsearch 7.17.9
github-actions
.github/workflows/ci.yml
  • actions/checkout v3.5.2
  • actions/setup-java v3.11.0
  • coursier/cache-action v6
  • actions/checkout v3.5.2
  • actions/setup-java v3.11.0
  • coursier/cache-action v6
  • actions/checkout v3.5.2
  • actions/setup-java v3.11.0
  • coursier/cache-action v6
  • actions/checkout v3.5.2
  • actions/setup-java v3.11.0
  • coursier/cache-action v6
  • hmarr/auto-approve-action v3.2.1
  • actions/checkout v3.5.2
  • actions/setup-java v3.11.0
  • coursier/cache-action v6
.github/workflows/site.yml
  • actions/checkout v3.5.2
  • actions/setup-java v3.11.0
npm
website/package.json
  • @docusaurus/core ^2.4.0
  • @docusaurus/preset-classic ^2.4.0
  • @mdx-js/react ^1.6.22
  • clsx ^1.2.1
  • prism-react-renderer ^1.3.5
  • react ^18.0.0
  • react-dom ^18.0.0
  • @docusaurus/module-type-aliases ^2.4.0
  • ts-node ^10.9.1
  • typescript ^5.0.3
  • node >=16.14
sbt
build.sbt
project/BuildHelper.scala
project/build.properties
project/plugins.sbt

  • Check this box to trigger a request for Renovate to run again on this repository

Add support for knn

Add support for K Nearest Neighbor in ZIO-elasticsearch.

Updates to the api should allow for programatically defining these fields:

  • query_vector
  • knn
  • similarity

Explore runtime mappings

Some aggregations support runtime fields. It's good if aggregation needs to be run on something more complex than the values in a single field.
More informations about this topic can be found here: runtime field.

Support 'size' and 'from' pagination parameters

Description:

size and from parameters are used to page through a larger set of search results. By default, Elasticsearch returns the top 10 matching hits, which is often not enough.
The from parameter defines the number of top hits to skip (default is 0). The size parameter is the maximum number of hits to return.

NOTE: By default, you cannot use from and size to page through more than 10,000 hits.

Add `Scaladoc` to public api

Description:

Scaladoc is a documentation generation system that reads specially formatted comments in Scala source code and generates compiled documentation.

/** This is a Scaladoc.
  * 
  */

The goal of this task is to add Scaladoc to all public api methods, we can describe what is the purpose of a method, and describe its parameters and return value.

Support boost in appropriate queries

Description:

The boost is already supported in MatchAll, Term, and Wildcard queries, so based on that similar needs to be done in Range and Bool queries.

Add website documentation

Description:

  • Provide missing features documentation to the website
  • Address "TBD" in the current website documentation structure
  • Provide queries documentation
  • Provide requests documentation
  • Provide aggregations documentation
  • Provide ElasticSort documentation
  • Provide ElasticHighlights documentation
  • Provide kNN request and query documentation

Support Filter in bool compound query

Description:

At the moment, we have only must and should elements in bool query. The filter clause must appear in the matching documents. Unlike queries specified under must, queries specified under the filter element have no effect on scoring - scores are returned as 0.

GET _search
{
  "query": {
    "bool": {
      "filter": {
        "term": {
          "status": "active"
        }
      }
    }
  }
}

Restructure tests

Description:

As an example, you can take a look at the ElasticQuerySpec.

The basic idea is to have a simple structure and description of the tests and combine them with the && operator.

The following specs should be restructured:

  • FieldDSLSpec
  • HighlightsSpec
  • IndexNameSpec
  • ScriptSpec
  • HttpElasticExecutorSpec
  • HttpExecutorSpec

How to do an Index Pattern search/lookup

Can you help me figure out how to use index patterns with zio-elasticsearch?

Elastic Search Index Pattern Search

GET categories*/_search
{
  "query": {
    "match_all": {}
  }
}

Intuitively I tried something like this

elasticSearch.execute(getById(IndexName("categories*"),DocumentId("documentId")))

This is blocked because IndexName does not allow "*".

I have indexes: categories_1, categories_2, categories_i+1

Support sort parameter

Description:

The sort parameter allows us to add one or more sorts on specific fields. It is defined on a per field level, with special field name for _score to sort by score

The order option can have the following values:

  • asc (default for all sortings except the _score)
  • desc (default for sorting on the _score)

The mode option is used for sorting by array or multi-valued fields, and it can have the following values:

  • min (default for asc)
  • max (default for desc)
  • sum
  • avg
  • median
POST /_search
{
   "query" : {
      "term" : { "product" : "chocolate" }
   },
   "sort" : [
      {"price" : {"order" : "asc", "mode" : "avg"}}
   ]
}

Elasticsearch also supports: sorting by fields that are inside one or more nested objects, handling docs which are missing the sort field, and more.. https://www.elastic.co/guide/en/elasticsearch/reference/7.17/sort-search-results.html

SSL support

Current ElasticConfig implentation does not allow to use https scheme (it uses sttp.model.Uri constructor that assumes http).

Implement Aggregations

Aggregations

  • Support adjacencyMatrixAgg
  • Support avgAgg
  • Support bucketSelectorPipelineAgg
  • Support bucketSortPipelineAgg
  • Support cardinalityAgg
  • Support childrenAgg
  • Support dateHistogramAgg
  • Support autoDateHistogramAgg
  • Support dateRangeAgg
  • Support extendedStatsAgg
  • Support filterAgg
  • Support filtersAgg
  • Support geoBoundsAgg
  • Support geoDistanceAgg
  • Support geoHashGridAgg
  • Support geoTileGridAgg
  • Support geoCentroidAgg
  • Support globalAgg
  • Support histogramAgg
  • Support ipRangeAgg
  • Support maxAgg
  • Support minAgg
  • Support missingAgg
  • Support nestedAgg
  • Support percentilesAgg
  • Support percentileRanksAgg
  • Support rangeAgg
  • Support reverseNestedAgg
  • Support samplerAgg
  • Support scriptedMetricAgg
  • Support sigTermsAgg
  • Support statsAgg
  • Support sumAgg
  • Support termsAgg
  • Support topHitsAgg
  • Support topMetricsAgg
  • Support valueCountAgg
  • Support variableWidthHistogramAgg
  • Support weightedAvgAgg

Tips

  • Find comprehensive info about the aggregation you are going to implement here
  • Define aggregation in zio.elasticsearch.aggregation.Aggregations
  • Define the public method that represents aggregation in the zio.elasticsearch.ElasticAggregation object, add scaladoc and website documentation for it
  • Support "withAgg", "withSubAgg" in the zio.elasticsearch.aggregation package, if possible
  • Provide unit tests in the zio.elasticsearch.ElasticAggregationSpec to confirm behavior
  • Provide integration tests (it module) in the zio.elasticsearch.HttpExectorSpec to confirm the behavior
  • ๐Ÿ˜‡ Feel free to extend other tests as well
  • ๐Ÿ˜Š Feel free to address any follow-up issue either for the aggregation you are implementing or implemented one already

Note: You can use #95 as a reference. If you feel that the pull request size is growing out of control, feel free to split it but make sure to link this issue in each of the related PRs.

DistanceUnit Plural

Only case object Kilometers is plural, everything else is in singular. We should unify under one style.

Class

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: .github/renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid schedule: 'Invalid schedule: Failed to parse "after 6pm every workday"'

Avg aggregation

Maybe I oversee something here but I could not find a possibility to use the average aggregation. If they want to be added they should appear here probably, right?

Cross build to Scala 3

Are there any plans to target Scala 3? Is there anything standing in the way currently? I would be willing to help with the refactor if there is interest.

Provide search on webiste

Description:

Add a search option bar to our website. As you can see, our docs don't have the search option at the moment.

You can explore the possibilities here.

Support MustNot in bool compound query

Description:

At the moment, we have only must and should elements. The must_not clause must not appear in the matching documents. Because scoring is ignored, a score of 0 for all documents is returned.

POST _search
{
  "query": {
    "bool" : {
      "must_not" : {
        "range" : {
          "age" : { "gte" : 10, "lte" : 20 }
        }
      }
    }
  }
}

Support Update request as single request and as part of the Bulk request

Description:

Update request modify a document using the specified script. The script can update, delete, or skip modifying the document. If the document does not already exists, the contents of the script are inserted as a new document.

POST /<index>/_update/<_id>

The Update API can be used for passing a partial document, which is merged into the existing document.

POST test/_update/1
{
  "doc": {
    "name": "new_name"
  }
}

Also, update request can be used inside the bulk request.

POST /_bulk
{ "update": {"_id": "5", "_index": "index1"} }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.