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

Question

Question

Setting the Order of Search Criteria

asked on April 15, 2014 Show version history

 

I've created a saved search with Name, Text, and Within Folder search criteria added in that order.  When I load that search again, the order of criteria in the left pane has changed to Text, Within Folder, then Name.

 

Is there a way to "fix" the criteria fields so they always display in the preferred order in the left pane?  Usually staff don't change the Within Folder setting, and I want the Name field, which is used the most at the top.

 

BTW - This is happening in Web Access.

0 0

Answer

SELECTED ANSWER
replied on April 15, 2014 Show version history

I'm looking into this, and I'm not yet sure why it does not always save the search in the order you create it. I was able to reproduce the issue the first time I tried, but subsequent times I saved the same set of search types, the order was preserved. What version are you on? Was that version upgraded from anything else?

 

To fix your current searches manually, you can modify the xml of the user attribute [WEBACCESS]SavedSeaches. EDIT: As Andrew noted below, there may be multiple attributes. See his post for more info. It's a good idea to back up your user attributes using "Export" before modifying them.

 

The user attribute should look something like this:

<?xml version="1.0" encoding="utf-8"?><SavedSearches><RepositorySearches Database="DBName"><Search Name="YourSearchName" BasicString="" SearchText="" SearchNames="" SearchFields="" SearchAnnotations="" SearchCustom=""><Attribute ID="Text"><Word1>YourTextSearchTerm</Word1></Attribute><Attribute ID="SearchFolder"><Item_0>1,RepoName\FolderPath</Item_0><CurrentFolder>0</CurrentFolder><Subfolders>1</Subfolders></Attribute><Attribute ID="Name"><String>YourDocumentName</String><Comparison>Exactly</Comparison></Attribute></Search></RepositorySearches></SavedSearches>

The order of the Attribute nodes determines the order the searches load in. Simply move everything between (and including) the <Attribute ID="Name"> and </Attribute> tags to before the <Attribute ID="Text"> tag, and the search should load in the correct order.

 

You should end up with something that looks like:

<?xml version="1.0" encoding="utf-8"?><SavedSearches><RepositorySearches Database="TheDangerZone"><Search Name="NameTextFolder" BasicString="" SearchText="" SearchNames="" SearchFields="" SearchAnnotations="" SearchCustom=""><Attribute ID="Name"><String>Name</String><Comparison>Exactly</Comparison></Attribute><Attribute ID="Text"><Word1>Text</Word1></Attribute><Attribute ID="SearchFolder"><Item_0>1,TheDangerZone\Brianna</Item_0><CurrentFolder>0</CurrentFolder><Subfolders>1</Subfolders></Attribute></Search></RepositorySearches></SavedSearches>

 

1 0
replied on April 15, 2014

Note that if you have many saved searches, the text of this attribute may be broken up into several attributes, named [WEBACCESS]SavedSearches0, [WEBACCESS]SavedSearches1, etc., because individual attributes have a maximum length.

 

If you need to edit the attribute contents in this case, you can copy them all into a single text file, one right after the other, and then edit that.  When you're done, split the results back up into pieces.  It doesn't matter where they're split up as long as none of the pieces are too long (I don't recall the length limit offhand, but it looks like they get broken at around 2100 characters).  If you have to add more pieces, be sure to adjust the value stored in the "MULTI-ATTR:n" part of [WEBACCESS]SavedSearches.

2 0

Replies

replied on April 15, 2014

Editing the [WEBACCESS]SavedSearches properties to shift the <Attribute> xml nodes around did the trick.

 

Thanks.

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

Sign in to reply to this post.