Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to search in a notes documents database exluding some fields

Status
Not open for further replies.

nimapoggy

Programmer
Mar 4, 2002
34
FR
Hi !
I wonder how to search in a notes documents database using certain fields but not all.
My docs contain some fields like title, text content... but also notes fields like author.
When I search for docs where the "foo" word exists, the result contains all the docs where the "foo" word apear in title and text fild but also wher autho is called "foo" (I know it's a strange name for an author, but it's an example...)
So I want to search excluding the author fiels because all the docs are created by "foo", so the search returns all the database docs...

Please help !
Nico

I'm using note v4
 
Cool, it's a good step... but it works only if I search ONE word...

If I search for multiple words, I need to make a query for each word

ie:
If I search "Foo Bar", the query must look like this : FIELD Name CONTAINS "foo" OR FIELD Name CONTAINS "bar"

In this example, I search only 2 words into 1 fields, but there's 13 fields... Imagine the mess if I search more than two words...

So, Can I exclude a Field from a search or call the fields and then call the values to search.

I write you the querys I would like to make in plain english :

"search for doc wich contain words "foo" or "bar" in field name or in field address or in field email or in field office"

It can also look like this :

"search for doc wich contain words "foo" or "bar" in all the fields except the Author field"

Is there any way to do this ?

I found a way to turn round the problem that uses HTML forms and JavaScript (it's a web site using domino with a note documents database)
this way is to make a form with a text field for each notes field.

a name field
an address field
a phone field
...

So the user would enter only one word, or phrase (fo the address) but does not mix contents.

So I can use a simple query (as shown above) tha looks like this :
FIELD Name CONTAINS "foo" OR FIELD Address CONTAINS "bar" OR FIELD Phone CONTAINS "32 45"

But this uses a client script because we need a JavaScript function to concatenate the query and send it to the notes search page.

I would prefer to use a server side solution... it's more compatible.

Thanks for all.
Nico.
 
If you are able to make design changes why not add a computed field NameAndAddressEtc with a formula of:
Name + " " + Address + " " + etc

Then search using:
FIELD NameAndAddressEtc CONTAINS "foo" OR
FIELD NameAndAddressEtc CONTAINS "bar"

-or-

Instead of using the FTSearch method you could use the Search method of NotesDatabase which has a formula argument. So you could use @Contains to find a string in the concatenated fields or use @IsMember to find a word in a list produced by exploding the concatenated fields with spaces.

Dale You can find me at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top