Searching metadata


#1

I am testing Manticore for searching in a catalog where items have some fixed columns (like description, title, date etc.) and also some variable metadata attributes. The metadata is stored in a separate table as meta_id, meta_type, meta_value, article_id. Some are strings, some are numeric. The meta types will grow in future and on some string ones I want to do wildcard searching. I add them to a json attribute, but I don’t see how I can use it in match function.
How could I do this or should I make it different?
Thanks!


#2

Hi,

You could keep numeric type in a json attribute. Also if you have a string meta that will only require a comparison, that can stay as well in json.

For those you need text searching, they should be added in fulltext field(s). One way is to add a field for each type. This means if you add a new type, you need to a full reindexing, because it’s not possible to add on-the-fly fulltext fields (at least, not right now).
Another option would be to create for each item a small XML snippet like
value1 value2 etc. , which will be indexed in a dedicated fulltext field … let’s say metadata. You need to enable html_striping and zone indexing, which allows you to do @metadata ZONESPAN:meta2 searchme.
In this example you can do index_zones = meta* , this allows creating meta1,meta2, etc. zones.
Note that this type of search is slower, but depending on the size of your data, it might have acceptable speeds. The advantage is that as all metadatas are in a single field, you don’t need to reindex if you add a new one.


#3

Thanks, the text metas don’t change that often, I put them now each in a field. I read that I can use scripting (php) inside the conf, so I can take the meta types from a table and generate them. Does conf with scripting affect the speed in any way?


#4

Does conf with scripting affect the speed in any way?

No