How can I delete duplicate hits from a text search
Hey, folks! Boy, I'm posting lots of questions today! I hope all this helps other people as much as it's been helping me!
As I continue to work on my text search tool for my company's product documentation, I come upon the next of many challenges: Once I have a complete list of all search hits, how do I delete duplicate items from the second column of a List View object?
So, presently I have a Fast Loop set up that all the file search hits are placed into the second column of this List View object. My mind thinks that it would then be wise to immediately start another Fast Loop to delete duplicate items before the contents of the List View object is displayed.
How would I do that?
I started messing with the Stringsort X object, but I'm not sure if I'm proverbially barking up the right tree with that object. So, I thought I'd cut to the chase and ask the gurus here!
As always, thank you again for all your help!
Most graciously...
RGBreality
Re: How can I delete duplicate hits from a text search
When you fist loop the items in from the search results array, you can add them to a string somehwre. If that string is the same as the current find, then don't add it. ;)
Re: How can I delete duplicate hits from a text search
So, let me see if I get this right...
1.) On the "On File While Browsing Loop" condition, I would change a "Global String" to "Read the Current String of the Array"
Then...
2.) On the "On Loop 'Search'" condition, I would add another condition which reads, If the "Global String" is "Different" than the "Text of the List View object at Row 0, Column 2" then write that search hit to the List View object.
If I wrote "Item 2" (above) to read that they were the same (or equal), then ultimately no search hits would be displayed in the List View object...
Would that be correct?
(Boy, my brain is turning to mush!)
RGBreality
EDIT: Well, it seems I must have gotten it wrong, since it made no difference in my search results! (D'oh!)
Re: How can I delete duplicate hits from a text search
OK, you're not doing this during the searching process. You are looping through the array of search results and checking of the current array search result path <> than the last one, then add it to the listview.