Searching specific fields

When I search a module, which fields are searched? Is it all fields?

Is it possible to limit a search to specific module fields, or to include all module fields?

Search looks in Name, Description, and Site Search Keywords for the prop_KeyWords value used.

To limit it to a particular field you could change the keyword input to the specific field needed though, ie:

<input type="text" name="prop_YOURCUSTOMFIELD" value="" >

It currently doesn’t search all module fields.

1 Like

In the Site Search Keywords field, can you add liquid code such as {{this[‘CustomField1’]}} so that everything in your custom field gets indexed? I use a custom module for pages with complex layouts so that the client can’t break the layout when adding or editing content. But it’s essential that ALL content on a page gets indexed, not just what is in the Description field. There will be some custom fields that should not be indexed because they are used for other purposes such as adding a class to an element. So ideally, when we create a custom field, we should be able to say enable (or disable) from Site Search.

1 Like

@Adam.Wilson Thanks for the info.

@hopestew Thanks for the tip.

If a user is building a database of items it might be challenging to get them to remember to add custom liquid to the Search Keywords field. Maybe I can train them to duplicate a template module item.

@hopestew Liquid does actually work within that field, however I don’t think it will get indexed as I don’t think the indexing process renders liquid at that stage - only when rending to the front-end.
I ran a test and it didn’t find the page with my Liquid generated search keywords, even after re-indexing the site.
I’ll check again later incase it needs more time to index but I don’t think it works this way unfortunately.

@Alex_B_Centrifuge it wasn’t a tip. Sorry, I worded it badly. It was a question: would it work (and did I use the correct liquid code)?

We really need an option to have custom fields indexed in order to enable Site Search to give complete results for the content of a website.