You are viewing limited content. For full access, please sign in.

Question

Question

Search Syntax

asked on August 2, 2019 Show version history

Happy Friday - 

I'm trying to narrow our search forms so they word field only searches entries with a specific template. I thought I had it by constraining with just the template name but that didn't work. I'm looking for confirmation or guidance on solutions. My two current candidates are using the ParentTemplateName constraint or creating a hidden field using TemplateName. Thanks in advance.

 

Allan

0 0

Replies

replied on August 2, 2019

As long as the syntax is correct, a template name search will only return results with that template.

What was the syntax you tried using?

It is possible that the template name was part of an "OR" instead of an "AND" condition, in which case you would get everything with that template plus everything that matched your other criteria.

2 0
replied on August 2, 2019

I think we've got it - I was trying to add constraints in the wrong place - I think.

 

0 0
replied on August 15, 2019

Sorry to bother you about this one again, but we're still struggling. Is it correct to put the template restriction within the search query information for the given field? Still trying to narrow possible errors. Thanks.

0 0
replied on August 15, 2019 Show version history

Hi Allan, 

Could you share your search syntax and search form? It's much easier to work from the actual search syntax when helping troubleshoot. I'm also not clear what you are trying to search on aside from the template itself.

You can replace/cover up any sensitive values, but leave all the quotes, parenthesis, etc. in place.

 

Below are some examples of template-specific searches.

Document text (not exact phrase) with specific template:

({[TemplateName]}) & (Your Search Terms)

Searching for one of two different fields with different values on the same template:

({[TemplateName]:[Field1]="Your 1st Search Term"}) | ({[TemplateName]:[Field2]="Your 2nd Search Term"})
0 0
replied on August 15, 2019 Show version history

That makes sense, sorry. The form is attached and can be accessed here. The intent is to either search records in a specific series, or with a specific template assigned by keyword terms.

The issue I'm encountering is that the "keyword" field is a custom text input field. Thus far I've not been able to restrict it to searching content with a specific template assigned or in a specific folder/series. 

0 0
replied on August 15, 2019 Show version history

I wasn't able to load your site, but I do have an idea for where the issue might be: the Search Query structure under "Search Results" in the WebLink Designer.

 

Below is my own example:  searching on EITHER the modification date OR (keywords from a custom field AND has template of City Council Minutes)

The %(keywords) token comes from my custom text field:

 

The important part here is how the tree is structured under Search Results. Notable behavior:

  • By default, all non-custom fields will be added and will use the "any" option
  • Any consistent parameters that you don't want to show to the user can be added here, like my example template "City Council Minutes"
  • You must add the input from custom fields using their Variable Name in the format %(Your Variable Name Here)
  • To use the template to restrict only one of your inputs (or a few) you must "Add Group", drag those inputs under that grouping, and change the group setting to "Search for entries that meet all constraints"

 

You can see in my example that the template (which is not shown on the search form itself) is grouped with the custom input, but is separate from the modified date. As such, users will either be searching on modified date, OR for keywords within documents that have the template City Council Minutes

1 0
replied on August 2, 2019

The syntax I used on a custom input text field was {[TemplateName]}. My understanding was that it would search records with that template rather than templates with the defined value. I think I understand now that they have to be two separate fields on the form, but the question is how to make the hardwired one hidden. 

replied on February 5, 2020

Hi:
I have been able to add Search Syntax to a WebLink search to limit my search results to specific folders, but I was wondering if there might be a way to:

1) Limit my results to documents only (as you're only able to search for {LF:Name="*", Type="D"}, but not the actual Document Type by itself)?
2) Specify a previously-used search item as a token within Search Syntax (i.e. to use it to build a more powerful and targeted search)?

Thanks in advance for your assistance - this is good information!

Marty Gaffney
Town of Okotoks

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.