Refine searches


(jmm) #1

I think it is not possible to specify words to come up first in search results, so I have made a general search query

$Tags.contains($Tags(agent)) & $Location.contains($Location(agent)) & $CitationKey==$CitationKey(agent)

and resorted to put above that search in the outline, another one performed on its results. For tags named “reseña_whatever”. Something similar to:
$Tags.icontains((“reseña[a-zA-ZÀ-ÿ0-9_-]+”) ("/Content/Reviewing/Search"))

Could you please let me know how to specify a path for icontains?

Neither have I been able to find out if it is possible to get a list of co-ocurrent tags. I would like to have them sent to $Text.


(Mark Anderson) #2

Agents simply match notes, creating an alias for each of those notes that match the query.

This has some errors, albeit ones which don’t likely affect the query as the first two terms use one opening but two closing parentheses.

$Tags(agent) doesn’t actually do anything pertinent. It just asks every note if the agent has a value for $Tags. If it does, each note will evaluate this as true and thus be a match. I think you meat to use:

$Tags.contains($Tags(agent))

though this will only work for an single value in the agent’s $Tag, because list.contains() can only match one list item. IOW, you can match ‘oranges’ but not ‘oranges’ and ‘pears’. This is because in the latter case you’d need to write this to match either of 2 tag values:

$Tags.contains($Tags(agent).at(0)) |$Tags.contains($Tags(agent).at(1))`

if you wanted to match 3 values, you’d need a third query term, etc. IOW, you can’t (easily) make the query auto-expand to accommodate varying amounts of agent $Tags values.

A much better approach is to use Attribute browser for this sort of task as it can list each combiation of $Tags values. A note with $Tags values of ‘oranges’ and ‘pears’ will list under, 'o

If I understand correctly you want to match certain tags, but only for those notes that are only children of your agent at container /Content/Reviewing/Search

This doesn’t really need a new agent. You just add some terms onto your original query:

$Location.contains($Location(agent)) & $CitationKey==$CitationKey(agent) & $Tags.icontains(“reseña[a-zA-ZÀ-ÿ0-9_-]+”)

See more:

  • Set-type attributes
  • list.icontains() NB for matching list-based (i.e. Set, List types) values your regex pattern must match complete values and not just the desired sub-string. This may be a simple as a bit of padding with .* at each end of the regex pattern.

(jmm) #3

Good to know, thanks.

Oh, yes. What I wanted to do can be achieved easily in the Attribute browser!

If I am not wrong, queries cannot be stored for later use in the Attribute browser. Similarly to what can be done for Treemaps, according to “Actions and Dashboards”:

we could save the lookup table in $MyString(/Config/tremap). Now, our color expression is simply: $MyString(/Config/treemap).at($Currency)


(James Fallows) #4

There’s a version of “saving” an Attribute Browser query, which is simply to set up a Att Browser tab the way you want – grouping items by the criteria you prefer, specifying what items you’d like to include or exclude with a query – and then just leave the tab there. It doesn’t do any harm or cause any problems when it’s sitting there and you’re not using it, and whenever you click over to it it will update to reflect latest results.

Also, once you set up a tab that way, you can use the Tab/New command to create a new tab based on it, and then tune that tab to reflect some other Attrib Browser grouping you would like to see.

So in effect, you can save these queries. The Attribute Browser is the Swiss army knife of current Tinderbox.


(jmm) #5

Thanks for your suggestion. It would be good if Copy URL Of This Tab worked properly in the Attribute browser, but it always copies the same:

tinderbox://tb_file/?view=attributeBrowser+select=


(James Fallows) #6

Interesting! I had never used this command before, but in trying it now, on two different AttBr tabs from two different files, I get two different results:

tinderbox://2017Entry/?view=attributeBrowser+select=3433008781;

and

tinderbox://FactChecks/DATA?view=attributeBrowser+select=1511379442;

FWIW.


(jmm) #7

I don’t get that in the attribute browser of TB 7.3.1, not even in a new document. I can reproduce it manually though, adding the URL of the note to the view type.

But that’s what it does: show a note in a type of view, without opening it in the same level of the Outline view; or, more significantly for the issue here, the same query in the AttBr.