FTSearch - Multivalue field query

I need to amend the search criteria of a full text search from Script to check if a particular field has more than one value, & if so to stick it into a different report.

The possible values are:

Whole blood

Red Blood

Platelets

Plasma

If both Red Blood & Platelets are chosen then that document should fall into the ‘Other’ pile.

The app monitors & reports on blood related incidents, e.g you were given the wrong type of blood. Hence the user does not want the incident to appear both under Red Blood & Platelets because it would be counted twice.

Its easy to find docs where any one value has been chosen, but has anyone any ideas about how to find the combinations (I’m hoping to avoid coding all 6 of them).

Thanks for any help

Sue

Subject: RE: FTSearch - Multivalue field query

There is nothing in the full-text search syntax that lets you limit search results to those documents where a particular field is not multivalued. You could, as you say, create a complex search that uses all the combinations. Or, since you are writing script code, you can do FTSearch without worrying about duplicates and then iterate thru the search results, removing any documents from the collection that do not meet your more restrictive criteria.

One other thing you might want to look at for preventing duplication; I don’t know how you are generating the report, but read about the List datatype, which is very handy for keeping keyed lists. In situations where it might be complex to determine whether the document has already been reported on, you could Dim AlreadyReportedOn List As Integer and use the note ID as your key. Then when you are about to add a document to the report:

If Not IsElement(AlreadyReportedOn(doc.noteid)) Then

AlreadyReportedOn(doc.noteid) = 1

’ add to report

…

End If

This of course assumes all your reports are generated by a single agent. The advantage of this is that it’s easier to validate in a design review that each document that should be in a report, is included exactly once. I assume there’s a requirement here for extreme reliability in generating this report.

You might also build the reports in parallel – do a single search that returns all the results that you need to report on, and iterate thru the results adding each document to one report.

Subject: Thanks Andre

Thanks, that gives some more ideas on how to archtect the solution.