Search for "label" and then for words

I would like to find all documents that have a green label. So I select “label” and search for “green”. This works. Now I want to find (only in these documents) all that contain the words “dog” and “cat”.

So, I select all search results (⌘a) and choose “Search Binder Selection Only” but then all search results disappear…

Can anyone help? Thanks a lot.

edit // What works is to save the “label green” results as a collection and then search for “cat” and “dog”.

But do I really need to save a collection each time to search in it?

It sounds like you might have missed a step in there: after selecting everything in the search result list, hit the Navigate ▸ Reveal in Binder menu command to bring that selection into the Binder—and now you have a “Binder Selection” that matters. The wording is very literal. :slight_smile:

That said, this is not the only way way of doing this these days, though it does still have its uses in a few cases. Here’s the method I use in v3:

  1. After running the primary search, click the little button in the search results header bar, but where you’d close it, to transfer the result list over into your main editor (switching the view to Outliner or Corkboard, as you prefer).
  2. Press Ctrl+F / ⌘F in the editor to bring down the filter bar.
  3. Now run your search for dogs and cats. If nothing comes up initially, click the magnifying glass in the search field and make sure full text search is enabled.

While there take a look at the extended filtering options as well, by clicking the little arrow to the left. You will note that you can filter by a number of different metadata values—you may even find that what you’d rather do is use project search to find cats and dogs, and then use Outliner/Corkboard search to find “green”, since there is a nicer interface for that there.

And someday we’ll hopefully get all of this modernised and less convoluted.

But do I really need to save a collection each time to search in it?

So as should be clear by now, no, and really “Search Results” acts like a collection in every regard relevant to any of this. It technically is one, just with a few artificial constraints like not being able to delete it or rename it. But that aside, Collections can be really useful if you need to frequently narrow down a common search by a secondary or tertiary search. Might as well at least stash the stored project search criteria somewhere handy at that point.

Thanks @AmberV, the “transfer method” would be my preferred. But obviously I don’t understand something, because it doesn’t work. Be patient with me :slightly_smiling_face:

You mean this. Right?

I can search for “cat”, that works. But the search result in the doc is not highlighted. And when I search for “cat” “dog” no document appears.

Ah, yeah that is one of those aforementioned cases where project search is still the superior tool for some things, as it has many different modes and options—such as “all words” / “any words”, whereas this tool is simply looking for “exact phrase” in the same way that Quick Search would.

This is one case where my suggestion to look for cats and dogs first, and then use this tool to filter by the label Green, might be best.

And it does also demonstrate an edge where this technique only works for some things, and sometimes you do still need to use multiple project searches with the binder-selection scope set. This case is fine, specifically, but an example where it won’t work is if you need to find all documents with cats OR dogs that had either the blue OR green label set.

I can search for “cat”, that works. But the search result in the doc is not highlighted…

Nor would it be highlighted in the Search Results list in the binder. I think something I didn’t mention specifically is that one would probably want to use the Load in Other Editor shortcut here to work with the filtered list, or toggle the auto-load button on for a bit so that it acts more like a “second binder”. That’s how it should be thought of.

Ok, It is what it is. Scrivener is fantastic. But the search function is … a pain. It never works as I would assume it should. I just have to accept it. I thank you anyway :smiley:

Yeah, like I say… someday. :slight_smile:

It was meant to be overhauled in v3, but time ran out and it wasn’t the sort of thing we wanted to rush. It would be nice to not only catch up with modern trends, but do our best to leap-frog over them with some new ideas, too.

1 Like

Someday. Hope dies last :slightly_smiling_face:

I’m really no expert and you know much more about Scrivener than I do.

And I know, I am probably the exception. I have only one project, 2 GB. In my case a good search function is important.

I would have suggested that a one-time search of this type is possible.

  • label:green words:cat and dog
  • label:green words:cat or dog

But as I said, I don’t understand much about it. :slightly_smiling_face:

What has become conventional is for (at a basic level of usage anyway) let typed in search keys like that be the only thing that require you to type in something special. So “cdate:3d” for stuff made in the last three days, whereas typing “cdate 3d” would look for those letters and numbers in the project. Whatever text you want to look for in addition to any of those special keys should be allowed to be typed in loosely, rather than having to know more syntax for that as well, like text:. And of course most engines also allow double-quotes around stuff to take highest precedence as “exact phrase” searching, so that one actually could search for the phrase "label:green" if they needed to.

At a certain point though you do want some kind of GUI for it, because while just typing “type:figure” is nice, all(label:green label:blue) not(label:red exact:"don't include this") any:"cats dogs" is maybe a bit much to remember how to do unless you do this all the time. :slight_smile: The most elegant systems I’ve seen for it are self-documenting for that reason, again like the forum here. If you open up the advanced search panel and start messing with the GUI to find only posts made after a certain date, that have more than one response, then you will see that it types it in for you into the search field. And thus now you know you can type, after:2017-11-01 min_posts:1, or even save that as a search prefix in your browser (which is handy for only finding answers in the post v3 world). So that kind of two-way model where the GUI is driven by what you type and vice versa, is ideal for both those willing to get their hands dirty and those that need a “wizard” to walk them through how to set up a compound NOT clause search or whatever.

1 Like

@AmberV, just an idea…

For example, in my main project I search for all documents with a green label.

Then I select all (⌘a) and I copy these documents into a new, empty Scrivener project.

There I can then search for cats and dogs. :smiley:

Couldn’t this “behavior” be “simulated” in the main project as well?

Well that’s exactly what Reveal in Binder + setting the search scope to only use the binder selection for the next search does. I don’t think using another project here really adds anything to the mix other than a bunch of extra effort. If you really need some kind of consistency between stages of the search, then a quick temporary search collection is still easier than a temp project.

But that doesn’t work for me. If I select all search results (⌘a) and choose “Search Binder Selection Only” then all search results disappear…

To rephrase, you seem to still not be performing the step in the middle, either that or you aren’t saying that you’re doing it. If you aren’t using Reveal in Binder then it will very likely not work (and almost certainly not like you want), unless whatever happenstance selection you have back in the binder, “beneath” the search results, contains what you are searching for.

You’re right. I used to do it wrong. Now it works. Well, at least, this really makes the search easier for me. Thanks @AmberV :smiley:

1 Like

I have tried this. I fail at Step #2.

I can search for one term or another, but not both, i.e. cat AND green label is not working, but cat or green label will work.

I’m afraid the discussion has me a bit confused, so I may have misunderstood any answer given.

Apologies. I found my error: The search scope was wrong. :melting_face:

1 Like

Maybe it’s me, but it seems to me that this search is not reliable. Although I search only in documents with green label, also one without appears.

Even with the “Whole word” stipulation? Otherwise, first always reset search settings in the magnifying glass menu to clear any potentially confusing settings, set it back to Label and try again. Next, unreliable search results may mean the search index is out of sync. Hold down the Option key while looking at the File menu, to save and rebuild.

If that doesn’t work; probably best to start a new thread on it with as much reproduction detail as possible, as this wouldn’t have much to do with how to run a multi-axis search and will just be clutter for those looking to read up on that in the future.

multi-axis search …

I have tried everything you suggest. Unfortunately the problem remains.

The good thing is that no search results are missing. Only false ones are added. It is easy to see here because of the label. But with other searches …

Who does not know this yet. This search feature is really helpful for people with a big project.

“When suffixing a search term with mdate: project search will combine the current settings to also search for Modified Date.”

So if the search with 3 (or more) words gives too many results. But I know that I have modified the document in the last three months, then this suffix helps with the search.

Word Word Word mdate:3m (Many variations are possible)

I have not used this enough so far, others may not either :slightly_smiling_face:

I looked this up because @AmberV pointed it out to me, thanks @AmberV !

1 Like

@AmberV sorry, one more question.

I have a document that was created in 2010 with the word “cat” in it.

This is how it is found - cat cdate:2010

Why is it not found like this? cat <cdate:2011 :thinking:

edit: Ah, cat cdate:<2011 :slightly_smiling_face: