Add resource length to elasticsearch index
This commit is contained in:
parent
f8debcff87
commit
554cf14451
1 changed files with 2 additions and 0 deletions
|
@ -53,6 +53,7 @@ properties = {
|
||||||
'time_horizon': {'type': 'keyword'},
|
'time_horizon': {'type': 'keyword'},
|
||||||
'orig_source': {'type': 'text'},
|
'orig_source': {'type': 'text'},
|
||||||
'topics': {'type': 'text'},
|
'topics': {'type': 'text'},
|
||||||
|
'length': {'type': 'integer'},
|
||||||
'annotations': {'type': 'text', 'index': False},
|
'annotations': {'type': 'text', 'index': False},
|
||||||
'sections': {
|
'sections': {
|
||||||
'type': 'nested',
|
'type': 'nested',
|
||||||
|
@ -179,6 +180,7 @@ async def index_resource(
|
||||||
'time_horizon': resource.search_fields.get('time_horizon'),
|
'time_horizon': resource.search_fields.get('time_horizon'),
|
||||||
'orig_source': resource.search_fields.get('orig_source'),
|
'orig_source': resource.search_fields.get('orig_source'),
|
||||||
'topics': resource.search_fields.get('topics'),
|
'topics': resource.search_fields.get('topics'),
|
||||||
|
'length': len(text),
|
||||||
'annotations': pack_annotations(annotations),
|
'annotations': pack_annotations(annotations),
|
||||||
'sections': sections,
|
'sections': sections,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue