Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-casting of DBFields #24

Open
chillu opened this issue Jun 9, 2020 · 0 comments
Open

Auto-casting of DBFields #24

chillu opened this issue Jun 9, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@chillu
Copy link
Member

chillu commented Jun 9, 2020

Follow up from #3. At the moment you have to be quite explicit with field types and casting. Those are implementation specific (e.g. Algolia wants dates as a timestamp, Elastic as RFC3339).

SilverStripe\SearchService\Service\IndexConfiguration:
  indexes:
    ingo:
      includeClasses:
        Page:
          fields:
            created:
              property: Created
              options:
                type: date

I think this should be handled transparently in IndexingInterface->configure() (for schema definitions) and IndexingInterface->addDocument() (for indexing). Or rather, DataObjectDocument->toArray() for casting, since the indexing interface is agnostic of DataObject/ORM concerns.

Types should stay configurable like in the example above, and the casting (e.g. to timestamp or RFC date) should be based on this.

@chillu chillu added the enhancement New feature or request label Jun 9, 2020
@chillu chillu mentioned this issue Jun 9, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant