Coder Social home page Coder Social logo

Comments (6)

fangel avatar fangel commented on July 19, 2024 1

So far #39 has only been merged to develop. I ran into some troubles testing it on our stage-server, because it unfortunately was running a very old 1.x-version of Elastic too.

My thinking was to wait with merging it into master and releasing a new version until after I could test it on our stage-servers for a slightly bigger real-world test than my laptop. And then after merging to master, close this issue.

from imbo-metadata-search.

christeredvartsen avatar christeredvartsen commented on July 19, 2024

I haven't touched this code at all so I'm not sure I follow. Is the DSL-transformation part of this package, or is that some related package with it's own releases?

from imbo-metadata-search.

fangel avatar fangel commented on July 19, 2024

The transformation is part of this package.

A rough summary is that this package contains a DSL for writing queries in (which is a superset of Mongo's query-syntax), as well as interfaces for how to write a backend. Each backend is responsible for receiving a query in the DSL-language and the performing it in the backend.

This package then also contains a ElasticSearch backend-implementation, and the part that takes the query-DSL and converts it into something E.S. can understand is the DSL-transformation.
(This transformation is the one that gets tested here: https://github.com/imbo/imbo-metadata-search/blob/b2c77728f25088403024570808cb65280c45ec4e/tests/phpunit/ImboMetadataSearchUnitTest/Dsl/Transformations/ElasticSearchDslTest.php)

from imbo-metadata-search.

christeredvartsen avatar christeredvartsen commented on July 19, 2024

Right. I think that when changing the public DSL, if that is needed to fix this issue), the semver-major should be bumped. If there is a way to fix this by only fixing the ES backend, and keeping bc by making it work with 5.0, 5.1 and 5.2, I'd go for it. Can't really see how this would be possible though, but as I said earlier, I'm not to familiar with the inner workings of this component.

from imbo-metadata-search.

fangel avatar fangel commented on July 19, 2024

The public DSL wouldn't have to change. The only thing that needs to change is how the ES backend translate that into a ES-query.
Right now we translate into a ES query that got deprecated by ES 2.0 - but I think I've found a way to translate it into a query that works identically using the new syntax introduced in 2.0.

Basically, right now we translate something like { "$and": [ { "foo": "bar" }, { "baz": "blargh" } ] } into something like

{ "query": {
   "filtered": { "filter": { "and": [
    { "query": { "match": { "foo": "bar" } } },
    { "query": { "match": { "baz": "blargh" } } }
  ] } }
} }

This is called the filteredsyntax in E.S. - this is what got deprecated in 2.0 (It is also the reason why the search-filtering is currently suboptimal, but that's another story).

Instead we should use something like the bool-syntax which would instead look like

{ "query": {
  "bool": { "must": [
    { "match": { "foo": "bar" } },
    { "match": { "baz": "blargh" } }
  ] }
} }

(The two examples are off-the-top-of-my-head, so there might be some slight syntax differences to this - but it should convey the right point)

So the bc break would be that we increase the minimum version of ES servers we support. Right now we support 1.x -> 5.0, but I would like to change it so that it's 2.0+

from imbo-metadata-search.

christeredvartsen avatar christeredvartsen commented on July 19, 2024

Should this issue be closed as a consequence of #39 being merged?

from imbo-metadata-search.

Related Issues (14)

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.