On 16.2.2010 18:38, Chandan wrote: >>> http://src.opensolaris.org/source/search?q=&defs=&refs=lock&path=/clearview/clearview/usr/src/uts/common/io/drm/drm_lock.c&hist=&project=/clearview >>> >>> >>> 4 of the search results that are shown on the results page are in >>> comments, and another 1 is in a quoted string. Clearly, these are not >>> symbol references and don't belong in the results list. Is this >>> documented anywhere as a known bug or a limitation? I can't find any >>> bugs or forum posts about this. >>> > If you search for a symbol and a file is listed, > it means that the file contains symbols. > Otherwise it would not have been listed. > > Lines containing a definition of the symbol have the type of symbol > in bold green on the right end. In this case it says "local". > > The matching lines show all occurrences of the symbol. > If a comment contains the symbol it is most likely > relevant to what is being searched, unless the symbol > happens to be common word. > > It is not exactly a bug, but the code that shows the > matching line does no go deep into parsing out the > comments or string literals. Doing so may slowdown > the results. >
Then it seems like an RFE to me to improve the matcher ... I saw lucene has some kind of highlighter for what we do with Matcher classes ... maybe it'd make sense to do some research and use it instead our own code; because if we have the info about that this is a symbol search and we mark it with green "local" word then Matcher could just print these lines in case a symbol search is done, hmm? Lubos > Thanks, > -Chandan >