exclude a certain path from all user searches
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 08:02 AM
Hi
Unfortunately we have a special folder named "_archive" in our repository everywhere.
This folder has its purpose. But: When searching for content/documents we want to exclude it and every content beneath "_archive".
So, what i want is to exclude the path and its member from all user searches. Syntax is easy with fts:
To test, take the following pdf (or any other with the term 'hodor' in it):
https://www.docdroid.net/RmKj9gB/search-test.pdf.html
take the pdf, put it into your repo twice:
- /some_random_path/search-test.pdf
- /some_random_path/_archive/search-test.pdf
In node-browser everything works as expected:
So, my idea was to edit search.get.config.xml and add the exclusion to the list of properties:
But it does not work as intended! As soon as i am using 'TEXT:' or 'name:' in the search field, the exclusion seems to be ignored.
What other option do i have? Basically just want to add the exclusion to the base query after the default query template is used.
thanks!
m
Unfortunately we have a special folder named "_archive" in our repository everywhere.
This folder has its purpose. But: When searching for content/documents we want to exclude it and every content beneath "_archive".
So, what i want is to exclude the path and its member from all user searches. Syntax is easy with fts:
<your query> AND -PATH:"//cm:_archive//*"
To test, take the following pdf (or any other with the term 'hodor' in it):
https://www.docdroid.net/RmKj9gB/search-test.pdf.html
take the pdf, put it into your repo twice:
- /some_random_path/search-test.pdf
- /some_random_path/_archive/search-test.pdf
In node-browser everything works as expected:
TEXT:"HODOR" AND -PATH:"//cm:_archive//*"= 1 result
TEXT:"HODOR"= 2 results
So, my idea was to edit search.get.config.xml and add the exclusion to the list of properties:
<search> <default-operator>AND</default-operator> <default-query-template>%(cm:name cm:title cm:description ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT TAG) AND -PATH:"//cm:_archive//*" </default-query-template></search>
But it does not work as intended! As soon as i am using 'TEXT:' or 'name:' in the search field, the exclusion seems to be ignored.
What other option do i have? Basically just want to add the exclusion to the base query after the default query template is used.
thanks!
m
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 03:58 PM
Hi
The default template is only used when you do not specify a field.
So if your query specifies fields it will not use the template.
5.1 exposes filters in the query API - which would be a better, cached solution than adding it to the query.
However, we do not have the concept of fixed filters in Alfresco.
Solr does allow you to add default parameters to the query handler configuration in solrconfig.xml.
You can edit the /afts query handler and add "fq" = "<your filter query>"
There are already some default parameters in there.
You could do this for /cmis too.
Andy
The default template is only used when you do not specify a field.
So if your query specifies fields it will not use the template.
5.1 exposes filters in the query API - which would be a better, cached solution than adding it to the query.
However, we do not have the concept of fixed filters in Alfresco.
Solr does allow you to add default parameters to the query handler configuration in solrconfig.xml.
You can edit the /afts query handler and add "fq" = "<your filter query>"
There are already some default parameters in there.
You could do this for /cmis too.
Andy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 05:54 AM
Interesting solution, thanks Andy!
I ended up overwriting the templates/webscripts/org/alfresco/slingshot/search webscripts.
I ended up overwriting the templates/webscripts/org/alfresco/slingshot/search webscripts.
