I am reasonably new to DO and am attempting to create a button that performs 2 functions. First to enable the user to enter in a 'key word'. The second is to search a specific folder for all files that either have the keyword in the name, or contain the keyword. So far I have been able to enter a keyword and search for files 'containing' or 'named' but so far DO only does the first search
Here are my thoughts:
@set keyword {dlgstring|Please enter a keyword}
Find . CONTAINING "{$keyword}" IN "C:\support\useful documents" OR
Find NAME = "{$keyword}" IN "c:\support\useful documents"
Second idea:
@set keyword {dlgstring|Please enter a keyword}
Find . {NAME|CONTAINING} = "{$keyword}" IN "c:\support\useful documents"
Third:
@set keyword {dlgstring|Please enter a keyword}
Find {. CONTAINING "{$keyword}"|NAME = "{$keyword}" } IN "C:\support\useful documents"
Wondering if anyone could provide any guidence on how this may be achieved?
I gave following syntax a try, it looked ok to me, but unfortunately did not work out.
Find NAME "{$keyword}" IN d:\find_test CONTAINING "{$keyword}" LOADPREV=no
Setting up a filter might be worth another attempt ?!
With filters it is possible to search for filenames and their content at the same time, perhaps there is a way to get your searchstring into that filter ?!
Thanks for the response. I did think about the filter thing, but I read somewhere that you were not able to pass strings back into a filter. Perhaps I missunderstood the document and there is a way??
I had another attempt, running two Find commands in one command-set, but it does not seem to work, i just tried quite hard.
I had two commands, one for the filename and another one for the content search, both work when called individually, but not within one command-set or button. Combining their results seems not possible - i had the idea to just run the find command twice and store any hits into a custom file collection, but that failed.
Have you tried typing what you want to search for into the search field, top-right of the default toolbars? That will use Windows Search which I think does a filename + contents search by default.