ajermakovics / eclipse-instasearch

Eclipse plug-in for fast code search
http://marketplace.eclipse.org/content/instasearch
Eclipse Public License 2.0
170 stars 48 forks source link

Feature Request: Exact match search #13

Closed DaemonF closed 12 years ago

DaemonF commented 12 years ago

There ought to be a way to force exact matches only rather than falling back to fuzzy search.

Use Case Example: Re-factoring sting constants that hold CSS class names out of code files. Project Type: Java / Google Web Toolkit (HTML / CSS / javascript)

I need to quickly search for all exact-match instances of a specific hard-coded CSS class name string in order to replace those string constants with a reference to a global static variable. The strings may contain non-alphanumeric characters such as hyphens and underscores which also need to be matched exactly.

Your extension does search the large project very quickly, for which I am grateful, but it matches items which don't match the search string. For example, searching "sidebar_widget_body" returns results for class names like "SidebarWidget" as well as even less exact matches. Fuzzy matching is great in many ways, but there should be a toggle to disable it!

Thanks, -DaemonF

ajermakovics commented 12 years ago

Hi, It will do the fuzzy (similar) search if it can't find exact matches. You can disable similar match search in the plugin's preferences.

So "sidebar_widget_body" should get exact matches (please reopen the ticked if it doesn't). Words containing hyphens will be split at hyphens so exact matching won't work on those.

Regards, Andrejs

DaemonF commented 12 years ago

Wow, I completely missed that option in the preferences dialog, sorry! Still, Its a shame that hyphens aren't in the index's character set... They come up a lot in CSS and HTML. I assume that the index uses an intentional limited character set with something like a n-tree implementation, so it probably wouldn't be feasible to open it up to full UNICODE support without changing its data structure. If each node had a hash map from char to node it could do it, but at the cost of tons of memory...

Anyway, thanks for the quick response! -DaemonF

DaemonF commented 12 years ago

Hmm, even with the option for automatic fuzzy search turned off, I still get results like these: Screen Shot Even though fuzzy matching is off and the search term "newFriends" has only legal characters, only results 1-4 and 6 contain the phrase.

ajermakovics commented 12 years ago

Hyphenated words are now supported in version 1.4

DaemonF commented 12 years ago

Wonderful! Thank you!