You are viewing limited content. For full access, please sign in.

Question

Question

Exclude a template from search results

asked on October 4, 2018

I am trying to create a search syntax for our nightly OCR Process.  Specifically I am trying to create one which excludes a particular template, photos.  This is our OCR search syntax now:

({LF:AssociatedPages="Y"} & {LF:OCR=none})&{LF:pagecount > 0} - this works great.

Here is what I am trying:

{LF:AssociatedPages="Y"} & {LF:OCR=none}&{LF:pagecount > 0}&{[ ]}-{[photo]}.  I've tried a few other iterations and keep getting various errors.  Any ideas would be much appreciated!

0 0

Answer

SELECTED ANSWER
replied on October 5, 2018 Show version history

I was surprised to test the search string and find that it did not work as I expected.  What I found is that you need to use the  {LF:TemplateName=""} to get all docs without a template, and then you end up having to OR it with another search string to get all with any template except the Photo template.

(({LF:AssociatedPages="Y"} & {LF:OCR=none}) & {LF:pagecount > 0} & {LF:TemplateName=""}) | ((({LF:AssociatedPages="Y"} & {LF:OCR=none}) & {LF:pagecount > 0}) - {LF:TemplateName="Photo"})

 

0 0

Replies

replied on October 4, 2018

You're very close. Give this a try:

({LF:AssociatedPages="Y"} & {LF:OCR=none})&{LF:pagecount > 0}-{[Photo]}

 

0 0
replied on October 4, 2018 Show version history

Or slightly more precise

({LF:AssociatedPages="Y"} & {LF:OCR=none} & {LF:pagecount > 0}) - {[Photo]}

 

0 0
replied on October 4, 2018

Thank you both for the attempt.  The issue with this provided syntax is that it will not return items with NO template assigned.  Which is why I had the portion with {[]}.  Any other ideas?

0 0
SELECTED ANSWER
replied on October 5, 2018 Show version history

I was surprised to test the search string and find that it did not work as I expected.  What I found is that you need to use the  {LF:TemplateName=""} to get all docs without a template, and then you end up having to OR it with another search string to get all with any template except the Photo template.

(({LF:AssociatedPages="Y"} & {LF:OCR=none}) & {LF:pagecount > 0} & {LF:TemplateName=""}) | ((({LF:AssociatedPages="Y"} & {LF:OCR=none}) & {LF:pagecount > 0}) - {LF:TemplateName="Photo"})

 

0 0
replied on October 8, 2018

Thank you, Bert.  It is a surprising issue!  I am wondering if more people are unaware that template exclusion also excludes all non-templated items.  It was really just by chance that I noticed the search wasn't returning everything.  I very much appreciate your time and effort!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.