INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Can I create a calculated field used to search keywords OR filenames?  (Read 1544 times)

lise

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 942

I have a gazillion smartlists that search for X in keywords, but now I want to modify them to also search for x in the [filename (name)] (tagging all my documents is proving to be too time consuming so searching for filename as well would be very useful and more accurate).

I've just been going at it manually when it occured to me that maybe I can create a custom calculated field that basically says: keywords OR filename (name). Then I can modify my smartlists to search that custom field.  I'm not sure the combine list expression would work, because I need it to be an "or", and obviously filename (name) isn't a list.

Example of what I need: search for "plywood" in keywords OR in filename (name)

Any gurus out there have something similar?
Logged
A wise man once said don't count your years, but make your years count. Or was it beers?

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: Can I create a calculated field used to search keywords OR filenames?
« Reply #1 on: February 04, 2010, 11:20:07 am »

is this what you want?

([Keywords]="plywood" or [Filename (name)]="plywood")

 :)
gab
Logged

lise

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 942
Re: Can I create a calculated field used to search keywords OR filenames?
« Reply #2 on: February 04, 2010, 11:30:36 am »

That's what I currently use in that particular smartlist.
This particular (very large) set of smartlists search keywords. Now I want them ato also search filename (name).
Rather than modify my gazillion smartlists to also include the filename in the search, I thought: what if I had a calculated field that included both those fields. Then I just have to modify my smartlists to say: 
"NewCalculatedField" contains "plywood".

The beauty there is that if I change my mind about the fields I want to search I can just modify the calculated field to remove/include another field in it's expression, rather than modify all my smartlists.
Logged
A wise man once said don't count your years, but make your years count. Or was it beers?

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: Can I create a calculated field used to search keywords OR filenames?
« Reply #3 on: February 04, 2010, 11:37:18 am »

oke, misunderstood you... why dont you just put them after eachother then, the new calculated field could be
[keywords];[filename (name)]
when you use 'contains' to search, it should work.
and when you would make the calculated field a defauls search field in the options you could even just type in plywood in the search.

 :)
gab
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8955
Re: Can I create a calculated field used to search keywords OR filenames?
« Reply #4 on: February 04, 2010, 11:43:56 am »

"ListCombine" appears to work just fine too. Make a new library field using: listcombine([keywords],[filename (name)])

lise

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 942
Re: Can I create a calculated field used to search keywords OR filenames?
« Reply #5 on: February 04, 2010, 11:56:24 am »

gappie:  Goodness, it works! I didn't know that you could just add fields with a ; in between them like that. I figured it would have to be some complicated expression with a command of sorts!  This is wonderful.

Marko, is there a difference between using listcombine and just [keywords];[filename (name)]?

And finally, one last thing that would make my life easier. Is there a way to use "or" in a smartlist that doesn't include having to add the field for each "or"?  I seem to recall in the old days being able to type something like:
[keywords]=("plywood", "pine", "oak") rather than
([keywords]="plywood" or [keywords]="pine" or [keywords]="oak")
Logged
A wise man once said don't count your years, but make your years count. Or was it beers?

lise

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 942
Re: Can I create a calculated field used to search keywords OR filenames?
« Reply #6 on: February 04, 2010, 12:01:22 pm »

Ah, I think I have it. 
I was using [keywords]="plywood" or "pine" or "oak" and also tried [keywords]="plywood", "pine", "oak" with and without parenthesis, when the answer is:

[keywords]="plywood","pine","oak" with no spaces between the commas.
Excellent.
Logged
A wise man once said don't count your years, but make your years count. Or was it beers?

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: Can I create a calculated field used to search keywords OR filenames?
« Reply #7 on: February 04, 2010, 12:14:19 pm »

i guess you could say that the listcombine expression is more hygienic, the result is cleaner.
say you have no keywords. with just the ; you could get:
;plywood factory.jpg
with listcombine you get
plywood factory.jpg

 :)
gab
Logged
Pages: [1]   Go Up