Exclude URL pattern from search via regex
Low Search is very intuitive and works great. It would be even more amazing if it had the ability to set rules for content not to index (or to simply exclude from being returned).
The use case is when there are certains pieces of a Collection that you do not want to user to access via search. In our case, we have translated pages in the same Channel. They do follow a set URL pattern (example.com/es/url-title).
Put more simply, a way to subdivide a Channel into multiple Collections would be amazing.
Is this in the realm of possibility or am I dreaming?
Thanks and keep up the great work!
Replies
Low 3 Oct 2011 16:14
You can already create multiple collections per channel. If you set a field weight to None, it will not be included in the collection index. Like that, you could create something like "Pages EN" and "Pages ES" collection, each indexing the EN and ES fields of the same channel. Then, you could specify those collections in the collection="" parameter in the search form.
Is that what you're trying to accomplish?
trif3cta 3 Oct 2011 16:36
That's awesome, I didn't realize setting the weight to NONE removed it altogether. Good to know!
Generally speaking, this is what I'm after. Thank you for the quick reply.
Unfortunately I'm using the same fields for both languages (each language is its own branch in a Structure Module tree). Kind of a weird one. I want to purge the Spanish results from English searches, but the only distinguishing characteristic is the URL segment.
I'm probably in no-man's land on this one. I can't use Google CSE for other reasons. Oh well, we'll manage.
Thanks again Low.