WEBAPPS
Search and Filtering
Searching - Advanced Filtering
8min
how to use the use adv search parameter in the webapp include tag, along with a url parameters, to search for within specific fields of an item prerequisites you have created a webapp you have added a webapp list view to a page introduction advanced search allows you to use and or or logic to filter webapp items by specific fields if you are looking to search for webapp items which match any of your search terms in any of their fields using or logic, see searching keyword steps identify the ids of the custom fields that you want to filter by add the use adv search parameter to webapp include tag setting the match type for string fields setting the match type for array fields test by adding a url query parameter build a form to allow users to enter a search query step 1 identify the ids of the custom fields that you want to filter by in the database, each field has an id that is different from their user friendly name in order to use the advanced search, you will need to know the id of the field you can learn more about why we use custom field ids and how to find the one you need for a webapp or module here custom field ids once you've checked that article and found the id of the custom field you need, you can move on to step 2 step 2 add the use adv search parameter to webapp include tag {% include 'webapp' id '1' layout 'my layout' per page '10' use adv search 'true' %} step 3 setting the match type for string fields let's work with a field id of webapp field 1 1 you have 2 options for setting the match type when searching and (default) the search will return exact matches for the search term it receives or the search will return results where there is a match on any of the search terms it receives these terms are comma separated for example, if we have webapp field 1 1=content 1,content 2\&webapp field 1 1 match type=or then we will be looking for items where webapp field 1 1 is either equal to 'content 1' or 'content 2' you can find what type your fields are here step 4 setting the match type for array fields let's work with a field id of webapp field 1 2 you have 2 options for setting the match type when searching and (default) the search will return items that contain all search terms these terms are comma separated for example, if we have webapp field 1 2=option1,option2\&webapp field 1 2 match type=and then we will be looking for items where webapp field 1 2 contains both 'option1' and 'option2' or the search will return results where there is a match on any of the search values it receives these terms are comma separated for example, if we have webapp field 1 2=option1,option2\&webapp field 1 2 match type=or then we will be looking for items where webapp field 1 2 contains either 'option1' or 'option2' you can find what type your fields are here step 5 test by adding a url query parameter now use adv search has been added, siteglide is watching the query parameters for any parameters with a key including "field " it will use these to carry out the search when the page is loaded, so it can display the webapp items which match to see how the filter works, start by manually adding parameters to the url in your browser remember the example custom field id and keyword is unlikely to be found in your unique webapp, so choose something you know is there! you should see your webapp's results adjust as only items which match are returned example 1 https //my website staging oregon platform os com/webapp list?webapp field 1 1=my%20search%20terms example 2 https //my website staging oregon platform os com/webapp list?webapp field 1 2=option1,option2\&webapp field 1 2 match type=or step 6 build a form to allow users to enter a search query you can now build an input form to pass the user's chosen keywords as parameters to the url