Bug 169252 - Store Previous Searches for Startup
Summary: Store Previous Searches for Startup
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 3.2.1   Edit
Hardware: All All
: P5 enhancement with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-Search-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 277446 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-29 14:16 EST by Zachary Calvert CLA
Modified: 2016-03-16 03:03 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zachary Calvert CLA 2006-12-29 14:16:40 EST
ISearchQuery objects should be automatically stored on the close part of the search result view and restored at the open if the ISearchQuery implements serializable.  Basically, if I perform some type of resource search for the word "test", storing the results is quite possibly too much data, but storing the ISearchQuery itself should be fine.  This comes in handy when there is a common search you perform every time you load up the Eclipse APP.  It is really important for my application to startup with the "Run last search" and search history to be populated on startup.

I can't even figure out if there is a way to get a handle on the search query list to add to it without actually running the query on startup.
Comment 1 Martin Aeschlimann CLA 2007-01-03 03:47:00 EST
This is not planed in the near feature. Help would be welcome.

I think you're right, the only thing to be stored would be the query.
Restoring the history is not a big problem. Automatically restoring the search when the search page is loaded is not always desireable. So this should be configurable. Or as a alternative to an automatic restore, just show a link in the view 'Restore last search...'.

Comment 2 Zachary Calvert CLA 2007-01-03 10:13:24 EST
I'm interested in implementing this feature.  I would like a little direction before I get started, though.

First off, where should I be listening for the close event and where should I add the listener?  Should I add it to SearchResultsPart in org.eclipse.help.ui.internal.views on the init method, or on the constructor?  Should the listener be an application close event, or should it be a page close event?

Second, where should I be serializing these queries?  As in what file should I use?  The IDialogSettings does not support object serialization, nor does the IPreferenceStore.  Got any ideas?
Comment 3 Martin Aeschlimann CLA 2007-01-03 10:39:24 EST
That would be in the org.eclipse.search plugin (don't confuse with help search).

I would persist the history every time it is modified. I would store it in an own file as it isn't a preference and not a view specific (multiple search views show the same history).
Put the file inside 'SearchPlugin.getDefault().getStateLocation()'

The search history is managed in org.eclipse.search2.internal.ui.QueryManager (fQueries) and I would add the persitence code directly in there.
Comment 4 Dani Megert CLA 2009-05-25 03:08:41 EDT
*** Bug 277446 has been marked as a duplicate of this bug. ***
Comment 5 Piotr Dobrogost CLA 2010-05-12 09:57:43 EDT
Anything new in the subject?
Comment 6 Dani Megert CLA 2010-05-12 10:02:56 EDT
>Anything new in the subject?
Nope. Waiting for someone who provides a patch.
Comment 7 leokom leokom CLA 2016-03-16 03:03:13 EDT
This should be an option I think (so if a user wants to preserve search results across restarts he should enable this in Preferences).
Anyway : really nice feature.