Giter Club home page Giter Club logo

Comments (5)

damieng avatar damieng commented on July 30, 2024

Hi Liam.

ElasticLINQ does not yet support min_score (the fact it generates a silly filter is a bug). It's not difficult to add but hadn't come in as a request from anyone. I might be able to get something checked in over the next 24 hours if that helps you.

from elasticlinq.

damieng avatar damieng commented on July 30, 2024

I've checked in an experimental version into dev that adds a MinScore method to the query chain, e.g.

context.Query<MyClassName>().Query(predicate).MinScore(2)

I'm considering the ElasticFields.Score property but there are a few issues there including:

  1. We'd only support >= not < > <= as Elasticsearch only has min_score which is inclusive
  2. Should probably only be in .Query not .Where as latter is for filtering
  3. Would need to only support it as a top-level or an AND at top level

So the following would probably be the only valid syntax for using ElasticFields.Score:

context.Query<MyClassName>().Query(predicate && ElasticFields.Score >= 2);

from elasticlinq.

wilsoncgp avatar wilsoncgp commented on July 30, 2024

Indeed, maybe the ElasticFields.Score property being used isn't particularly relevant given that it would only be able to be used with the '>=' operator. The MinScore method would definitely be useful for me.

from elasticlinq.

bgeihsgt avatar bgeihsgt commented on July 30, 2024

+1 to the MinScore approach over supporting the raw field. Good to create a pit of success instead of a pit of failure.

from elasticlinq.

damieng avatar damieng commented on July 30, 2024

Shipped in 1.3.1

from elasticlinq.

Related Issues (20)

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.