Does anyone know if there is a way to get to search results between the time the search engine retrieves its results and the time it gets displayed on the search results page in confluence?
The reason being is that I would like to exclude certain pages from appearing when a user does a search. All the pages I want to exclude have a title that starts with a underscore (ex: _page title). My thinking was that instead of messing around with lucene having it ignore pages that start with a underscore, I can cut it off before it displays the results in the confluence search results page.
In simple terms, I imagine adding some if statement where it checks the title of the page and if it includes a underscore, then it skips it, if not then it displays it on the search results page. I imagine this would be done in the search results page template or some place where lucene hands the search results off to confluence.
Does anyone know if what I am thinking is even remotely possible or if you know of a better way to handle my situation?
Thanks
You may do something like this:
https://confluence.atlassian.com/display/DOC/Confluence+Search+Syntax#ConfluenceSearchSyntax-NOTsearch
Thanks. You post made me realize that its better to add "AND NOT title:_*" instead of just "-title:_" in the event the user is also adding some conditional to their search string. I am going to try doing it in javascript first and seeing how well that works before trying to create a servletfilter. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe the "-" does an implied AND NOT, but exlicitly stating it is ok too ... might look nicer for your users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you want people to be able to see these pages at all? If not then if you apply a viewing restriction to the page(s) it will not show up in search results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These pages are includes that appear in other pages. We essentailly created a library of include pages that get brought into other pages but when people search for something that appears in those include pages, they appear first. We want the actual page that its being included in to appear first. There is also no need for people to see these include pages so thats why we want to just hide them from search results altogether.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah! Well, I've got no easy options for you then ... except maybe train your users to append "-title:_" to their search string ... or find a way to auto add it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was hoping there was a way to do this in the page template for the search results page. Thought it would be possible to intercept the results before they get displayed on the page.
The one solution you mentioned may also work. I assume it would need to be done with javascript to append "-title:_*" to the end of search strings before it gets submitted to the engine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think your options would be to use JavaScript to add it prior to form submission or to create a plugin that would do this. Either way you will need to do some development to get what you want ... I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was thinking the javascript route may be easier to do then having to create a plugin that will append that to search strings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.