Search only within topic titles

I’m often in the situation where I only want to search for topics that have certain words in their title.
So, it would be great if there was a search modifier that allows me to search only within topic titles (something like title:search text).

7 Likes

Keep in mind title matches are always prioritized. One issue I need to fix is that we are using the snowball stemmer which completely sucks compared to say ispell or something smarter, so it does a fair bit of messing with results.

Fine to add an advanced filter, but not sure it is needed cause we already show title matches first.

4 Likes

My user case is that I need to find all topics with “Meeting” to add them a tag, searching on topics content will return me also false positives :stuck_out_tongue:

1 Like

Yeah I would like to have this. Anyone who is interested we can fund this work cc @cpradio who may have advice.

6 Likes

I will take a stab at this, see if I can figure it out.

7 Likes

Only advice I have is pay attention to the tokenizer, as I’m fairly certain that is something you’ll be utilizing.

5 Likes

Hey I’d like to work on this. Is that ok @pmusaraj? I wouldn’t like to overlap with your stuff if you have something in the works.

7 Likes

You’re clear to work on this. @pmusaraj is working with us on other stuff.

5 Likes

Yes, that would be great (I couldn’t figure this out).

4 Likes

Pull Request adding this:

https://github.com/discourse/discourse/pull/5538

First time with PostgreSQL full text search so it would be great if someone with experience had a look :pray:.

10 Likes

Per @jorge_manrubia this is now implemented. I pushed the change here:

https://github.com/discourse/discourse/commit/86d12bd44bb23767958364743a2afdf064331c81

Note: the UI is not updated yet, we are going to wait a few betas.

Keep in mind, this change will slowly appear on your forum after the update. We will update the search index for 20k posts every 2 hours to gain the new feature. If you feel like rushing it:

./launcher enter app
rake search:reindex

A rushed reindex is running on meta right now.

12 Likes

This topic was automatically closed after 4 days. New replies are no longer allowed.