moin icon indicating copy to clipboard operation
moin copied to clipboard

UI access to dynamic_fields

Open RogerHaase opened this issue 4 years ago • 0 comments

In indexing.py there is this code:

    # Define dynamic fields
    dynamic_fields = [("*_id", ID(stored=True)),
                      ("*_text", TEXT(stored=True)),
                      ("*_keyword", KEYWORD(stored=True)),
                      ("*_numeric", NUMERIC(stored=True)),
                      ("*_datetime", DATETIME(stored=True)),
                      ("*_boolean", BOOLEAN(stored=True)),
                     ]

    # Adding dynamic fields to schemas
    for glob, field_type in dynamic_fields:
        latest_revisions_schema.add(glob, field_type, glob=True)
        all_revisions_schema.add(glob, field_type, glob=True)

For this to be useful, somewhere on the modify view there needs to be a data entry field where a user could define/modify a name and value similar to:

my_id: my_id_value

After saving the item, whoosh has code to search for my_id values. e.g, the following could be entered into the search field:

my_id:my_id_value

RogerHaase avatar Aug 29 '20 22:08 RogerHaase