Skip to content

Instantly share code, notes, and snippets.

@wardbekker
Created September 9, 2011 06:42
Show Gist options
  • Save wardbekker/1205630 to your computer and use it in GitHub Desktop.
Save wardbekker/1205630 to your computer and use it in GitHub Desktop.
add_facet(Id, "Tags", AttributeValue) ->
{match, Captured} = re:run(AttributeValue, "<(.*?)>", [global, {capture, all_but_first, list}]),
lists:foreach( fun(Match) -> facet_ser:add_facet_value( "Tags", Match, Id) end, Captured);
add_facet(Id, "CreationDate", AttributeValue) ->
[ Date | _Time ] = string:tokens(AttributeValue, "T"),
facet_ser:add_facet_value("CreationDate", Date, Id);
add_facet(_,_,_) ->
ignore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment