Solved

SearchView  vs. DomainSearch - any equivalent for "contains"

Posted on 2001-06-05
6
454 Views
Last Modified: 2013-12-18
Hi - I'm developing a web search in Domino(5.02) for a one-database application. I'd prefer not to do a DomainSearch as I'm only searching one database so instead I'm using the SearchView method. Domino Help tells me I cannot use the "field X contains Y" facility in a query if I'm not using a DomainSearch - so that rules that, very sadly, out for my Searchview method.

Does anyone know of an equivalent for this "contains" part of a query for Searchview?

It would be a shameful restriction otherwise. Or maybe I should be using DomainSearch - but I don't think that would  suit me for this single-databased application.


Much appreciation for your thoughts in advance, nOLOco.
0
Comment
Question by:noloco
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6157000
I suppose you can do that.

Here is a tip that I found on the net, not sure of the source:
==================================
Create a form named "Search Form" with simple text fields that will be used to refer to the Notes fields of the documents in the
"Search View" below. Name these fields form_Field1 and form_Field2 which correspond to Notes fields named Field1 and
Field2. Add a field named "SaveOptions" with a default value of "0" (with the quotes) so the form is not saved when submitted.

Put a $$Return field that is computed for display at the very top of your search form with a formula of:

  tField1 := @Trim(form_Field1);
  tField2 := @Trim(form_Field2);
  a := @If (tField1 = ""; ""; "([Field1] = " + tField1 + ")");
  b := @If(tField2 = ""; ""; "([Field2] = " + tField2 + ")");
  SearchFields := @Implode(@Trim(a:b); " AND ");
  REM " *** Empty search will return everything ***";
  SearchString := @If(SearchFields = ""; "*"; SearchFields );
  db := @Subset(@DbName; -1);
  view := "Search View";
  REM "*** Replace spaces with '+'s ***";
  SearchView := @Implode(@Explode(view; " "); "+");
  @Return("[/" + db + "/" + SearchView + "?SearchView&Query=" + SearchString + "]")

To initiate a search, provide a link somewhere that with Action hotspot of

  @Command([Compose]; "Search Form");
==================================


Basically appending query string with [Field1] is the trick to search specific field.

~Hemanth
0
 
LVL 5

Expert Comment

by:snocross
ID: 6157247
Listening...
0
 

Author Comment

by:noloco
ID: 6158839
I don't believe that is a solution for my problem.
The code above will only search for a match of the ENTIRE contents of a field... i.e. if FIELD1 = "ABC ... WXYZ";
However I want to search a field for any possible substring therein...
For example:
FIELD1 = "Try to resolve this problem"

I want to be able to somehow search if FIELD1 CONTAINS "solve". (which it does in this example).

But my problem is I cannot add the 'CONTAINS' keyword to a search query if I'm using SearchViews, I could only use it if I was using DomainSearch (which I want to avoid).

Wouldn't you agree Hemanth?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:noloco
ID: 6158897
It would appear the answer has been a lot more simple than I thought. If I use a wildcard as follows:

field FIELD1 = *solve

and put that in the query string - this seems to do the equivalent of a CONTAINS ... in other words this will return every record in the database where FIELD1 contains the text "solve"!!!
I've checked this on R5 and that's what happens.
Maybe it was a silly question for starters - but it seems peculiar to me that the product provides 2 seperate options (wildcards AND CONTAINS) where one of them can do both.
Sorry for the hassle everyone - thanks for your efforts though - as always much appreciated.

nOLOco (well... maybe a bit)
  -
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 100 total points
ID: 6161818
Your only bet would be to write an agent to collect all the documents in the folder and open it.

0
 

Author Comment

by:noloco
ID: 6162899
My last entry on this was the answer I needed so I'll just close this off.
Thanks for your assistance anyway Hemanth.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus Notes to MS Exchange mailfile migration 4 43
Lotus notes email code 2 119
SQL Server linked server to Lotus notes 3 458
Notes > Exchange calendar issues 5 61
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now