Skip to content

Conversation

@max-zilla
Copy link
Contributor

This will generate a feed from v1 extractors with extractor_info automatically.

An example is wordcount extractor, which has this in extractor info:

"process" : { "file" : [ 
  "text/*", 
  "application/json" 
] }

This is translated into the following feed when the heartbeat is first registered:

{ "_id" : ObjectId("63dbce508120dca02abc52a2"), 
"name" : "ncsa.wordcount", 
"search" : { 
  "index_name" : "file", 
  "criteria" : [
     { "field" : "content_type_main", "operator" : "==", "value" : "text" }, 
    { "field" : "content_type", "operator" : "==", "value" : "application/json" }
   ], 
  "mode" : "or", 
  "original" : null }, 
"listeners" : [ { "listener_id" : ObjectId("63dbce508120dca02abc52a0"), "automatic" : true } ], 
"author" : null, 
"updated" : ISODate("2023-02-02T14:53:04.282Z") }

@max-zilla max-zilla requested a review from a team February 2, 2023 14:56
Copy link
Member

@longshuicy longshuicy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just read the code but haven't tested it. Looks good to me.

@ddey2 ddey2 self-requested a review February 3, 2023 17:25
Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it. It was able to register the extractor in db. Need to fix the logger issue while running heartbeat_listerner_sync.py

@max-zilla max-zilla merged commit df002e8 into main Feb 6, 2023
@max-zilla max-zilla deleted the add-mime-type branch February 6, 2023 15:32
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 this pull request may close these issues.

4 participants