Matching stored search on any non-empty metadata value


(Charlotte Westney) #1

Matrix Version: v5.3.4

Hi everyone,

This must be do-able, its such a simple thing. I have a search (its actually a calendar events search page) and I want to show all events that have a metadata filled in. If its empty, don’t show on results. If its filled in (which will be a number either 4 5 or 6 digits long) show on results.

I have a stored search, set to ‘set value’. If I put an example number in, it will correctly bring me back that 1 event. But what do I need to tell it to match on any number?

I’m thinking regular expressions. I tried putting in [0-9]+ but that got no results, so its like it doesn’t recognise that as a regular expression.

Am I missing how to tell Matrix it needs to deal with a regular expression, or am I missing something far more basic in my set-up?!

Thanks!
Charlie


(Bart Banda) #2

The matrix search system is very basic, I don’t believe it supports regex searching like that.

What I would do is to create another metadata field that references your digit metadata field, and put something like %metadata_field_digits^notempty:digits%

That way this new metadata field will have “digits” in it if your first field is not empty. Then you do a stored search on your secondary field for the term “digits”.


Link Value Filtering with more than 1 values
(Charlotte Westney) #3

Hi Bart,

Got it working - Yay!
Thank you ;o)