Exclude code from search results...

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Get Involved
User avatar
nou nou
Registered User
Posts: 681
Joined: Sat Oct 29, 2016 8:08 pm

Exclude code from search results...

Post by nou nou »

I've searched and not found so I don't think there is a built-in way of doing this, so...

I have a forum where a lot of code is being shared. This makes it difficult in some cases to search for something that is also a keyword used in code, for example.

Is there a way to exclude specific BBCode content (like something that is inbetween code tags) from search results?

Thank you!
User avatar
nou nou
Registered User
Posts: 681
Joined: Sat Oct 29, 2016 8:08 pm

Re: Exclude code from search results...

Post by nou nou »

Anybody an idea?

Would this be possible with an extension or would it require custom core code? Would it require indexing twice or can search work with exclusions somehow?

Ideally, of course, this type of search would be optional...
User avatar
NeoDev
Registered User
Posts: 24
Joined: Mon Oct 18, 2021 9:52 pm
Name: Neo

Re: Exclude code from search results...

Post by NeoDev »

It would require an extension and greatly depends on your search backend. When using Sphinx for searching it's possible to filter the data before it's indexed. When using the builtin full text indexing of MySQL or PostgreSQL I can not see a way to do so.
Come for the comics, stay for the bad fish puns.
— The Cross Time Cafe
User avatar
nou nou
Registered User
Posts: 681
Joined: Sat Oct 29, 2016 8:08 pm

Re: Exclude code from search results...

Post by nou nou »

NeoDev wrote: Tue Oct 01, 2024 5:23 am It would require an extension and greatly depends on your search backend. When using Sphinx for searching it's possible to filter the data before it's indexed. When using the builtin full text indexing of MySQL or PostgreSQL I can not see a way to do so.
I'm using phpBB Native Fulltext

EDIT - I've never had the need for anything else, but I'd consider switching if that would allow me to search within/without content in certain BBCodes...

EDIT 2 - of course once we're at it, it would be great to be able to search inside [code] tags only as well... :D

Return to “Extension Requests”