Skip to main content

Incorrect highlighting in Search

4 replies [Last post]
ped
Offline
Joined: 2006-02-13
Points: 0

In our first prototype, our write produced 3 separate
helpsets. I had a master helpset, which specified the
3 sub-helpsets. Searching worked fine.
Then the writer merged all of the help into one helpset,
which my master HS file points to. Now when we search,
it appears as tho the correct sections of the manual are
displayed, and I believe the counts are correct for
each section, but the highlighting is off. It's usually
in the same line as the searched text, often several
characters before it. It works the same (improperly)
in your demo helpviewer.
I'm not even sure where to look to fix this. Any ideas?
Below is a portion of my master HS:

Search
Search
javax.help.SearchView

And below is a snippet from All.hs:

Search
Search
javax.help.SearchView

JavaHelpSearch

Thanks for any suggestions,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ped
Offline
Joined: 2006-02-13
Points: 0

We have discovered the problem. Our doc writer added
a title at the beginning of each chapter by hand after generating the search DB. This threw the highlighting off by the size of the title.
Once he removed the title, the search highlighting worked correctly.

But we still see the behavior that an unsucessful search clears the left-hand panel, but leaves the current text displayed in the right-hand panel. I believe this is expected behavior.

Roger Brinkley

javahelp1@JAVADESKTOP.ORG wrote:
> We have discovered the problem. Our doc writer added a title at the
> beginning of each chapter by hand after generating the search DB.
> This threw the highlighting off by the size of the title. Once he
> removed the title, the search highlighting worked correctly.
>

Humm. Make sure that the search database is being created on the same
JRE as the help is being displayed in. There are small changes in the
rendering that make the positions change. (Sometimes I wish I had never
done highlighting...or at least not the way I did it)

> But we still see the behavior that an unsucessful search clears the
> left-hand panel, but leaves the current text displayed in the
> right-hand panel. I believe this is expected behavior.

Yes this is expected behavior.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

ped
Offline
Joined: 2006-02-13
Points: 0

While waiting for a suggestion on this, I'll add another note. The highlighted text is not unselected if the user
issues another search request that doesn't find anything.

I believe this worked correctly when we initially tested
our help docs.

ped
Offline
Joined: 2006-02-13
Points: 0

I also noticed that:
- The highlight is the correct size (e.g. if the
searched word is 8 characters, the (incorrectly)
highlighted text is 8 characters long)

- The highlight usually ENDS exactly 10 characters
before the searched string occurs in the text.
(must be one of them 'off-by-ten' bugs, huh?)