Skip to content

Include pdate as a date type? #58

Description

@ldaverio

Hello,

it seems that example files in recent Solr distributions define dates using a pdate, not date type in the schema.xml file:

    <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>

This type is not recognised as a date type by Scorched, because date types are defined in method SolrInterface._extract_datefields in file connection.py:

    def _extract_datefields(self, schema):
        ret = [x['name'] for x in
               schema['fields'] if x['type'] == 'date']
        ret.extend([x['name'] for x in schema['dynamicFields']
                    if x['type'] == 'date'])
        return ret

Recognising pdateas a date could be achieved by replacing the two occurrences of the test:

if x['type'] == 'date'

by:

if x['type'] in ('date', 'pdate')

For now, the workaround is to rename pdate to date in the schema file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions