Fix to remove the 2000 character limit for searches (Ask around you before doing this!)

Why

Web requests may fail because the url is too long when GET method is used. Also even if this is fixed when the request is for SearchService the execution may fail because of a 2000 character limit for query input parameters.

Specifically this is a problem in DAM 4.7.x when Digizuite_System_Framework_Search contains a lot of customer metafields. When this happens the UI will not load in turn makes any change impossible as there is no other way to generate a new Solr core and population will always fail if the core has not been created.

Solution

Web.config edits

The line numbers referenced are taken from the straight-out-of-the-zip version and may vary if manual changes has been made. However, both tags exist only once.

  1. Web.config line 32: look for the httpRuntime tag. It should look like this: 

    <httpRuntime maxRequestLength="2048000" executionTimeout="120000" requestValidationMode="2.0" />

    Add these attributes: maxUrlLength="16384" maxQueryStringLength="16384".
  2. Web.config line 253: look for the requestLimits tag. It should look like this:

    <requestLimits maxAllowedContentLength="2000000000" />
    Add these attributes maxUrl="16384" maxQueryString="16384".

  3. Save the web.config. These changes mean the webserver will accept GET requests with a url length up to 16kb.
SQL Stored Procedure edits
  1. Connect SQL Studio Manager to your database.
  2. Execute this select: 
    select search_versionid from search s inner join search_version sv on s.searchId = sv.searchId where s.name = 'GetMetafieldLabels'
  3. There should be only 1 result as this search only exists in DAM product and is not customizable. Make a note of the search_versionid.
  4. Now find the stored procedure which should be named:
    SearchSP_search_versionid_isValueInUse
  5. Right click then Modify
  6. Line 15 should look like this (theoretically the line number can vary depending on some SQL template but the line we're looking for looks like this):
    ,   @itemGuid nvarchar(2048)
  7. Change 2048 to MAX and execute.