"Exclude" in search broken?

chris_kemp
Contributor III

Trying to come to grips with the new search syntax (which, honestly, I'm not sure is an improvement...):

The manual sez to use a hyphen to exclude a term from results, but it doesn't seem to actually work. I've tried searching for partial computer names (i.e. DRE* - *MacPro*), with & without the *, with & without spaces, "" marks - but it never returns anything. Also tried this with apps - but it just seems to be broken.

Does this work for anybody? If so, how do you get results?

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

I believe you need to include the comma between the main search term and the exclusions, although it doesn't really state that in the Admin Guide.

For example. using your above example, try the search like this:
DRE,-MacPro*

When using the above type of syntax I was able to successfully search for Macs in the JSS that started with a certain naming convention, but excluded any that also had the term enclosed with the asterisks.

Edit: Just wanted to add that the full Admin Guide is either incorrect, or there is a bug in Casper Suite 9.0. The specific application search example of using the exclusion clearly does not work, just as @chris.kemp stated. I actually copied and pasted the exact example of "Microsoft -Word" into Application search and I get 0 results. The only way I can get it to work is by using the following:
Microsoft, -Word*

The Admin Guide needs to be updated or the issue needs to be fixed in a future update if it was intended to work the way its outlined in the guide.

View solution in original post

6 REPLIES 6

mm2270
Legendary Contributor III

I believe you need to include the comma between the main search term and the exclusions, although it doesn't really state that in the Admin Guide.

For example. using your above example, try the search like this:
DRE,-MacPro*

When using the above type of syntax I was able to successfully search for Macs in the JSS that started with a certain naming convention, but excluded any that also had the term enclosed with the asterisks.

Edit: Just wanted to add that the full Admin Guide is either incorrect, or there is a bug in Casper Suite 9.0. The specific application search example of using the exclusion clearly does not work, just as @chris.kemp stated. I actually copied and pasted the exact example of "Microsoft -Word" into Application search and I get 0 results. The only way I can get it to work is by using the following:
Microsoft, -Word*

The Admin Guide needs to be updated or the issue needs to be fixed in a future update if it was intended to work the way its outlined in the guide.

monogrant
Contributor

mm2270, maybe instead of updating the Admin Guide, JAMF could just make the search smarter. Your "Microsoft -Word" makes sense in the world of search today. I strongly believe that we shouldn't have to learn and bend to a new (ancient) search method when the rest of the search utilities we use have evolved to more friendly search string interpretation.

Just my two cents.

mm2270
Legendary Contributor III

@monogrant - Yes, hence my stating that it may be a bug and needs to be fixed in a future version. I'm giving JAMF the benefit of the doubt here that since it was written as just "Microsoft -Word" in the guide that they intended it to work that way.
Just so we're clear though, I'm not a big fan of the new search mechanisms being used in 9, such as asterisk wildcards being required to come up with actual results in most cases. I think some of it is indeed a step backwards. (Sorry JAMF!)

chris_kemp
Contributor III

You're right, mm2270 - the Admin Guide is incorrect. It does work with the , before the exclusion, i.e. DRE,-MacPro* returns the DRE iMac record. I'm going to point this out to JAMF so they can fix it - new functionality + typos = extreme frustration...

I think it is a typo, and not intended, now that I look at it. Using a comma to delineate a "different" term, be it inclusion or exclusion, makes sense (sort of). Simply having - would be bad for us anyway, since our machines have names like DRE-MacPro-<location>.

nextyoyoma
Contributor

@mm2270, glad you mentioned the asterisk wildcard thing. I haven't had a chance to read the manual yet, and thought search was broken. I'll echo the other sentiments that I should haven't to read a manual to use a searchbox.

mm2270
Legendary Contributor III

I'm in agreement that the search was always intended to work only by adding the comma between search terms, whether talking about additions or exclusions. It makes sense really. If I enter This, That its peformaing a search on items that contain "This" AND "That" If I do This, -That its searching on "This" AND NOT "That"
As you stated chris, just using a dash as an exclusion would cause serious issues, so in a sense I'm glad it doesn't work that way.

But JAMF definitely needs to update the doc with the correct terminology, as I can see how a newbie using the product might actually think search is entirely broken. Not good.