diff --git a/src/atextcrawler/search/engine.py b/src/atextcrawler/search/engine.py index 7a72de6..f029a7b 100644 --- a/src/atextcrawler/search/engine.py +++ b/src/atextcrawler/search/engine.py @@ -53,6 +53,7 @@ properties = { 'time_horizon': {'type': 'keyword'}, 'orig_source': {'type': 'text'}, 'topics': {'type': 'text'}, + 'length': {'type': 'integer'}, 'annotations': {'type': 'text', 'index': False}, 'sections': { 'type': 'nested', @@ -179,6 +180,7 @@ async def index_resource( 'time_horizon': resource.search_fields.get('time_horizon'), 'orig_source': resource.search_fields.get('orig_source'), 'topics': resource.search_fields.get('topics'), + 'length': len(text), 'annotations': pack_annotations(annotations), 'sections': sections, }