Search for an exact phrase with InstaSearch for Eclipse - eclipse

How can I search for an exact phrase in Eclipse instasearch?
When I search for
one two
it will find also files that contain only one. And the file containing the exact phrase is not at the top of the result list.
UPDATE:
#Ad Infinitum suggested to turn off the option:
Find similar matches when no exact matches found
but strangely it does not work as you can see from the screenshot:

Instasearch is already looking for the exact match. However, if it cannot find an exact match, it looks for the alternatives. If you only want to display the exact match, there is an option, which you can unmark the fuzzy search, in the instasearch's preferences.
In order to get the instasearch's preferences.
Window -> Preferences
when the Eclipse's preferences dialog is openned, you can write instasearch in the search text field, which brings you the instasearch preferences.
I hope that is the option, you are looking for.
EDIT
When this option is unmarked, the results will be something like that if there is no match. 0 matches and under of it, there is more selection, which shows the fuzzy search results.

Related

How to configure "Find text in workspace" search (Ctrl-Alt-G) in Eclipse?

I find the hotkey Ctrl-Alt-G very useful and I often use it. But unfortunately I could not find a way to configure it to:
search for whole word only (searching my_var also finds my_var_2)
search only in certain files (*.c and *.h in my case, it finds occurances also in .map and .list and so on)
do a case sensitive search
I know how to set these up in standard search window (Ctrl-H) but that has no effect on Ctrl-Alt-G.
Thanks for any help

In Eclipse, how can you search within a search result?

"Long live the Unix Pipes".
Since I am working with Eclipse IDE, I would like to perform search within search results. Is that possible? How can I do that?
Ex:
Search for references of User (class).
> Search for validation in this result.
> Finally, search for specific pattern.
This is possible in Eclipse, well as far as the version I am using which is Eclipse Juno 4.2.2; I've used this extensively for impact analysis.
For example:
Search using "File Search" with criteria "employee"
The results will appear in the Tab "Search", assuming you are in the tree view (by default), click the root folder
Again, use the "File Search" this time using the 2nd criteria, for example "default" and making sure to click the Selected resources radio button
Effectively, this searches the keyword "default" from the previous search results produced by searching "employee".
Is it really required?. If you are searching any key in the search results then why don't you use it as search key in previous search itself?.
Eclipse search supports regular expression so you can use multiple search words likes key1 or key2 or key1 and key2 etc to narrow the search results.
Refer this Eclipse File Search Dialog - Regular Expression for Group Unions and Negation
However
You can search in search results with the help of some plugins check here. Take a look at Insta search and glance(Suites for your need) plugin.
Search result can also be exported with the help of this plugin
You cannot. And I am 99% sure of this.
But, just for your info, you can do reference search by pressing Cntrl + G on class name, or method name.

Show search matches in Eclipse?

Currently I see, that search window shows the method name where sought text found and the number of matches:
Is it possible to display matches itself, or their excerpts? I remember I have seen this in some IDE and was sure it was Eclipse. But currently I see none.

Simple eclipse search problem

I use the eclipse File Search option very much to search all files in my workspace for a certain content. But how do I specify that it should only return hits from a fixed search criteria? As an example I would like to find all occurrences of the string:
com.mystuff.data
but I also get all the hits for:
com.mystuff.data.ui
How do I make a "this-string-only-search" when searching files in my workspace??
If I understand you correctly, Eclipse don't provide option to search exact word.
You can use regular expression for it.
You can use \bSearchKeyword\b to find exact word.
I suggest that you use regular expressions.
Here are the steps:
Select the checkbox "Regular expression" which is located beside the "Containing text" field.
In the "Containing text" field write: com.mystuff.data\D\W
Note that:
\D means "no digit"
\W means "no alphanumeric"
In case you would like to refine the regular expression, click Ctrl-SPACE, in order to get the regular expression assistance.
Hope this helps.
Best regards
Maybe slightly off-topic but this got me tripped and brought me here - maybe useful for somebody else:
In the Eclipse standard Find/Replace dialogue the section 'Options' (that includes the option 'Whole Word') may be hidden if the Find/Replace dialogue window was previously resized to a smaller size, without any clue to its presence. Resizing it larger brings back the options section. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=355206
and attached shots.
Eclipse standard Find/Replace dialogue search for Whole Word regards several characters (including period) besides a space as a word delimiter, so you indeed cannot distinguish between "com.mystuff.data" and "com.mystuff.data.ui"
E.g. search 'Stack' with option 'Whole Word' checked:
will match:
Stack
Stack overflow
Stack.overflow
Stack,overflow
Stack[overflow]
Stack(overflow)
Stack-overflow
Stack/overflow
will not match:
Stackoverflow
Stack2overflow
Stack_overflow
Simplest way is to add space in the start and end of your search term.
Try SHFT+ CTRL+R, then on right upper angle select Working Set, then name and specify your resources.
Create Work Set as above, then CTRL+H check checkbox All occurency, then select your Work Set. Or maybe you can create work set in CTRL+H.

Why would eclipse not show search results inside file in results list?

We have one installation of Eclipse which does not show the individual lines on which search results occur as do all other installations, as shown here:
How can we turn on this feature so that individual results in each line are shown?
I think it's a question of what tool you are using. If you do a text search, you get one line per hit. But if, say, you look for references to a Java method, you get one line per file.
Although it seems like a perfectly desirable thing, I can't find any way to get Java search to return one line per hit.
In the preferences of the Search window (usually button with triangle icon) choose "Show as List" item