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

Add a constructor on FieldEntry struct from a FieldType #1086

Closed
fmassot opened this issue Jun 16, 2021 · 0 comments
Closed

Add a constructor on FieldEntry struct from a FieldType #1086

fmassot opened this issue Jun 16, 2021 · 0 comments

Comments

@fmassot
Copy link
Contributor

fmassot commented Jun 16, 2021

Is your feature request related to a problem? Please describe.
For quickwit (but I imagine that it can be useful for others), we need to be able to instantiate FieldEntry from arbitrary FieldType.

Describe the solution you'd like


impl FieldEntry {
    /// Creates a new field entry given a name and a field type
    pub fn new(field_name: String, field_type: FieldType) -> FieldEntry {
        assert!(is_valid_field_name(&field_name));
        FieldEntry {
            name: field_name,
            field_type: field_type,
        }
    }

PSeitz added a commit to PSeitz/tantivy that referenced this issue Jun 16, 2021
This was referenced Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant