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

Question

Question

Using "And" or "Or" in a WebLink Custom Search based on "Any Text"

asked on April 28, 2014

In the QuickSearch portion of WebLink 8.2.0 you can use "and" or "or" to narrow your searches.  For example I could search for documents that have Central and Library or Central or Library and it could return a different set of search results.  I am trying to create this same functionality in a Custom Search form but not having any luck.  I have tried creating an input box with a search type of "Any Text" but this does not recognize and or or in the same manner as the Quick Search. Has anyone found a way of the site user typing in a phrase into a custom search in the same manner as in the Quick Search box and having it utilize and or or?

 

0 0

Replies

replied on May 1, 2014

Custom text searches like these are doable with fields set to 'Custom Variable' and custom constraints. In the example below, I created two fields: 'Field 1' and 'Field 2'. Both were set to the 'Custom Variable' option. Field 1 had its custom variable set to 'field1', and Field 2 was set to 'field2'. 

 

 

Once the fields were created, I created a custom constraint. When you create fields and set them to a specific search type or field, constraints are automatically created. Fields set to custom variable do not have a constraint created; instead, the information captured in the field is available as a token. We define what we want WebLink to do with that token through constraints. Constraints use the same search syntax that the search pane in the Laserfiche Client. In this example, I set it to search for all documents with the contents in 'Field 1' OR the contents in 'Field 2' in the text. Note that I called the contents of the fields using the custom variable name I defined for my field.

 

 

Advanced Search Syntax is covered in detail in the Laserfiche Client help files. This page has the syntax for full text searches. The best part of using search syntax is that you can use any combinations of ANDs and ORs that you'd like, and include other search types as well. The sky is the limit!

 

More information about customizing the search query for custom search forms in WebLink can be found in the WebLink 8.2 help files.

1 0
replied on May 5, 2014

I understand I can do this with multiple fields.  The customer is wanting to have a single field where they can put "john and smith" to get documents that have both or use "john or smith" to get documents that have one or the other.  The search on the Welcome page works like this in that it properly recognizes "and" and "or".  They want a search box on the customer search page that functions in exactly the same manner.

0 0
replied on April 30, 2014

I tried creating a custom search form to allow for "and" or "or" but I wasn't able to. The main problem I was running into was the fact that I couldn't map more than one input to a value that already exists. I originally planned on creating multiple search input boxes all mapped to the same "Any Text" value but that didn't work. I think currently the only way to apply the "and" or "or" statement would be through the quick search box. I'll let the team know and see if that's something we can have for a future release. Thanks for your input!

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

Sign in to reply to this post.