Problem with SearchView query - spaces in field value

Hi,

I have a ‘basic’ question with building a correct search query via the searchview option. I create a search based upon values in some fields.

With fields that contain only 1 word the search construction works okej. But when I have a field that contains more than 1 word with a space in between the construction goes wrong.

For example:

Field Release = “01”

Field Company = “My company”

My constructor builds an url that results in the browser:

db.nsf/view?SearchView&Query=([Release]=01)AND([Company]=My%20Company)

which results in NO HITS.

My question is therefor how I must construct the search that it has no problems with fields that contain spaces ?

Thanks in advance for you help!!

KR // Patrick

Subject: Problem with SearchView query - spaces in field value

REplace substring spaces with pluses ‘+’

My+Company will be understood as My Company

Subject: not quite right…

Hej Melissa,

I believe that you suggestion does not result in a proper match.

If my query would be:

db.nsf/view?SearchView&Query=([Company]=My+Company)

it will return documents where company may be My AND/OR Company.

How can I make sure that what I want to search is an actual fit? something like:

db.nsf/view?SearchView&Query=([Company]=“My Company”)

???

Subject: Help

I met the similar problem.There is a field “CardNo” in one document. And the value of CardNo is “SZ00001”,

If I use this querystring “($All)/?SearchView&Query=%5BCardNo%5D+CONTAINS+SZ00001&SearchMax=0&SearchOrder=1”, I can get the right document,

But if I use this querystring “($All)/?SearchView&Query=%5BCardNo%5D+CONTAINS+SZ&SearchMax=0&SearchOrder=1”, it will return no document to be found.

Who can tell me what it is wrong? thank you in advance.

Subject: RenderView.nsf

I found a workaround via:

http://www.openntf.org/Projects/codebin/codebin.nsf/CodeSearch/CE4E03C74EEA21B38625711E0077EADD

Subject: RE: Problem with SearchView query - spaces in field value

Hi I think I know the cause of my problem.

In some documents people have written as company: Company (X)

or

Company (abc)

I believe this causes the problem. Now the searchstring looks like:

db.nsf/view?SearchView&Query=([Release]=01)AND([Company]=Company%20(X))

How must I rewrite the () part in a field in order to make the search working?

Subject: Make sure the correct content-type is set for the search form

The first thing I would check is if the content-type is specified correctly for the page. The content-type can be specified in the HTTP header and in the HTML head of the page in a meta tag.

You can configure these settings in the server document of the Domino server or

  • if you are using web site documents - in the web site document.

Look at the Domino Web Engine Tab at the right column. Finding the correct

settings is not really straightforward, unfortunately.

We are currently using these settings which are working fine for many

multi-language web sites.


Use UTF-8 for output: No

Use UTF-8 for HTML forms: No

Default character set group: Western

Western: ISO-8859-1

Central European: Windows-1250

…

Use auto-detection if database has no language information: No

Character set in header: Enabled

Meta character set: Enabled


If you cannot change these settings you can manuall include a meta tag

specifying the content-type in the HTML Head of your web form:

HTH

Jens