searchView Query where field equals a value - problem

I am trying to create a URL to dynamically to filter data in a view based on multiple fields. I am running across a problem where the [FIELDNAME]=VALUE is behaving like a CONTAINS instead of an EQUALS. For example, VIEWNAME?SearchView&Query=([Company]=XYZ) is returning documents for company XYZ and company XYZ International, which are in fact two different companies. I tried using quotes around the “XYZ,” but that did not work.

Previous posts on this issue suggest using a single-cat view, but I cannot do that because I am filtering on multiple fields. Looks like this has been an issue for a while; just wondering if anyone has found a solution recently. If all else fails, I can do Query=([Company]=XYZ) AND NOT ([Company]=XYZ International), but good-grief, what a pain.

Any other ideas? Thanks in advance.

Subject: searchView Query where field equals a value - problem

I actually had the same problem and found that there’s a very simple fix. You just need to place the value in double quotes or your can use %22 if you want.

BEFORE

&query=[FIELDNAME1]=VALUE AND [FIELDNAME2]=VALUE

AFTER

&query=[FIELDNAME1]=“VALUE” AND [FIELDNAME2]=“VALUE”

&query=[FIELDNAME1]=%22VALUE%22%20AND%20[FIELDNAME2]=%22VALUE%22

Subject: searchView Query where field equals a value - problem

I feel your pain. In my work with url based searching it is very generic. Specific searching can be as tedious as you have mentioned. Also, keep in mind you are allowed only, what was it, 128 or 256 characters, I think 128, before the whole thing fails.

Yeah, fun!

For complex searching I’ve used LotusScript and then used a form that displays the search results. It looks just like the search results view. You can spit out the results in HTML into a RichTExt field on the form using a WebQueryOpen/WebQuerySave agent. If you are worried about “saved” documents in the db you can always compose your parameters and pass them via CGI (inside the url) to the agent, either as open text or base64 encoded text. Either that or flag the document as “deleted” using a field. Have a scheduled agent clean up these “deleted” documents daily.

Just some thoughts.

Tim Williams

Subject: RE: searchView Query where field equals a value - problem

Sorry, that’s incorrect information. Queries can be much longer than 256 chars. Individual search strings within the query are limited to some smaller length, probably 128. You are limited by the maximum length of a Domino URL, which is around 1 or 2K. Note, however, that you can submit a form containing the data you would use to build your query, and the information here can be much larger.

= and CONTAINS mean the same. There’s no full-text syntax for “exactly equals” for text fields.

You could create a form webquerysave event or some such, which concocts the query based on the values selected in the fields, does the search, and presents the results as a report containing links. This gives you an opportunity to further filter the results if you want to eliminate documents which aren’t an exact match.

Subject: RE: searchView Query where field equals a value - problem

Ok, Andre, I’ll give you that. “You are limited by the maximum length of a Domino URL” so the defaults in a server document make the string very limited. From my standpoint, since I develop applications used my many varying customers, I just tell myself limits because there’s no way we can get all our customers to tweak their server documents to accomodate us.

So my original recommendation still stands. Don’t bother with Query in a url unless you’re willing to keep it simple, short, and confined. If you are using any method that allows users to choose preferences for the search it can quickly expand beyond your allowable url limits. I’ve found the “built” views returning search results works best. More work, yes, but more rewarding too.

Just some thoughts.

Tim Williams

Subject: searchView Query max length is 512 characters?

Mostly for my own reference:

It appears that at least for Domino 7.0.3 FP1 on Linux there is an absolute limit of 512 characters for the query in total. Still pretty easy to touch this limit.

Maximum URL length is set to 4 kilobytes in our server document.