Giter VIP home page Giter VIP logo

Comments (6)

markstory avatar markstory commented on May 24, 2024

As Index can have Mapping definition, including text, boolean, numeric, timestamp, how can I teach Index / Document to convert these types to PHP equivalents?

The ORM does this by introspecting the SQL schema and then using the Type classes to cast results as they are read from the statement objects. An analogous system for elasticsearch could be added to ResultSet::current() to cast data based on the document schema.

from elastic-search.

CauanCabral avatar CauanCabral commented on May 24, 2024

Great.

I'm trying figure how exactly that works:

  1. ORM\ResultSet::current() only returns value from _current property
  2. ORM\ResultSet::_calculateColumnMap($query) seems the start point
  3. Database\Query::addDefaultTypes is called from __construct and, I think, is where I need to work

Did I miss something?

from elastic-search.

markstory avatar markstory commented on May 24, 2024

I was referring to the ResultSet in this plugin. The methods you outlined are part of how the types are collected in the ORM. The casting happens inside of FieldTypeConverter which is used as a statement decorator by Cake\Database\Query::_decorateStatement()

from elastic-search.

CauanCabral avatar CauanCabral commented on May 24, 2024

@markstory I did a prototype based on 2.x branch (my env have Cake 3.x + elasticsearch 6.x).

Tried to be simple as possible, so, I included a Dummy driver who do nothing, justo to pass as a Type::toPHP parameter. For my current env/data, worked fine.

Thinking how to tests that before opening a PR.

Any chance to apply this on both Cake\ElasticSearch active branch (3.x and 2.x)?

from elastic-search.

github-actions avatar github-actions commented on May 24, 2024

This issue is stale because it has been open for 120 days with no activity. Remove the stale label or comment or this will be closed in 15 days

from elastic-search.

CauanCabral avatar CauanCabral commented on May 24, 2024

I hadn't time to finish the PR yet, but I will.

from elastic-search.

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.