The elasticsearch provider returns an empty
result when elasticsearch throws an error
(probably a bad request). This prevents the
aggregator from thinking that ES is loading
infinitely.
The aggregator now returns a result object similar
to that of the providers, but the hits array contains
domain objects rather than searchResult objects.
Also removed overly complicated filterRepeats
function from the aggregator and replaced it with a
simpler one.
The provider now returns an object that has
a hits property which contains what it
previously returned, and also a total property
which contains the total number of results.
Removed the name field from the ElasticSearch provider
search query string, so now it will check all of the
fields of the domain object (such as type).
Updated comments and documentation. Changed the generic
worker to return results as {id: score} key value pairs
rather than {id: {score: score}} format. Removed unused
getLatestResults and getLatestTimestamps functions from
the providers.
Removed the timestamp as an optional parameter
of the search aggregator's query(), and now it
instead automattically generates one before
querying the providers.
Also attempted to fix loading, but did not
complete (commented out).
The search service's interface now just consists
of the two functions query() and isLoading().
query() returns a promise for an array or results,
which eliminates the need for timeout polling like
was previously done. The search providers
have also been changed to reutrn promises.
Cleaning up code in generic serach provider. Removed
unnecissary return statements. Moved indexing via web
worker from getItems() loop to within itemsHelper().
Commented out timeout, becuase seems unnecissary.
Changed all date.getTime() to Date.now(). Indexing
has undefined checking.
Changed the generic search provider to index the
file tree only once when it is initially called.
This assumes that the contents of the file tree
will not change significantly within the course
of a use session (and some changes may be caught
by other search providers).
Updated documentation. Removed most unused funtions.
Removed references to the search service in the
search template -- necissary functions added to
the search controller.
(Search in a 'working' state again.)
Moved the polling for most recent results
from the search controller to the search
aggregator.
Also changed ng-change back to ng-keyup
in the search template.
Made the search bar text input go to ngModel.input,
rather than getting the text manually from the DOM
element. Additionally, removed the search service
from the search controller's scope.
Moving the responsibility of polling for updates
from the search controller to the search aggregator.
In progress. Previously this prototype was what
could be called semi-stable, but now it is no longer.
The tree is now hidden whenever there is
text in the search bar. (This allows for
the case when there are no search results,
but text in the search bar.)
Attempted to make the search results scroll,
but failed for now. Created a div for the
search results, load icon, and load more
button, which are the elements desired to
be scrolled. Did not work because search
result labels have absolute position text.
The search item highlight when selected or
hovered over is now talled, and the margin
between search items is reduced to
counteract any effect to spacing.
Selecting something in the search results now
also makes it selected in the filetree. It
remains selected even when the search results
are cleared. (The filetree does not
automatically expand to that position though.)
Changed how frequently the search controller
checks for updates. This makes the load icon
dissapear faster, and looks more natural. But,
may affect performance.
Also changed the point at which the loading
status becomes 'true'. Made it earlier, at
the beginning of the controller's update().
The selected object in the search results now
remains selected even after a new search is made.
It also will remain selected if it is clicked
on the file tree, but the file tree version is
not yet selected if it is clicked on the search
results list.
Removed the awkward spacing between the filetree
and the search bar. Now 'My Items' appears just
below the search bar.
Also added .search-holder to the sass, but haven't
done anything with it yet.
More correctly centered the load more button,
so that when the left panel is resized,
the button remains in the middle.
Additionally, added more comments to the sass.
When there is no input into the search bar
no results are displayed/displayed results
are removed. This is because the search
providers were changed to return empty
arrays for empty search strings.
Starting to modify the front-end so that
the searchbar appears in the tree view
area. Made the tree holder have relative
position so that the searchbar is visibile
for now. (Later will be different.)
Updating the searchbar to be again more
similar to the search view. It now has
a 'load more' button, but it is not
clickable for some reason. In progress.
Previously had removed the elasticsearch provider
from bundle.json so could work on the generic
search web worker. Now have modified the
elasticsearch provider to match the new interface
with the aggregator, and it works.
At this point, search is 'working'
The interface remains the same, but the web worker
returns a pseudo dictionary (actually an object)
after being told the search. The key value pairs
for this dictionary are ids and scores.
The search controller now updates the display
results list, then repeatedly asks the
aggregator to update until the timestamps
all are at least as new as the one that the
controller originally gave for the query.
Basically, the search now updates correctly
without having to press enter again.
The search aggregator now correctly gets
from the providers, but because of not
sync, the display is effectively one press
behind the correct search results.
Still, working to some extent.
Removed the paging from the search view,
because later instead of paging there will
be a 'view more' option.
Also made the generic search provider
return searchResult objects instead of
raw domain objects.
(Temporariliy removed the elasticsearch provider
from bundle.json)
Added a timestamp parameter to the query so that
the aggregator can tell when the results were last
updated. Created a separate function for getting
the results list. GenericSearch now converts back
from models to domain objects after the web worker
does its work.
Connecting GenericSearch to the web worker is still
in progress. The aggregator currently gets the
results before the web worker is finished. In process
of fixing sync issue.
Changed the search aggregator's filterRepeats
function to choose the version of the searchResult
object that has the higher score, when it
encounters multiple searchResult objects
corresponding to a domain object ID.
Also changed the search providers and aggregator
such that the validType parameter is now optional,
with a function that always returns true as the
defualt.
Changed the providers to return only the first
search result. Each searchResult object has a
function next() which returns the next search
result. This allows the search aggregator to
load more results without making a whole new
search query. (Still requuires some cleaning
up.)
Added a time limit for generic search's indexing
of the filetree, at which point it will just
return the portion of the filetree it has
indexed.
Additioanlly attempted to move this part of
the functionality to a webworker, but is not
working because of unclonability of the
objects. (Commented out)
Also updated some documentation comments.
Changed how the generic search provider determines
search matches. It now splits the search input into
search terms by spliting at spaces, and then scores
the results by how many of the terms appear as
substrings in the result.
Added validType() as a callback parameter to the search
providers. It is defined in the search aggregator, and
is used to put any restrictions on object type in the
displayed search results.
Renamed EverythingSearchProvider to GenericSearchProvider.
Changed the controller for the search input
to respond on keypress rather than keyup.
Added comments better explaining searchResult
objects to the search aggregator.
The search aggregator now merges search
results from different providers better.
It removed duplicate results, and orders
the list of results from highest to
lowest score.
Renamed QueryService as SearchService and changed
the corresponding references to it. Added a
SearchAggregator file and related files. Not
yet begun with the implementation.
Changed the default number of results to be
a max of 25, and added a parameter to allow
the user to set this. (May be used in an
advaned search later?) Because folders are
filtered out, the number displayed is not
necissarily exact.